wgsl-out: Do not output semicolon after struct decl

This commit is contained in:
Pu Xingyu 2022-03-27 14:56:34 +08:00 committed by Dzmitry Malyshau
parent 3c313564ac
commit b17e6cfe43
31 changed files with 68 additions and 68 deletions

View File

@ -423,7 +423,7 @@ impl<W: Write> Writer<W> {
writeln!(self.out)?;
}
write!(self.out, "}};")?;
write!(self.out, "}}")?;
writeln!(self.out)?;

View File

@ -1,10 +1,10 @@
struct ColorMaterial_color {
Color: vec4<f32>,
};
}
struct FragmentOutput {
@location(0) o_Target: vec4<f32>,
};
}
var<private> v_Uv_1: vec2<f32>;
var<private> o_Target: vec4<f32>;

View File

@ -1,19 +1,19 @@
struct Camera {
ViewProj: mat4x4<f32>,
};
}
struct Transform {
Model: mat4x4<f32>,
};
}
struct Sprite_size {
size: vec2<f32>,
};
}
struct VertexOutput {
@location(0) v_Uv: vec2<f32>,
@builtin(position) member: vec4<f32>,
};
}
var<private> Vertex_Position_1: vec3<f32>;
var<private> Vertex_Normal_1: vec3<f32>;

View File

@ -1,17 +1,17 @@
struct Camera {
ViewProj: mat4x4<f32>,
};
}
struct Transform {
Model: mat4x4<f32>,
};
}
struct VertexOutput {
@location(0) v_Position: vec3<f32>,
@location(1) v_Normal: vec3<f32>,
@location(2) v_Uv: vec2<f32>,
@builtin(position) member: vec4<f32>,
};
}
var<private> Vertex_Position_1: vec3<f32>;
var<private> Vertex_Normal_1: vec3<f32>;

View File

@ -1,6 +1,6 @@
struct PrimeIndices {
indices: array<u32>,
};
}
@group(0) @binding(0)
var<storage, read_write> global: PrimeIndices;

View File

@ -1,15 +1,15 @@
struct Globals {
view_matrix: mat4x4<f32>,
};
}
struct VertexPushConstants {
world_matrix: mat4x4<f32>,
};
}
struct VertexOutput {
@location(0) frag_color: vec4<f32>,
@builtin(position) member: vec4<f32>,
};
}
@group(0) @binding(0)
var<uniform> global: Globals;

View File

@ -1,6 +1,6 @@
struct PushConstants {
example: f32,
};
}
var<push_constant> c: PushConstants;

View File

@ -1,6 +1,6 @@
struct AlignedWrapper {
value: i32,
};
}
struct Bar {
matrix: mat4x4<f32>,
@ -8,7 +8,7 @@ struct Bar {
atom: atomic<i32>,
arr: array<vec2<u32>,2>,
data: array<AlignedWrapper>,
};
}
@group(0) @binding(0)
var<storage, read_write> bar: Bar;

View File

@ -2,51 +2,51 @@ struct PointLight {
pos: vec4<f32>,
color: vec4<f32>,
lightParams: vec4<f32>,
};
}
struct DirectionalLight {
direction: vec4<f32>,
color: vec4<f32>,
};
}
struct CameraViewProj {
ViewProj: mat4x4<f32>,
};
}
struct CameraPosition {
CameraPos: vec4<f32>,
};
}
struct Lights {
AmbientColor: vec4<f32>,
NumLights: vec4<u32>,
PointLights: array<PointLight,10u>,
DirectionalLights: array<DirectionalLight,1u>,
};
}
struct StandardMaterial_base_color {
base_color: vec4<f32>,
};
}
struct StandardMaterial_roughness {
perceptual_roughness: f32,
};
}
struct StandardMaterial_metallic {
metallic: f32,
};
}
struct StandardMaterial_reflectance {
reflectance: f32,
};
}
struct StandardMaterial_emissive {
emissive: vec4<f32>,
};
}
struct FragmentOutput {
@location(0) o_Target: vec4<f32>,
};
}
var<private> v_WorldPosition_1: vec3<f32>;
var<private> v_WorldNormal_1: vec3<f32>;

View File

@ -1,10 +1,10 @@
struct CameraViewProj {
ViewProj: mat4x4<f32>,
};
}
struct Transform {
Model: mat4x4<f32>,
};
}
struct VertexOutput {
@location(0) v_WorldPosition: vec3<f32>,
@ -12,7 +12,7 @@ struct VertexOutput {
@location(2) v_Uv: vec2<f32>,
@location(3) v_WorldTangent: vec4<f32>,
@builtin(position) member: vec4<f32>,
};
}
var<private> Vertex_Position_1: vec3<f32>;
var<private> Vertex_Normal_1: vec3<f32>;

View File

@ -1,7 +1,7 @@
struct Particle {
pos: vec2<f32>,
vel: vec2<f32>,
};
}
struct SimParams {
deltaT: f32,
@ -11,11 +11,11 @@ struct SimParams {
rule1Scale: f32,
rule2Scale: f32,
rule3Scale: f32,
};
}
struct Particles {
particles: array<Particle>,
};
}
let NUM_PARTICLES: u32 = 1500u;

View File

@ -1,6 +1,6 @@
struct FragmentOutput {
@location(0) o_color: vec4<f32>,
};
}
var<private> o_color: vec4<f32>;

View File

@ -1,6 +1,6 @@
struct VertexOutput {
@builtin(position) member: vec4<f32>,
};
}
var<private> a_pos_1: vec2<f32>;
var<private> gl_Position: vec4<f32>;

View File

