mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +00:00
wgsl: Replace [[decoration]] with @decoration
Deprecate the old syntax. Migrate everything to the new syntax. Bug: tint:1382 Change-Id: Ide12b2e927b17dc93b9714c7049090864cc568d3 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/77260 Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com> Commit-Queue: David Neto <dneto@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
8f1d5224ee
commit
01e4b6fc18
@@ -1,10 +1,10 @@
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main(
|
||||
[[builtin(local_invocation_id)]] local_invocation_id : vec3<u32>,
|
||||
[[builtin(local_invocation_index)]] local_invocation_index : u32,
|
||||
[[builtin(global_invocation_id)]] global_invocation_id : vec3<u32>,
|
||||
[[builtin(workgroup_id)]] workgroup_id : vec3<u32>,
|
||||
[[builtin(num_workgroups)]] num_workgroups : vec3<u32>,
|
||||
@builtin(local_invocation_id) local_invocation_id : vec3<u32>,
|
||||
@builtin(local_invocation_index) local_invocation_index : u32,
|
||||
@builtin(global_invocation_id) global_invocation_id : vec3<u32>,
|
||||
@builtin(workgroup_id) workgroup_id : vec3<u32>,
|
||||
@builtin(num_workgroups) num_workgroups : vec3<u32>,
|
||||
) {
|
||||
let foo : u32 =
|
||||
local_invocation_id.x +
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn main([[builtin(local_invocation_id)]] local_invocation_id : vec3<u32>, [[builtin(local_invocation_index)]] local_invocation_index : u32, [[builtin(global_invocation_id)]] global_invocation_id : vec3<u32>, [[builtin(workgroup_id)]] workgroup_id : vec3<u32>, [[builtin(num_workgroups)]] num_workgroups : vec3<u32>) {
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main(@builtin(local_invocation_id) local_invocation_id : vec3<u32>, @builtin(local_invocation_index) local_invocation_index : u32, @builtin(global_invocation_id) global_invocation_id : vec3<u32>, @builtin(workgroup_id) workgroup_id : vec3<u32>, @builtin(num_workgroups) num_workgroups : vec3<u32>) {
|
||||
let foo : u32 = ((((local_invocation_id.x + local_invocation_index) + global_invocation_id.x) + workgroup_id.x) + num_workgroups.x);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
struct ComputeInputs {
|
||||
[[builtin(local_invocation_id)]] local_invocation_id : vec3<u32>;
|
||||
[[builtin(local_invocation_index)]] local_invocation_index : u32;
|
||||
[[builtin(global_invocation_id)]] global_invocation_id : vec3<u32>;
|
||||
[[builtin(workgroup_id)]] workgroup_id : vec3<u32>;
|
||||
[[builtin(num_workgroups)]] num_workgroups : vec3<u32>;
|
||||
@builtin(local_invocation_id) local_invocation_id : vec3<u32>;
|
||||
@builtin(local_invocation_index) local_invocation_index : u32;
|
||||
@builtin(global_invocation_id) global_invocation_id : vec3<u32>;
|
||||
@builtin(workgroup_id) workgroup_id : vec3<u32>;
|
||||
@builtin(num_workgroups) num_workgroups : vec3<u32>;
|
||||
};
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main(inputs : ComputeInputs) {
|
||||
let foo : u32 =
|
||||
inputs.local_invocation_id.x +
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
struct ComputeInputs {
|
||||
[[builtin(local_invocation_id)]]
|
||||
@builtin(local_invocation_id)
|
||||
local_invocation_id : vec3<u32>;
|
||||
[[builtin(local_invocation_index)]]
|
||||
@builtin(local_invocation_index)
|
||||
local_invocation_index : u32;
|
||||
[[builtin(global_invocation_id)]]
|
||||
@builtin(global_invocation_id)
|
||||
global_invocation_id : vec3<u32>;
|
||||
[[builtin(workgroup_id)]]
|
||||
@builtin(workgroup_id)
|
||||
workgroup_id : vec3<u32>;
|
||||
[[builtin(num_workgroups)]]
|
||||
@builtin(num_workgroups)
|
||||
num_workgroups : vec3<u32>;
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main(inputs : ComputeInputs) {
|
||||
let foo : u32 = ((((inputs.local_invocation_id.x + inputs.local_invocation_index) + inputs.global_invocation_id.x) + inputs.workgroup_id.x) + inputs.num_workgroups.x);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
struct ComputeInputs0 {
|
||||
[[builtin(local_invocation_id)]] local_invocation_id : vec3<u32>;
|
||||
@builtin(local_invocation_id) local_invocation_id : vec3<u32>;
|
||||
};
|
||||
struct ComputeInputs1 {
|
||||
[[builtin(workgroup_id)]] workgroup_id : vec3<u32>;
|
||||
@builtin(workgroup_id) workgroup_id : vec3<u32>;
|
||||
};
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main(
|
||||
inputs0 : ComputeInputs0,
|
||||
[[builtin(local_invocation_index)]] local_invocation_index : u32,
|
||||
[[builtin(global_invocation_id)]] global_invocation_id : vec3<u32>,
|
||||
@builtin(local_invocation_index) local_invocation_index : u32,
|
||||
@builtin(global_invocation_id) global_invocation_id : vec3<u32>,
|
||||
inputs1 : ComputeInputs1,
|
||||
) {
|
||||
let foo : u32 =
|
||||
inputs0.local_invocation_id.x +
|
||||
local_invocation_index +
|
||||
global_invocation_id.x +
|
||||
local_invocation_index +
|
||||
global_invocation_id.x +
|
||||
inputs1.workgroup_id.x;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
struct ComputeInputs0 {
|
||||
[[builtin(local_invocation_id)]]
|
||||
@builtin(local_invocation_id)
|
||||
local_invocation_id : vec3<u32>;
|
||||
}
|
||||
|
||||
struct ComputeInputs1 {
|
||||
[[builtin(workgroup_id)]]
|
||||
@builtin(workgroup_id)
|
||||
workgroup_id : vec3<u32>;
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1)]]
|
||||
fn main(inputs0 : ComputeInputs0, [[builtin(local_invocation_index)]] local_invocation_index : u32, [[builtin(global_invocation_id)]] global_invocation_id : vec3<u32>, inputs1 : ComputeInputs1) {
|
||||
@stage(compute) @workgroup_size(1)
|
||||
fn main(inputs0 : ComputeInputs0, @builtin(local_invocation_index) local_invocation_index : u32, @builtin(global_invocation_id) global_invocation_id : vec3<u32>, inputs1 : ComputeInputs1) {
|
||||
let foo : u32 = (((inputs0.local_invocation_id.x + local_invocation_index) + global_invocation_id.x) + inputs1.workgroup_id.x);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(
|
||||
[[builtin(position)]] position : vec4<f32>,
|
||||
[[builtin(front_facing)]] front_facing : bool,
|
||||
[[builtin(sample_index)]] sample_index : u32,
|
||||
[[builtin(sample_mask)]] sample_mask : u32,
|
||||
@builtin(position) position : vec4<f32>,
|
||||
@builtin(front_facing) front_facing : bool,
|
||||
@builtin(sample_index) sample_index : u32,
|
||||
@builtin(sample_mask) sample_mask : u32,
|
||||
) {
|
||||
if (front_facing) {
|
||||
let foo : vec4<f32> = position;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[stage(fragment)]]
|
||||
fn main([[builtin(position)]] position : vec4<f32>, [[builtin(front_facing)]] front_facing : bool, [[builtin(sample_index)]] sample_index : u32, [[builtin(sample_mask)]] sample_mask : u32) {
|
||||
@stage(fragment)
|
||||
fn main(@builtin(position) position : vec4<f32>, @builtin(front_facing) front_facing : bool, @builtin(sample_index) sample_index : u32, @builtin(sample_mask) sample_mask : u32) {
|
||||
if (front_facing) {
|
||||
let foo : vec4<f32> = position;
|
||||
let bar : u32 = (sample_index + sample_mask);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
struct FragmentInputs {
|
||||
[[builtin(position)]] position : vec4<f32>;
|
||||
[[builtin(front_facing)]] front_facing : bool;
|
||||
[[builtin(sample_index)]] sample_index : u32;
|
||||
[[builtin(sample_mask)]] sample_mask : u32;
|
||||
@builtin(position) position : vec4<f32>;
|
||||
@builtin(front_facing) front_facing : bool;
|
||||
@builtin(sample_index) sample_index : u32;
|
||||
@builtin(sample_mask) sample_mask : u32;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(inputs : FragmentInputs) {
|
||||
if (inputs.front_facing) {
|
||||
let foo : vec4<f32> = inputs.position;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
struct FragmentInputs {
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
position : vec4<f32>;
|
||||
[[builtin(front_facing)]]
|
||||
@builtin(front_facing)
|
||||
front_facing : bool;
|
||||
[[builtin(sample_index)]]
|
||||
@builtin(sample_index)
|
||||
sample_index : u32;
|
||||
[[builtin(sample_mask)]]
|
||||
@builtin(sample_mask)
|
||||
sample_mask : u32;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(inputs : FragmentInputs) {
|
||||
if (inputs.front_facing) {
|
||||
let foo : vec4<f32> = inputs.position;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(
|
||||
[[location(0), interpolate(flat)]] loc0 : i32,
|
||||
[[location(1), interpolate(flat)]] loc1 : u32,
|
||||
[[location(2)]] loc2 : f32,
|
||||
[[location(3)]] loc3 : vec4<f32>,
|
||||
@location(0) @interpolate(flat) loc0 : i32,
|
||||
@location(1) @interpolate(flat) loc1 : u32,
|
||||
@location(2) loc2 : f32,
|
||||
@location(3) loc3 : vec4<f32>,
|
||||
) {
|
||||
let i : i32 = loc0;
|
||||
let u : u32 = loc1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[stage(fragment)]]
|
||||
fn main([[location(0), interpolate(flat)]] loc0 : i32, [[location(1), interpolate(flat)]] loc1 : u32, [[location(2)]] loc2 : f32, [[location(3)]] loc3 : vec4<f32>) {
|
||||
@stage(fragment)
|
||||
fn main(@location(0) @interpolate(flat) loc0 : i32, @location(1) @interpolate(flat) loc1 : u32, @location(2) loc2 : f32, @location(3) loc3 : vec4<f32>) {
|
||||
let i : i32 = loc0;
|
||||
let u : u32 = loc1;
|
||||
let f : f32 = loc2;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
struct FragmentInputs {
|
||||
[[location(0), interpolate(flat)]] loc0 : i32;
|
||||
[[location(1), interpolate(flat)]] loc1 : u32;
|
||||
[[location(2)]] loc2 : f32;
|
||||
[[location(3)]] loc3 : vec4<f32>;
|
||||
@location(0) @interpolate(flat) loc0 : i32;
|
||||
@location(1) @interpolate(flat) loc1 : u32;
|
||||
@location(2) loc2 : f32;
|
||||
@location(3) loc3 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(inputs : FragmentInputs) {
|
||||
let i : i32 = inputs.loc0;
|
||||
let u : u32 = inputs.loc1;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
struct FragmentInputs {
|
||||
[[location(0), interpolate(flat)]]
|
||||
@location(0) @interpolate(flat)
|
||||
loc0 : i32;
|
||||
[[location(1), interpolate(flat)]]
|
||||
@location(1) @interpolate(flat)
|
||||
loc1 : u32;
|
||||
[[location(2)]]
|
||||
@location(2)
|
||||
loc2 : f32;
|
||||
[[location(3)]]
|
||||
@location(3)
|
||||
loc3 : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(inputs : FragmentInputs) {
|
||||
let i : i32 = inputs.loc0;
|
||||
let u : u32 = inputs.loc1;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
struct FragmentInputs0 {
|
||||
[[builtin(position)]] position : vec4<f32>;
|
||||
[[location(0), interpolate(flat)]] loc0 : i32;
|
||||
@builtin(position) position : vec4<f32>;
|
||||
@location(0) @interpolate(flat) loc0 : i32;
|
||||
};
|
||||
struct FragmentInputs1 {
|
||||
[[location(3)]] loc3 : vec4<f32>;
|
||||
[[builtin(sample_mask)]] sample_mask : u32;
|
||||
@location(3) loc3 : vec4<f32>;
|
||||
@builtin(sample_mask) sample_mask : u32;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(
|
||||
inputs0 : FragmentInputs0,
|
||||
[[builtin(front_facing)]] front_facing : bool,
|
||||
[[location(1), interpolate(flat)]] loc1 : u32,
|
||||
[[builtin(sample_index)]] sample_index : u32,
|
||||
@builtin(front_facing) front_facing : bool,
|
||||
@location(1) @interpolate(flat) loc1 : u32,
|
||||
@builtin(sample_index) sample_index : u32,
|
||||
inputs1 : FragmentInputs1,
|
||||
[[location(2)]] loc2 : f32,
|
||||
@location(2) loc2 : f32,
|
||||
) {
|
||||
if (front_facing) {
|
||||
let foo : vec4<f32> = inputs0.position;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
struct FragmentInputs0 {
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
position : vec4<f32>;
|
||||
[[location(0), interpolate(flat)]]
|
||||
@location(0) @interpolate(flat)
|
||||
loc0 : i32;
|
||||
}
|
||||
|
||||
struct FragmentInputs1 {
|
||||
[[location(3)]]
|
||||
@location(3)
|
||||
loc3 : vec4<f32>;
|
||||
[[builtin(sample_mask)]]
|
||||
@builtin(sample_mask)
|
||||
sample_mask : u32;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main(inputs0 : FragmentInputs0, [[builtin(front_facing)]] front_facing : bool, [[location(1), interpolate(flat)]] loc1 : u32, [[builtin(sample_index)]] sample_index : u32, inputs1 : FragmentInputs1, [[location(2)]] loc2 : f32) {
|
||||
@stage(fragment)
|
||||
fn main(inputs0 : FragmentInputs0, @builtin(front_facing) front_facing : bool, @location(1) @interpolate(flat) loc1 : u32, @builtin(sample_index) sample_index : u32, inputs1 : FragmentInputs1, @location(2) loc2 : f32) {
|
||||
if (front_facing) {
|
||||
let foo : vec4<f32> = inputs0.position;
|
||||
let bar : u32 = (sample_index + inputs1.sample_mask);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[[stage(fragment)]]
|
||||
fn main1() -> [[builtin(frag_depth)]] f32 {
|
||||
@stage(fragment)
|
||||
fn main1() -> @builtin(frag_depth) f32 {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main2() -> [[builtin(sample_mask)]] u32 {
|
||||
@stage(fragment)
|
||||
fn main2() -> @builtin(sample_mask) u32 {
|
||||
return 1u;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[[stage(fragment)]]
|
||||
fn main1() -> [[builtin(frag_depth)]] f32 {
|
||||
@stage(fragment)
|
||||
fn main1() -> @builtin(frag_depth) f32 {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main2() -> [[builtin(sample_mask)]] u32 {
|
||||
@stage(fragment)
|
||||
fn main2() -> @builtin(sample_mask) u32 {
|
||||
return 1u;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
struct FragmentOutputs {
|
||||
[[builtin(frag_depth)]] frag_depth : f32;
|
||||
[[builtin(sample_mask)]] sample_mask : u32;
|
||||
@builtin(frag_depth) frag_depth : f32;
|
||||
@builtin(sample_mask) sample_mask : u32;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main() -> FragmentOutputs {
|
||||
return FragmentOutputs(1.0, 1u);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
struct FragmentOutputs {
|
||||
[[builtin(frag_depth)]]
|
||||
@builtin(frag_depth)
|
||||
frag_depth : f32;
|
||||
[[builtin(sample_mask)]]
|
||||
@builtin(sample_mask)
|
||||
sample_mask : u32;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main() -> FragmentOutputs {
|
||||
return FragmentOutputs(1.0, 1u);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
[[stage(fragment)]]
|
||||
fn main0() -> [[location(0)]] i32 {
|
||||
@stage(fragment)
|
||||
fn main0() -> @location(0) i32 {
|
||||
return 1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main1() -> [[location(1)]] u32 {
|
||||
@stage(fragment)
|
||||
fn main1() -> @location(1) u32 {
|
||||
return 1u;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main2() -> [[location(2)]] f32 {
|
||||
@stage(fragment)
|
||||
fn main2() -> @location(2) f32 {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main3() -> [[location(3)]] vec4<f32> {
|
||||
@stage(fragment)
|
||||
fn main3() -> @location(3) vec4<f32> {
|
||||
return vec4<f32>(1.0, 2.0, 3.0, 4.0);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
[[stage(fragment)]]
|
||||
fn main0() -> [[location(0)]] i32 {
|
||||
@stage(fragment)
|
||||
fn main0() -> @location(0) i32 {
|
||||
return 1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main1() -> [[location(1)]] u32 {
|
||||
@stage(fragment)
|
||||
fn main1() -> @location(1) u32 {
|
||||
return 1u;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main2() -> [[location(2)]] f32 {
|
||||
@stage(fragment)
|
||||
fn main2() -> @location(2) f32 {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main3() -> [[location(3)]] vec4<f32> {
|
||||
@stage(fragment)
|
||||
fn main3() -> @location(3) vec4<f32> {
|
||||
return vec4<f32>(1.0, 2.0, 3.0, 4.0);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
struct FragmentOutputs {
|
||||
[[location(0)]] loc0 : i32;
|
||||
[[location(1)]] loc1 : u32;
|
||||
[[location(2)]] loc2 : f32;
|
||||
[[location(3)]] loc3 : vec4<f32>;
|
||||
@location(0) loc0 : i32;
|
||||
@location(1) loc1 : u32;
|
||||
@location(2) loc2 : f32;
|
||||
@location(3) loc3 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main() -> FragmentOutputs {
|
||||
return FragmentOutputs(1, 1u, 1.0, vec4<f32>(1.0, 2.0, 3.0, 4.0));
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
struct FragmentOutputs {
|
||||
[[location(0)]]
|
||||
@location(0)
|
||||
loc0 : i32;
|
||||
[[location(1)]]
|
||||
@location(1)
|
||||
loc1 : u32;
|
||||
[[location(2)]]
|
||||
@location(2)
|
||||
loc2 : f32;
|
||||
[[location(3)]]
|
||||
@location(3)
|
||||
loc3 : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main() -> FragmentOutputs {
|
||||
return FragmentOutputs(1, 1u, 1.0, vec4<f32>(1.0, 2.0, 3.0, 4.0));
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
struct FragmentOutputs {
|
||||
[[location(0)]] loc0 : i32;
|
||||
[[builtin(frag_depth)]] frag_depth : f32;
|
||||
[[location(1)]] loc1 : u32;
|
||||
[[location(2)]] loc2 : f32;
|
||||
[[builtin(sample_mask)]] sample_mask : u32;
|
||||
[[location(3)]] loc3 : vec4<f32>;
|
||||
@location(0) loc0 : i32;
|
||||
@builtin(frag_depth) frag_depth : f32;
|
||||
@location(1) loc1 : u32;
|
||||
@location(2) loc2 : f32;
|
||||
@builtin(sample_mask) sample_mask : u32;
|
||||
@location(3) loc3 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main() -> FragmentOutputs {
|
||||
return FragmentOutputs(1, 2.0, 1u, 1.0, 2u, vec4<f32>(1.0, 2.0, 3.0, 4.0));
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
struct FragmentOutputs {
|
||||
[[location(0)]]
|
||||
@location(0)
|
||||
loc0 : i32;
|
||||
[[builtin(frag_depth)]]
|
||||
@builtin(frag_depth)
|
||||
frag_depth : f32;
|
||||
[[location(1)]]
|
||||
@location(1)
|
||||
loc1 : u32;
|
||||
[[location(2)]]
|
||||
@location(2)
|
||||
loc2 : f32;
|
||||
[[builtin(sample_mask)]]
|
||||
@builtin(sample_mask)
|
||||
sample_mask : u32;
|
||||
[[location(3)]]
|
||||
@location(3)
|
||||
loc3 : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main() -> FragmentOutputs {
|
||||
return FragmentOutputs(1, 2.0, 1u, 1.0, 2u, vec4<f32>(1.0, 2.0, 3.0, 4.0));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(
|
||||
[[location(0)]] none : f32,
|
||||
[[location(1), interpolate(flat)]] flat : f32,
|
||||
[[location(2), interpolate(perspective, center)]] perspective_center : f32,
|
||||
[[location(3), interpolate(perspective, centroid)]] perspective_centroid : f32,
|
||||
[[location(4), interpolate(perspective, sample)]] perspective_sample : f32,
|
||||
[[location(5), interpolate(linear, center)]] linear_center : f32,
|
||||
[[location(6), interpolate(linear, centroid)]] linear_centroid : f32,
|
||||
[[location(7), interpolate(linear, sample)]] linear_sample : f32) {
|
||||
@location(0) none : f32,
|
||||
@location(1) @interpolate(flat) flat : f32,
|
||||
@location(2) @interpolate(perspective, center) perspective_center : f32,
|
||||
@location(3) @interpolate(perspective, centroid) perspective_centroid : f32,
|
||||
@location(4) @interpolate(perspective, sample) perspective_sample : f32,
|
||||
@location(5) @interpolate(linear, center) linear_center : f32,
|
||||
@location(6) @interpolate(linear, centroid) linear_centroid : f32,
|
||||
@location(7) @interpolate(linear, sample) linear_sample : f32) {
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[[stage(fragment)]]
|
||||
fn main([[location(0)]] none : f32, [[location(1), interpolate(flat)]] flat : f32, [[location(2), interpolate(perspective, center)]] perspective_center : f32, [[location(3), interpolate(perspective, centroid)]] perspective_centroid : f32, [[location(4), interpolate(perspective, sample)]] perspective_sample : f32, [[location(5), interpolate(linear, center)]] linear_center : f32, [[location(6), interpolate(linear, centroid)]] linear_centroid : f32, [[location(7), interpolate(linear, sample)]] linear_sample : f32) {
|
||||
@stage(fragment)
|
||||
fn main(@location(0) none : f32, @location(1) @interpolate(flat) flat : f32, @location(2) @interpolate(perspective, center) perspective_center : f32, @location(3) @interpolate(perspective, centroid) perspective_centroid : f32, @location(4) @interpolate(perspective, sample) perspective_sample : f32, @location(5) @interpolate(linear, center) linear_center : f32, @location(6) @interpolate(linear, centroid) linear_centroid : f32, @location(7) @interpolate(linear, sample) linear_sample : f32) {
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
struct In {
|
||||
[[location(0)]] none : f32;
|
||||
[[location(1), interpolate(flat)]] flat : f32;
|
||||
[[location(2), interpolate(perspective, center)]] perspective_center : f32;
|
||||
[[location(3), interpolate(perspective, centroid)]] perspective_centroid : f32;
|
||||
[[location(4), interpolate(perspective, sample)]] perspective_sample : f32;
|
||||
[[location(5), interpolate(linear, center)]] linear_center : f32;
|
||||
[[location(6), interpolate(linear, centroid)]] linear_centroid : f32;
|
||||
[[location(7), interpolate(linear, sample)]] linear_sample : f32;
|
||||
@location(0) none : f32;
|
||||
@location(1) @interpolate(flat) flat : f32;
|
||||
@location(2) @interpolate(perspective, center) perspective_center : f32;
|
||||
@location(3) @interpolate(perspective, centroid) perspective_centroid : f32;
|
||||
@location(4) @interpolate(perspective, sample) perspective_sample : f32;
|
||||
@location(5) @interpolate(linear, center) linear_center : f32;
|
||||
@location(6) @interpolate(linear, centroid) linear_centroid : f32;
|
||||
@location(7) @interpolate(linear, sample) linear_sample : f32;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(in : In) {
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
struct In {
|
||||
[[location(0)]]
|
||||
@location(0)
|
||||
none : f32;
|
||||
[[location(1), interpolate(flat)]]
|
||||
@location(1) @interpolate(flat)
|
||||
flat : f32;
|
||||
[[location(2), interpolate(perspective, center)]]
|
||||
@location(2) @interpolate(perspective, center)
|
||||
perspective_center : f32;
|
||||
[[location(3), interpolate(perspective, centroid)]]
|
||||
@location(3) @interpolate(perspective, centroid)
|
||||
perspective_centroid : f32;
|
||||
[[location(4), interpolate(perspective, sample)]]
|
||||
@location(4) @interpolate(perspective, sample)
|
||||
perspective_sample : f32;
|
||||
[[location(5), interpolate(linear, center)]]
|
||||
@location(5) @interpolate(linear, center)
|
||||
linear_center : f32;
|
||||
[[location(6), interpolate(linear, centroid)]]
|
||||
@location(6) @interpolate(linear, centroid)
|
||||
linear_centroid : f32;
|
||||
[[location(7), interpolate(linear, sample)]]
|
||||
@location(7) @interpolate(linear, sample)
|
||||
linear_sample : f32;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn main(in : In) {
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
struct Interface {
|
||||
[[location(0), interpolate(flat)]] i : i32;
|
||||
[[location(1), interpolate(flat)]] u : u32;
|
||||
[[location(2), interpolate(flat)]] vi : vec4<i32>;
|
||||
[[location(3), interpolate(flat)]] vu : vec4<u32>;
|
||||
[[builtin(position)]] pos : vec4<f32>;
|
||||
@location(0) @interpolate(flat) i : i32;
|
||||
@location(1) @interpolate(flat) u : u32;
|
||||
@location(2) @interpolate(flat) vi : vec4<i32>;
|
||||
@location(3) @interpolate(flat) vu : vec4<u32>;
|
||||
@builtin(position) pos : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn vert_main() -> Interface {
|
||||
return Interface();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn frag_main(inputs : Interface) -> [[location(0)]] i32 {
|
||||
@stage(fragment)
|
||||
fn frag_main(inputs : Interface) -> @location(0) i32 {
|
||||
return inputs.i;
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
struct Interface {
|
||||
[[location(0), interpolate(flat)]]
|
||||
@location(0) @interpolate(flat)
|
||||
i : i32;
|
||||
[[location(1), interpolate(flat)]]
|
||||
@location(1) @interpolate(flat)
|
||||
u : u32;
|
||||
[[location(2), interpolate(flat)]]
|
||||
@location(2) @interpolate(flat)
|
||||
vi : vec4<i32>;
|
||||
[[location(3), interpolate(flat)]]
|
||||
@location(3) @interpolate(flat)
|
||||
vu : vec4<u32>;
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
pos : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn vert_main() -> Interface {
|
||||
return Interface();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn frag_main(inputs : Interface) -> [[location(0)]] i32 {
|
||||
@stage(fragment)
|
||||
fn frag_main(inputs : Interface) -> @location(0) i32 {
|
||||
return inputs.i;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
struct Out {
|
||||
[[builtin(position)]] pos : vec4<f32>;
|
||||
[[location(0)]] none : f32;
|
||||
[[location(1), interpolate(flat)]] flat : f32;
|
||||
[[location(2), interpolate(perspective, center)]] perspective_center : f32;
|
||||
[[location(3), interpolate(perspective, centroid)]] perspective_centroid : f32;
|
||||
[[location(4), interpolate(perspective, sample)]] perspective_sample : f32;
|
||||
[[location(5), interpolate(linear, center)]] linear_center : f32;
|
||||
[[location(6), interpolate(linear, centroid)]] linear_centroid : f32;
|
||||
[[location(7), interpolate(linear, sample)]] linear_sample : f32;
|
||||
@builtin(position) pos : vec4<f32>;
|
||||
@location(0) none : f32;
|
||||
@location(1) @interpolate(flat) flat : f32;
|
||||
@location(2) @interpolate(perspective, center) perspective_center : f32;
|
||||
@location(3) @interpolate(perspective, centroid) perspective_centroid : f32;
|
||||
@location(4) @interpolate(perspective, sample) perspective_sample : f32;
|
||||
@location(5) @interpolate(linear, center) linear_center : f32;
|
||||
@location(6) @interpolate(linear, centroid) linear_centroid : f32;
|
||||
@location(7) @interpolate(linear, sample) linear_sample : f32;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main() -> Out {
|
||||
return Out();
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
struct Out {
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
pos : vec4<f32>;
|
||||
[[location(0)]]
|
||||
@location(0)
|
||||
none : f32;
|
||||
[[location(1), interpolate(flat)]]
|
||||
@location(1) @interpolate(flat)
|
||||
flat : f32;
|
||||
[[location(2), interpolate(perspective, center)]]
|
||||
@location(2) @interpolate(perspective, center)
|
||||
perspective_center : f32;
|
||||
[[location(3), interpolate(perspective, centroid)]]
|
||||
@location(3) @interpolate(perspective, centroid)
|
||||
perspective_centroid : f32;
|
||||
[[location(4), interpolate(perspective, sample)]]
|
||||
@location(4) @interpolate(perspective, sample)
|
||||
perspective_sample : f32;
|
||||
[[location(5), interpolate(linear, center)]]
|
||||
@location(5) @interpolate(linear, center)
|
||||
linear_center : f32;
|
||||
[[location(6), interpolate(linear, centroid)]]
|
||||
@location(6) @interpolate(linear, centroid)
|
||||
linear_centroid : f32;
|
||||
[[location(7), interpolate(linear, sample)]]
|
||||
@location(7) @interpolate(linear, sample)
|
||||
linear_sample : f32;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main() -> Out {
|
||||
return Out();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[[stage(vertex)]]
|
||||
fn main() -> [[builtin(position), invariant]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main() -> @builtin(position) @invariant vec4<f32> {
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[[stage(vertex)]]
|
||||
fn main() -> [[builtin(position), invariant]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main() -> @builtin(position) @invariant vec4<f32> {
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
struct Out {
|
||||
[[builtin(position), invariant]] pos : vec4<f32>;
|
||||
@builtin(position) @invariant pos : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main() -> Out {
|
||||
return Out();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
struct Out {
|
||||
[[builtin(position), invariant]]
|
||||
@builtin(position) @invariant
|
||||
pos : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main() -> Out {
|
||||
return Out();
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
struct Interface {
|
||||
[[location(1)]] col1 : f32;
|
||||
[[location(2)]] col2 : f32;
|
||||
[[builtin(position)]] pos : vec4<f32>;
|
||||
@location(1) col1 : f32;
|
||||
@location(2) col2 : f32;
|
||||
@builtin(position) pos : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn vert_main() -> Interface {
|
||||
return Interface(0.4, 0.6, vec4<f32>());
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn frag_main(colors : Interface) {
|
||||
let r : f32 = colors.col1;
|
||||
let g : f32 = colors.col2;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
struct Interface {
|
||||
[[location(1)]]
|
||||
@location(1)
|
||||
col1 : f32;
|
||||
[[location(2)]]
|
||||
@location(2)
|
||||
col2 : f32;
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
pos : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn vert_main() -> Interface {
|
||||
return Interface(0.400000006, 0.600000024, vec4<f32>());
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn frag_main(colors : Interface) {
|
||||
let r : f32 = colors.col1;
|
||||
let g : f32 = colors.col2;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
struct VertexOutput {
|
||||
[[builtin(position)]] pos : vec4<f32>;
|
||||
[[location(0), interpolate(flat)]] loc0 : i32;
|
||||
@builtin(position) pos : vec4<f32>;
|
||||
@location(0) @interpolate(flat) loc0 : i32;
|
||||
};
|
||||
|
||||
fn foo(x : f32) -> VertexOutput {
|
||||
return VertexOutput(vec4<f32>(x, x, x, 1.0), 42);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn vert_main1() -> VertexOutput {
|
||||
return foo(0.5);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn vert_main2() -> VertexOutput {
|
||||
return foo(0.25);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
struct VertexOutput {
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
pos : vec4<f32>;
|
||||
[[location(0), interpolate(flat)]]
|
||||
@location(0) @interpolate(flat)
|
||||
loc0 : i32;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ fn foo(x : f32) -> VertexOutput {
|
||||
return VertexOutput(vec4<f32>(x, x, x, 1.0), 42);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn vert_main1() -> VertexOutput {
|
||||
return foo(0.5);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn vert_main2() -> VertexOutput {
|
||||
return foo(0.25);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
struct S {
|
||||
[[align(64)]] [[location(0)]] f : f32;
|
||||
[[size(32)]] [[location(1), interpolate(flat)]] u : u32;
|
||||
[[align(128)]] [[builtin(position)]] v : vec4<f32>;
|
||||
@align(64) @location(0) f : f32;
|
||||
@size(32) @location(1) @interpolate(flat) u : u32;
|
||||
@align(128) @builtin(position) v : vec4<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]]
|
||||
@group(0) @binding(0)
|
||||
var<storage, write> output : S;
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn frag_main(input : S) {
|
||||
let f : f32 = input.f;
|
||||
let u : u32 = input.u;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
struct S {
|
||||
[[align(64), location(0)]]
|
||||
@align(64) @location(0)
|
||||
f : f32;
|
||||
[[size(32), location(1), interpolate(flat)]]
|
||||
@size(32) @location(1) @interpolate(flat)
|
||||
u : u32;
|
||||
[[align(128), builtin(position)]]
|
||||
@align(128) @builtin(position)
|
||||
v : vec4<f32>;
|
||||
}
|
||||
|
||||
[[group(0), binding(0)]] var<storage, write> output : S;
|
||||
@group(0) @binding(0) var<storage, write> output : S;
|
||||
|
||||
[[stage(fragment)]]
|
||||
@stage(fragment)
|
||||
fn frag_main(input : S) {
|
||||
let f : f32 = input.f;
|
||||
let u : u32 = input.u;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main(
|
||||
[[builtin(vertex_index)]] vertex_index : u32,
|
||||
[[builtin(instance_index)]] instance_index : u32,
|
||||
) -> [[builtin(position)]] vec4<f32> {
|
||||
@builtin(vertex_index) vertex_index : u32,
|
||||
@builtin(instance_index) instance_index : u32,
|
||||
) -> @builtin(position) vec4<f32> {
|
||||
let foo : u32 = vertex_index + instance_index;
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[stage(vertex)]]
|
||||
fn main([[builtin(vertex_index)]] vertex_index : u32, [[builtin(instance_index)]] instance_index : u32) -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main(@builtin(vertex_index) vertex_index : u32, @builtin(instance_index) instance_index : u32) -> @builtin(position) vec4<f32> {
|
||||
let foo : u32 = (vertex_index + instance_index);
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
struct VertexInputs {
|
||||
[[builtin(vertex_index)]] vertex_index : u32;
|
||||
[[builtin(instance_index)]] instance_index : u32;
|
||||
@builtin(vertex_index) vertex_index : u32;
|
||||
@builtin(instance_index) instance_index : u32;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn main(inputs : VertexInputs) -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main(inputs : VertexInputs) -> @builtin(position) vec4<f32> {
|
||||
let foo : u32 = inputs.vertex_index + inputs.instance_index;
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
struct VertexInputs {
|
||||
[[builtin(vertex_index)]]
|
||||
@builtin(vertex_index)
|
||||
vertex_index : u32;
|
||||
[[builtin(instance_index)]]
|
||||
@builtin(instance_index)
|
||||
instance_index : u32;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn main(inputs : VertexInputs) -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main(inputs : VertexInputs) -> @builtin(position) vec4<f32> {
|
||||
let foo : u32 = (inputs.vertex_index + inputs.instance_index);
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main(
|
||||
[[location(0)]] loc0 : i32,
|
||||
[[location(1)]] loc1 : u32,
|
||||
[[location(2)]] loc2 : f32,
|
||||
[[location(3)]] loc3 : vec4<f32>,
|
||||
) -> [[builtin(position)]] vec4<f32> {
|
||||
@location(0) loc0 : i32,
|
||||
@location(1) loc1 : u32,
|
||||
@location(2) loc2 : f32,
|
||||
@location(3) loc3 : vec4<f32>,
|
||||
) -> @builtin(position) vec4<f32> {
|
||||
let i : i32 = loc0;
|
||||
let u : u32 = loc1;
|
||||
let f : f32 = loc2;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[[stage(vertex)]]
|
||||
fn main([[location(0)]] loc0 : i32, [[location(1)]] loc1 : u32, [[location(2)]] loc2 : f32, [[location(3)]] loc3 : vec4<f32>) -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main(@location(0) loc0 : i32, @location(1) loc1 : u32, @location(2) loc2 : f32, @location(3) loc3 : vec4<f32>) -> @builtin(position) vec4<f32> {
|
||||
let i : i32 = loc0;
|
||||
let u : u32 = loc1;
|
||||
let f : f32 = loc2;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
struct VertexInputs {
|
||||
[[location(0)]] loc0 : i32;
|
||||
[[location(1)]] loc1 : u32;
|
||||
[[location(2)]] loc2 : f32;
|
||||
[[location(3)]] loc3 : vec4<f32>;
|
||||
@location(0) loc0 : i32;
|
||||
@location(1) loc1 : u32;
|
||||
@location(2) loc2 : f32;
|
||||
@location(3) loc3 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn main(inputs : VertexInputs) -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main(inputs : VertexInputs) -> @builtin(position) vec4<f32> {
|
||||
let i : i32 = inputs.loc0;
|
||||
let u : u32 = inputs.loc1;
|
||||
let f : f32 = inputs.loc2;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
struct VertexInputs {
|
||||
[[location(0)]]
|
||||
@location(0)
|
||||
loc0 : i32;
|
||||
[[location(1)]]
|
||||
@location(1)
|
||||
loc1 : u32;
|
||||
[[location(2)]]
|
||||
@location(2)
|
||||
loc2 : f32;
|
||||
[[location(3)]]
|
||||
@location(3)
|
||||
loc3 : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn main(inputs : VertexInputs) -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main(inputs : VertexInputs) -> @builtin(position) vec4<f32> {
|
||||
let i : i32 = inputs.loc0;
|
||||
let u : u32 = inputs.loc1;
|
||||
let f : f32 = inputs.loc2;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
struct VertexInputs0 {
|
||||
[[builtin(vertex_index)]] vertex_index : u32;
|
||||
[[location(0)]] loc0 : i32;
|
||||
@builtin(vertex_index) vertex_index : u32;
|
||||
@location(0) loc0 : i32;
|
||||
};
|
||||
struct VertexInputs1 {
|
||||
[[location(2)]] loc2 : f32;
|
||||
[[location(3)]] loc3 : vec4<f32>;
|
||||
@location(2) loc2 : f32;
|
||||
@location(3) loc3 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main(
|
||||
inputs0 : VertexInputs0,
|
||||
[[location(1)]] loc1 : u32,
|
||||
[[builtin(instance_index)]] instance_index : u32,
|
||||
@location(1) loc1 : u32,
|
||||
@builtin(instance_index) instance_index : u32,
|
||||
inputs1 : VertexInputs1,
|
||||
) -> [[builtin(position)]] vec4<f32> {
|
||||
) -> @builtin(position) vec4<f32> {
|
||||
let foo : u32 = inputs0.vertex_index + instance_index;
|
||||
let i : i32 = inputs0.loc0;
|
||||
let u : u32 = loc1;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
struct VertexInputs0 {
|
||||
[[builtin(vertex_index)]]
|
||||
@builtin(vertex_index)
|
||||
vertex_index : u32;
|
||||
[[location(0)]]
|
||||
@location(0)
|
||||
loc0 : i32;
|
||||
}
|
||||
|
||||
struct VertexInputs1 {
|
||||
[[location(2)]]
|
||||
@location(2)
|
||||
loc2 : f32;
|
||||
[[location(3)]]
|
||||
@location(3)
|
||||
loc3 : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn main(inputs0 : VertexInputs0, [[location(1)]] loc1 : u32, [[builtin(instance_index)]] instance_index : u32, inputs1 : VertexInputs1) -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main(inputs0 : VertexInputs0, @location(1) loc1 : u32, @builtin(instance_index) instance_index : u32, inputs1 : VertexInputs1) -> @builtin(position) vec4<f32> {
|
||||
let foo : u32 = (inputs0.vertex_index + instance_index);
|
||||
let i : i32 = inputs0.loc0;
|
||||
let u : u32 = loc1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[[stage(vertex)]]
|
||||
fn main() -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main() -> @builtin(position) vec4<f32> {
|
||||
return vec4<f32>(1.0, 2.0, 3.0, 4.0);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[[stage(vertex)]]
|
||||
fn main() -> [[builtin(position)]] vec4<f32> {
|
||||
@stage(vertex)
|
||||
fn main() -> @builtin(position) vec4<f32> {
|
||||
return vec4<f32>(1.0, 2.0, 3.0, 4.0);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
struct VertexOutputs {
|
||||
[[builtin(position)]] position : vec4<f32>;
|
||||
@builtin(position) position : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main() -> VertexOutputs {
|
||||
return VertexOutputs(vec4<f32>(1.0, 2.0, 3.0, 4.0));
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
struct VertexOutputs {
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
position : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main() -> VertexOutputs {
|
||||
return VertexOutputs(vec4<f32>(1.0, 2.0, 3.0, 4.0));
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
struct VertexOutputs {
|
||||
[[location(0), interpolate(flat)]] loc0 : i32;
|
||||
[[location(1), interpolate(flat)]] loc1 : u32;
|
||||
[[location(2)]] loc2 : f32;
|
||||
[[location(3)]] loc3 : vec4<f32>;
|
||||
[[builtin(position)]] position : vec4<f32>;
|
||||
@location(0) @interpolate(flat) loc0 : i32;
|
||||
@location(1) @interpolate(flat) loc1 : u32;
|
||||
@location(2) loc2 : f32;
|
||||
@location(3) loc3 : vec4<f32>;
|
||||
@builtin(position) position : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main() -> VertexOutputs {
|
||||
return VertexOutputs(1, 1u, 1.0, vec4<f32>(1.0, 2.0, 3.0, 4.0), vec4<f32>());
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
struct VertexOutputs {
|
||||
[[location(0), interpolate(flat)]]
|
||||
@location(0) @interpolate(flat)
|
||||
loc0 : i32;
|
||||
[[location(1), interpolate(flat)]]
|
||||
@location(1) @interpolate(flat)
|
||||
loc1 : u32;
|
||||
[[location(2)]]
|
||||
@location(2)
|
||||
loc2 : f32;
|
||||
[[location(3)]]
|
||||
@location(3)
|
||||
loc3 : vec4<f32>;
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
position : vec4<f32>;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
@stage(vertex)
|
||||
fn main() -> VertexOutputs {
|
||||
return VertexOutputs(1, 1u, 1.0, vec4<f32>(1.0, 2.0, 3.0, 4.0), vec4<f32>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user