mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[wgsl-out] Uses commas to separate struct members instead of semicolons
This commit is contained in:
committed by
Dzmitry Malyshau
parent
816fa347ad
commit
b5761d9611
@@ -419,7 +419,7 @@ impl<W: Write> Writer<W> {
|
||||
let member_name = &self.names[&NameKey::StructMember(handle, index as u32)];
|
||||
write!(self.out, "{}: ", member_name)?;
|
||||
self.write_type(module, member.ty)?;
|
||||
write!(self.out, ";")?;
|
||||
write!(self.out, ",")?;
|
||||
writeln!(self.out)?;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
struct ColorMaterial_color {
|
||||
Color: vec4<f32>;
|
||||
Color: vec4<f32>,
|
||||
};
|
||||
|
||||
struct FragmentOutput {
|
||||
@location(0) o_Target: vec4<f32>;
|
||||
@location(0) o_Target: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> v_Uv_1: vec2<f32>;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
struct Camera {
|
||||
ViewProj: mat4x4<f32>;
|
||||
ViewProj: mat4x4<f32>,
|
||||
};
|
||||
|
||||
struct Transform {
|
||||
Model: mat4x4<f32>;
|
||||
Model: mat4x4<f32>,
|
||||
};
|
||||
|
||||
struct Sprite_size {
|
||||
size: vec2<f32>;
|
||||
size: vec2<f32>,
|
||||
};
|
||||
|
||||
struct VertexOutput {
|
||||
@location(0) v_Uv: vec2<f32>;
|
||||
@builtin(position) member: vec4<f32>;
|
||||
@location(0) v_Uv: vec2<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> Vertex_Position_1: vec3<f32>;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
struct Camera {
|
||||
ViewProj: mat4x4<f32>;
|
||||
ViewProj: mat4x4<f32>,
|
||||
};
|
||||
|
||||
struct Transform {
|
||||
Model: mat4x4<f32>;
|
||||
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>;
|
||||
@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>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct PrimeIndices {
|
||||
indices: array<u32>;
|
||||
indices: array<u32>,
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
struct Globals {
|
||||
view_matrix: mat4x4<f32>;
|
||||
view_matrix: mat4x4<f32>,
|
||||
};
|
||||
|
||||
struct VertexPushConstants {
|
||||
world_matrix: mat4x4<f32>;
|
||||
world_matrix: mat4x4<f32>,
|
||||
};
|
||||
|
||||
struct VertexOutput {
|
||||
@location(0) frag_color: vec4<f32>;
|
||||
@builtin(position) member: vec4<f32>;
|
||||
@location(0) frag_color: vec4<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct PushConstants {
|
||||
example: f32;
|
||||
example: f32,
|
||||
};
|
||||
|
||||
var<push_constant> c: PushConstants;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
struct AlignedWrapper {
|
||||
value: i32;
|
||||
value: i32,
|
||||
};
|
||||
|
||||
struct Bar {
|
||||
matrix: mat4x4<f32>;
|
||||
matrix_array: array<mat2x2<f32>,2>;
|
||||
atom: atomic<i32>;
|
||||
arr: array<vec2<u32>,2>;
|
||||
data: array<AlignedWrapper>;
|
||||
matrix: mat4x4<f32>,
|
||||
matrix_array: array<mat2x2<f32>,2>,
|
||||
atom: atomic<i32>,
|
||||
arr: array<vec2<u32>,2>,
|
||||
data: array<AlignedWrapper>,
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
struct PointLight {
|
||||
pos: vec4<f32>;
|
||||
color: vec4<f32>;
|
||||
lightParams: vec4<f32>;
|
||||
pos: vec4<f32>,
|
||||
color: vec4<f32>,
|
||||
lightParams: vec4<f32>,
|
||||
};
|
||||
|
||||
struct DirectionalLight {
|
||||
direction: vec4<f32>;
|
||||
color: vec4<f32>;
|
||||
direction: vec4<f32>,
|
||||
color: vec4<f32>,
|
||||
};
|
||||
|
||||
struct CameraViewProj {
|
||||
ViewProj: mat4x4<f32>;
|
||||
ViewProj: mat4x4<f32>,
|
||||
};
|
||||
|
||||
struct CameraPosition {
|
||||
CameraPos: vec4<f32>;
|
||||
CameraPos: vec4<f32>,
|
||||
};
|
||||
|
||||
struct Lights {
|
||||
AmbientColor: vec4<f32>;
|
||||
NumLights: vec4<u32>;
|
||||
PointLights: array<PointLight,10u>;
|
||||
DirectionalLights: array<DirectionalLight,1u>;
|
||||
AmbientColor: vec4<f32>,
|
||||
NumLights: vec4<u32>,
|
||||
PointLights: array<PointLight,10u>,
|
||||
DirectionalLights: array<DirectionalLight,1u>,
|
||||
};
|
||||
|
||||
struct StandardMaterial_base_color {
|
||||
base_color: vec4<f32>;
|
||||
base_color: vec4<f32>,
|
||||
};
|
||||
|
||||
struct StandardMaterial_roughness {
|
||||
perceptual_roughness: f32;
|
||||
perceptual_roughness: f32,
|
||||
};
|
||||
|
||||
struct StandardMaterial_metallic {
|
||||
metallic: f32;
|
||||
metallic: f32,
|
||||
};
|
||||
|
||||
struct StandardMaterial_reflectance {
|
||||
reflectance: f32;
|
||||
reflectance: f32,
|
||||
};
|
||||
|
||||
struct StandardMaterial_emissive {
|
||||
emissive: vec4<f32>;
|
||||
emissive: vec4<f32>,
|
||||
};
|
||||
|
||||
struct FragmentOutput {
|
||||
@location(0) o_Target: vec4<f32>;
|
||||
@location(0) o_Target: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> v_WorldPosition_1: vec3<f32>;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
struct CameraViewProj {
|
||||
ViewProj: mat4x4<f32>;
|
||||
ViewProj: mat4x4<f32>,
|
||||
};
|
||||
|
||||
struct Transform {
|
||||
Model: mat4x4<f32>;
|
||||
Model: mat4x4<f32>,
|
||||
};
|
||||
|
||||
struct VertexOutput {
|
||||
@location(0) v_WorldPosition: vec3<f32>;
|
||||
@location(1) v_WorldNormal: vec3<f32>;
|
||||
@location(2) v_Uv: vec2<f32>;
|
||||
@location(3) v_WorldTangent: vec4<f32>;
|
||||
@builtin(position) member: vec4<f32>;
|
||||
@location(0) v_WorldPosition: vec3<f32>,
|
||||
@location(1) v_WorldNormal: vec3<f32>,
|
||||
@location(2) v_Uv: vec2<f32>,
|
||||
@location(3) v_WorldTangent: vec4<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> Vertex_Position_1: vec3<f32>;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
struct Particle {
|
||||
pos: vec2<f32>;
|
||||
vel: vec2<f32>;
|
||||
pos: vec2<f32>,
|
||||
vel: vec2<f32>,
|
||||
};
|
||||
|
||||
struct SimParams {
|
||||
deltaT: f32;
|
||||
rule1Distance: f32;
|
||||
rule2Distance: f32;
|
||||
rule3Distance: f32;
|
||||
rule1Scale: f32;
|
||||
rule2Scale: f32;
|
||||
rule3Scale: f32;
|
||||
deltaT: f32,
|
||||
rule1Distance: f32,
|
||||
rule2Distance: f32,
|
||||
rule3Distance: f32,
|
||||
rule1Scale: f32,
|
||||
rule2Scale: f32,
|
||||
rule3Scale: f32,
|
||||
};
|
||||
|
||||
struct Particles {
|
||||
particles: array<Particle>;
|
||||
particles: array<Particle>,
|
||||
};
|
||||
|
||||
let NUM_PARTICLES: u32 = 1500u;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct FragmentOutput {
|
||||
@location(0) o_color: vec4<f32>;
|
||||
@location(0) o_color: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> o_color: vec4<f32>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct VertexOutput {
|
||||
@builtin(position) member: vec4<f32>;
|
||||
@builtin(position) member: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> a_pos_1: vec2<f32>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct PrimeIndices {
|
||||
data: array<u32>;
|
||||
data: array<u32>,
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct Data {
|
||||
vecs: array<vec4<f32>,42u>;
|
||||
vecs: array<vec4<f32>,42u>,
|
||||
};
|
||||
|
||||
@group(1) @binding(0)
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
struct VertexData {
|
||||
position: vec2<f32>;
|
||||
a: vec2<f32>;
|
||||
position: vec2<f32>,
|
||||
a: vec2<f32>,
|
||||
};
|
||||
|
||||
struct FragmentData {
|
||||
position: vec2<f32>;
|
||||
a: vec2<f32>;
|
||||
position: vec2<f32>,
|
||||
a: vec2<f32>,
|
||||
};
|
||||
|
||||
struct TestStruct {
|
||||
a: f32;
|
||||
b: f32;
|
||||
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>;
|
||||
@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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct type_1 {
|
||||
member: i32;
|
||||
member: i32,
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
struct BST {
|
||||
data: i32;
|
||||
data: i32,
|
||||
};
|
||||
|
||||
struct FragmentOutput {
|
||||
@location(0) o_color: vec4<f32>;
|
||||
@location(0) o_color: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> global: f32;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
struct PushConstants {
|
||||
index: u32;
|
||||
double: vec2<f32>;
|
||||
index: u32,
|
||||
double: vec2<f32>,
|
||||
};
|
||||
|
||||
struct FragmentIn {
|
||||
@location(0) color: vec4<f32>;
|
||||
@builtin(primitive_index) primitive_index: u32;
|
||||
@location(0) color: vec4<f32>,
|
||||
@builtin(primitive_index) primitive_index: u32,
|
||||
};
|
||||
|
||||
var<push_constant> pc: PushConstants;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
struct Mat4x3_ {
|
||||
mx: vec4<f32>;
|
||||
my: vec4<f32>;
|
||||
mz: vec4<f32>;
|
||||
mx: vec4<f32>,
|
||||
my: vec4<f32>,
|
||||
mz: vec4<f32>,
|
||||
};
|
||||
|
||||
struct FragmentOutput {
|
||||
@location(0) o_color: vec4<f32>;
|
||||
@location(0) o_color: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> o_color: vec4<f32>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
struct Foo {
|
||||
v3_: vec3<f32>;
|
||||
v1_: f32;
|
||||
v3_: vec3<f32>,
|
||||
v1_: f32,
|
||||
};
|
||||
|
||||
let Foo_2: bool = true;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
struct VertexOutput {
|
||||
@builtin(position) position: vec4<f32>;
|
||||
@location(1) varying: f32;
|
||||
@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;
|
||||
@builtin(frag_depth) depth: f32,
|
||||
@builtin(sample_mask) sample_mask: u32,
|
||||
@location(0) color: f32,
|
||||
};
|
||||
|
||||
struct Input1_ {
|
||||
@builtin(vertex_index) index: u32;
|
||||
@builtin(vertex_index) index: u32,
|
||||
};
|
||||
|
||||
struct Input2_ {
|
||||
@builtin(instance_index) index: u32;
|
||||
@builtin(instance_index) index: u32,
|
||||
};
|
||||
|
||||
var<workgroup> output: array<u32,1>;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
struct FragmentInput {
|
||||
@builtin(position) position: vec4<f32>;
|
||||
@location(0) flat: u32;
|
||||
@location(1) @interpolate(linear) linear: f32;
|
||||
@location(2) @interpolate(linear, centroid) linear_centroid: vec2<f32>;
|
||||
@location(3) @interpolate(linear, sample) linear_sample: vec3<f32>;
|
||||
@location(4) perspective: vec4<f32>;
|
||||
@location(5) @interpolate(perspective, centroid) perspective_centroid: f32;
|
||||
@location(6) @interpolate(perspective, sample) perspective_sample: f32;
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) flat: u32,
|
||||
@location(1) @interpolate(linear) linear: f32,
|
||||
@location(2) @interpolate(linear, centroid) linear_centroid: vec2<f32>,
|
||||
@location(3) @interpolate(linear, sample) linear_sample: vec3<f32>,
|
||||
@location(4) perspective: vec4<f32>,
|
||||
@location(5) @interpolate(perspective, centroid) perspective_centroid: f32,
|
||||
@location(6) @interpolate(perspective, sample) perspective_sample: f32,
|
||||
};
|
||||
|
||||
@stage(vertex)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
struct Foo {
|
||||
a: vec4<f32>;
|
||||
b: i32;
|
||||
a: vec4<f32>,
|
||||
b: i32,
|
||||
};
|
||||
|
||||
let v_f32_one: vec4<f32> = vec4<f32>(1.0, 1.0, 1.0, 1.0);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct DynamicArray {
|
||||
arr: array<u32>;
|
||||
arr: array<u32>,
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
struct gl_PerVertex {
|
||||
@builtin(position) gl_Position: vec4<f32>;
|
||||
@builtin(position) gl_Position: vec4<f32>,
|
||||
};
|
||||
|
||||
struct VertexOutput {
|
||||
@location(0) member: vec2<f32>;
|
||||
@builtin(position) gl_Position: vec4<f32>;
|
||||
@location(0) member: vec2<f32>,
|
||||
@builtin(position) gl_Position: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> v_uv: vec2<f32>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
struct VertexOutput {
|
||||
@location(0) uv: vec2<f32>;
|
||||
@builtin(position) position: vec4<f32>;
|
||||
@location(0) uv: vec2<f32>,
|
||||
@builtin(position) position: vec4<f32>,
|
||||
};
|
||||
|
||||
let c_scale: f32 = 1.2000000476837158;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
struct FragmentOutput {
|
||||
@location(0) o_color: vec4<f32>;
|
||||
@location(0) o_color: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> v_uv_1: vec2<f32>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
struct VertexOutput {
|
||||
@location(0) v_uv: vec2<f32>;
|
||||
@builtin(position) member: vec4<f32>;
|
||||
@location(0) v_uv: vec2<f32>,
|
||||
@builtin(position) member: vec4<f32>,
|
||||
};
|
||||
|
||||
var<private> a_pos_1: vec2<f32>;
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
struct Globals {
|
||||
view_proj: mat4x4<f32>;
|
||||
num_lights: vec4<u32>;
|
||||
view_proj: mat4x4<f32>,
|
||||
num_lights: vec4<u32>,
|
||||
};
|
||||
|
||||
struct Entity {
|
||||
world: mat4x4<f32>;
|
||||
color: vec4<f32>;
|
||||
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>;
|
||||
@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>;
|
||||
proj: mat4x4<f32>,
|
||||
pos: vec4<f32>,
|
||||
color: vec4<f32>,
|
||||
};
|
||||
|
||||
let c_ambient: vec3<f32> = vec3<f32>(0.05000000074505806, 0.05000000074505806, 0.05000000074505806);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
struct VertexOutput {
|
||||
@builtin(position) position: vec4<f32>;
|
||||
@location(0) uv: vec3<f32>;
|
||||
@builtin(position) position: vec4<f32>,
|
||||
@location(0) uv: vec3<f32>,
|
||||
};
|
||||
|
||||
struct Data {
|
||||
proj_inv: mat4x4<f32>;
|
||||
view: mat4x4<f32>;
|
||||
proj_inv: mat4x4<f32>,
|
||||
view: mat4x4<f32>,
|
||||
};
|
||||
|
||||
@group(0) @binding(0)
|
||||
|
||||
Reference in New Issue
Block a user