@ -1,6 +1,6 @@
struct PrimeIndices {
data: array<u32>,
};
}
@group(0) @binding(0)
var<storage, read_write> v_indices: PrimeIndices;

View File

@ -1,6 +1,6 @@
struct Data {
vecs: array<vec4<f32>,42u>,
};
}
@group(1) @binding(0)
var<uniform> global: Data;

View File

@ -1,24 +1,24 @@
struct VertexData {
position: vec2<f32>,
a: vec2<f32>,
};
}
struct FragmentData {
position: vec2<f32>,
a: vec2<f32>,
};
}
struct TestStruct {
a: f32,
b: f32,
};
}
struct VertexOutput {
@location(0) position: vec2<f32>,
@location(1) a: vec2<f32>,
@location(2) out_array: vec4<f32>,
@location(3) out_array_1: vec4<f32>,
};
}
var<private> vert: VertexData;
var<private> frag: FragmentData;

View File

@ -1,6 +1,6 @@
struct type_1 {
member: i32,
};
}
@group(0) @binding(0)
var<storage, read_write> unnamed: type_1;

View File

@ -1,10 +1,10 @@
struct BST {
data: i32,
};
}
struct FragmentOutput {
@location(0) o_color: vec4<f32>,
};
}
var<private> global: f32;
var<private> o_color: vec4<f32>;

View File

@ -1,12 +1,12 @@
struct PushConstants {
index: u32,
double: vec2<f32>,
};
}
struct FragmentIn {
@location(0) color: vec4<f32>,
@builtin(primitive_index) primitive_index: u32,
};
}
var<push_constant> pc: PushConstants;

View File

@ -2,11 +2,11 @@ struct Mat4x3_ {
mx: vec4<f32>,
my: vec4<f32>,
mz: vec4<f32>,
};
}
struct FragmentOutput {
@location(0) o_color: vec4<f32>,
};
}
var<private> o_color: vec4<f32>;

View File

@ -1,7 +1,7 @@
struct Foo {
v3_: vec3<f32>,
v1_: f32,
};
}
let Foo_2: bool = true;

View File

@ -1,21 +1,21 @@
struct VertexOutput {
@builtin(position) position: vec4<f32>,
@location(1) varying: f32,
};
}
struct FragmentOutput {
@builtin(frag_depth) depth: f32,
@builtin(sample_mask) sample_mask: u32,
@location(0) color: f32,
};
}
struct Input1_ {
@builtin(vertex_index) index: u32,
};
}
struct Input2_ {
@builtin(instance_index) index: u32,
};
}
var<workgroup> output: array<u32,1>;

View File

@ -7,7 +7,7 @@ struct FragmentInput {
@location(4) perspective: vec4<f32>,
@location(5) @interpolate(perspective, centroid) perspective_centroid: f32,
@location(6) @interpolate(perspective, sample) perspective_sample: f32,
};
}
@stage(vertex)
fn vert_main() -> FragmentInput {

View File

@ -1,7 +1,7 @@
struct Foo {
a: vec4<f32>,
b: i32,
};
}
let v_f32_one: vec4<f32> = vec4<f32>(1.0, 1.0, 1.0, 1.0);
let v_f32_zero: vec4<f32> = vec4<f32>(0.0, 0.0, 0.0, 0.0);

View File

@ -1,6 +1,6 @@
struct DynamicArray {
arr: array<u32>,
};
}
@group(0) @binding(0)
var<storage, read_write> dynamic_array: DynamicArray;

View File

@ -1,11 +1,11 @@
struct gl_PerVertex {
@builtin(position) gl_Position: vec4<f32>,
};
}
struct VertexOutput {
@location(0) member: vec2<f32>,
@builtin(position) gl_Position: vec4<f32>,
};
}
var<private> v_uv: vec2<f32>;
var<private> a_uv_1: vec2<f32>;

View File

@ -1,7 +1,7 @@
struct VertexOutput {
@location(0) uv: vec2<f32>,
@builtin(position) position: vec4<f32>,
};
}
let c_scale: f32 = 1.2000000476837158;

View File

@ -1,6 +1,6 @@
struct FragmentOutput {
@location(0) o_color: vec4<f32>,
};
}
var<private> v_uv_1: vec2<f32>;
var<private> o_color: vec4<f32>;

View File

@ -1,7 +1,7 @@
struct VertexOutput {
@location(0) v_uv: vec2<f32>,
@builtin(position) member: vec4<f32>,
};
}
var<private> a_pos_1: vec2<f32>;
var<private> a_uv_1: vec2<f32>;

View File

@ -1,24 +1,24 @@
struct Globals {
view_proj: mat4x4<f32>,
num_lights: vec4<u32>,
};
}
struct Entity {
world: mat4x4<f32>,
color: vec4<f32>,
};
}
struct VertexOutput {
@builtin(position) proj_position: vec4<f32>,
@location(0) world_normal: vec3<f32>,
@location(1) world_position: vec4<f32>,
};
}
struct Light {
proj: mat4x4<f32>,
pos: vec4<f32>,
color: vec4<f32>,
};
}
let c_ambient: vec3<f32> = vec3<f32>(0.05000000074505806, 0.05000000074505806, 0.05000000074505806);
let c_max_lights: u32 = 10u;

View File

@ -1,12 +1,12 @@
struct VertexOutput {
@builtin(position) position: vec4<f32>,
@location(0) uv: vec3<f32>,
};
}
struct Data {
proj_inv: mat4x4<f32>,
view: mat4x4<f32>,
};
}
@group(0) @binding(0)
var<uniform> r_data: Data;