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:
Ben Clayton
2022-01-19 22:46:57 +00:00
committed by Tint LUCI CQ
parent 8f1d5224ee
commit 01e4b6fc18
3200 changed files with 15906 additions and 15215 deletions

View File

@@ -4,7 +4,7 @@ struct PointLight {
};
struct PointLights {
values : [[stride(16)]] array<PointLight>;
values : @stride(16) array<PointLight>;
};
struct Uniforms {
@@ -15,21 +15,21 @@ struct PointLight {
color : vec4<f32>;
};
[[binding(0), group(0)]] var<uniform> uniforms : Uniforms;
[[binding(1), group(0)]] var<storage_buffer, read> pointLights : PointLights;
[[binding(2), group(0)]] var mySampler: sampler;
[[binding(3), group(0)]] var myTexture: texture_2d<f32>;
@binding(0) @group(0) var<uniform> uniforms : Uniforms;
@binding(1) @group(0) var<storage_buffer, read> pointLights : PointLights;
@binding(2) @group(0) var mySampler: sampler;
@binding(3) @group(0) var myTexture: texture_2d<f32>;
struct FragmentInput {
[[builtin(position)]] position : vec4<f32>;
[[location(0)]] view_position : vec4<f32>;
[[location(1)]] normal : vec4<f32>;
[[location(2)]] uv : vec2<f32>;
[[location(3)]] color : vec4<f32>;
@builtin(position) position : vec4<f32>;
@location(0) view_position : vec4<f32>;
@location(1) normal : vec4<f32>;
@location(2) uv : vec2<f32>;
@location(3) color : vec4<f32>;
};
struct FragmentOutput {
[[location(0)]] color : vec4<f32>;
@location(0) color : vec4<f32>;
};
fn getColor(fragment : FragmentInput) -> vec4<f32>{
@@ -63,7 +63,7 @@ fn getColor(fragment : FragmentInput) -> vec4<f32>{
return color;
};
[[stage(fragment)]]
@stage(fragment)
fn main(fragment : FragmentInput) -> FragmentOutput {
var output : FragmentOutput;

View File

@@ -3,7 +3,7 @@ struct PointLight {
}
struct PointLights {
values : [[stride(16)]] array<PointLight>;
values : @stride(16) array<PointLight>;
}
struct Uniforms {
@@ -14,29 +14,29 @@ struct Uniforms {
color : vec4<f32>;
}
[[binding(0), group(0)]] var<uniform> uniforms : Uniforms;
@binding(0) @group(0) var<uniform> uniforms : Uniforms;
[[binding(1), group(0)]] var<storage, read> pointLights : PointLights;
@binding(1) @group(0) var<storage, read> pointLights : PointLights;
[[binding(2), group(0)]] var mySampler : sampler;
@binding(2) @group(0) var mySampler : sampler;
[[binding(3), group(0)]] var myTexture : texture_2d<f32>;
@binding(3) @group(0) var myTexture : texture_2d<f32>;
struct FragmentInput {
[[builtin(position)]]
@builtin(position)
position : vec4<f32>;
[[location(0)]]
@location(0)
view_position : vec4<f32>;
[[location(1)]]
@location(1)
normal : vec4<f32>;
[[location(2)]]
@location(2)
uv : vec2<f32>;
[[location(3)]]
@location(3)
color : vec4<f32>;
}
struct FragmentOutput {
[[location(0)]]
@location(0)
color : vec4<f32>;
}
@@ -55,7 +55,7 @@ fn getColor(fragment : FragmentInput) -> vec4<f32> {
return color;
}
[[stage(fragment)]]
@stage(fragment)
fn main(fragment : FragmentInput) -> FragmentOutput {
var output : FragmentOutput;
output.color = vec4<f32>(1.0, 0.0, 0.0, 1.0);

View File

@@ -1,4 +1,4 @@
[[stage(fragment)]]
@stage(fragment)
fn main() {
loop {
if (false) {

View File

@@ -1,4 +1,4 @@
[[stage(fragment)]]
@stage(fragment)
fn main() {
loop {
if (false) {

View File

@@ -1,10 +1,10 @@
struct FragIn {
[[location(0)]] a : f32;
[[builtin(sample_mask)]] mask : u32;
@location(0) a : f32;
@builtin(sample_mask) mask : u32;
};
[[stage(fragment)]]
fn main(in : FragIn, [[location(1)]] b : f32) -> FragIn {
@stage(fragment)
fn main(in : FragIn, @location(1) b : f32) -> FragIn {
if (in.mask == 0u) {
return in;
}

View File

@@ -1,12 +1,12 @@
struct FragIn {
[[location(0)]]
@location(0)
a : f32;
[[builtin(sample_mask)]]
@builtin(sample_mask)
mask : u32;
}
[[stage(fragment)]]
fn main(in : FragIn, [[location(1)]] b : f32) -> FragIn {
@stage(fragment)
fn main(in : FragIn, @location(1) b : f32) -> FragIn {
if ((in.mask == 0u)) {
return in;
}

View File

@@ -5,8 +5,8 @@ fn f(x : i32) -> i32 {
return x;
}
[[stage(fragment)]]
fn main([[location(1)]] x: vec3<i32>) -> [[location(2)]] i32 {
@stage(fragment)
fn main(@location(1) x: vec3<i32>) -> @location(2) i32 {
var y = x.x;
loop {
let r = f(y);

View File

@@ -1,7 +1,7 @@
SKIP: FAILED
bug/tint/1081.wgsl:9:25 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main([[location(1)]] x: vec3<i32>) -> [[location(2)]] i32 {
fn main(@location(1) x: vec3<i32>) -> @location(2) i32 {
^
#version 310 es
@@ -51,7 +51,7 @@ void main() {
Error parsing GLSL shader:
ERROR: 0:35: 'int' : must be qualified as flat in
ERROR: 0:35: '' : compilation terminated
ERROR: 0:35: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

View File

@@ -1,6 +1,6 @@
bug/tint/1081.wgsl:9:25 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main([[location(1)]] x: vec3<i32>) -> [[location(2)]] i32 {
^
bug/tint/1081.wgsl:9:22 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main(@location(1) x: vec3<i32>) -> @location(2) i32 {
^
int f(int x) {
if (true) {

View File

@@ -1,6 +1,6 @@
bug/tint/1081.wgsl:9:25 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main([[location(1)]] x: vec3<i32>) -> [[location(2)]] i32 {
^
bug/tint/1081.wgsl:9:22 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main(@location(1) x: vec3<i32>) -> @location(2) i32 {
^
#include <metal_stdlib>

View File

@@ -1,6 +1,6 @@
bug/tint/1081.wgsl:9:25 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main([[location(1)]] x: vec3<i32>) -> [[location(2)]] i32 {
^
bug/tint/1081.wgsl:9:22 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main(@location(1) x: vec3<i32>) -> @location(2) i32 {
^
; SPIR-V
; Version: 1.3

View File

@@ -1,6 +1,6 @@
bug/tint/1081.wgsl:9:25 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main([[location(1)]] x: vec3<i32>) -> [[location(2)]] i32 {
^
bug/tint/1081.wgsl:9:22 warning: integral user-defined fragment inputs must have a flat interpolation attribute
fn main(@location(1) x: vec3<i32>) -> @location(2) i32 {
^
fn f(x : i32) -> i32 {
if ((x == 10)) {
@@ -9,8 +9,8 @@ fn f(x : i32) -> i32 {
return x;
}
[[stage(fragment)]]
fn main([[location(1)]] x : vec3<i32>) -> [[location(2)]] i32 {
@stage(fragment)
fn main(@location(1) x : vec3<i32>) -> @location(2) i32 {
var y = x.x;
loop {
let r = f(y);

View File

@@ -1,4 +1,4 @@
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn f() {
let a = 1;
let b = 0;

View File

@@ -1,4 +1,4 @@
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn f() {
let a = 1;
let b = 0;

View File

@@ -8,7 +8,7 @@ fn g() {
x(&v);
}
[[stage(fragment)]]
@stage(fragment)
fn f() {
g();
}

View File

@@ -8,7 +8,7 @@ fn g() {
x(&(v));
}
[[stage(fragment)]]
@stage(fragment)
fn f() {
g();
}

View File

@@ -1,11 +1,11 @@
type Arr = [[stride(64)]] array<mat4x4<f32>, 2u>;
type Arr = @stride(64) array<mat4x4<f32>, 2u>;
type Arr_1 = [[stride(16)]] array<f32, 4u>;
type Arr_1 = @stride(16) array<f32, 4u>;
struct LeftOver {
worldViewProjection : mat4x4<f32>;
time : f32;
[[size(12)]]
@size(12)
padding : u32;
test2 : Arr;
test : Arr_1;
@@ -13,7 +13,7 @@ struct LeftOver {
var<private> position : vec3<f32>;
[[group(2), binding(2)]] var<uniform> x_14 : LeftOver;
@group(2) @binding(2) var<uniform> x_14 : LeftOver;
var<private> vUV : vec2<f32>;
@@ -49,14 +49,14 @@ fn main_1() {
}
struct main_out {
[[builtin(position)]]
@builtin(position)
gl_Position : vec4<f32>;
[[location(0)]]
@location(0)
vUV_1 : vec2<f32>;
}
[[stage(vertex)]]
fn main([[location(0)]] position_param : vec3<f32>, [[location(2)]] uv_param : vec2<f32>, [[location(1)]] normal_param : vec3<f32>) -> main_out {
@stage(vertex)
fn main(@location(0) position_param : vec3<f32>, @location(2) uv_param : vec2<f32>, @location(1) normal_param : vec3<f32>) -> main_out {
position = position_param;
uv = uv_param;
normal = normal_param;

View File

@@ -23,23 +23,23 @@
value_f32_3 : f32;
};
struct F32s { values : [[stride(4)]] array<f32>; };
struct U32s { values : [[stride(4)]] array<u32>; };
struct I32s { values : [[stride(4)]] array<i32>; };
struct AU32s { values : [[stride(4)]] array<atomic<u32>>; };
struct AI32s { values : [[stride(4)]] array<atomic<i32>>; };
struct F32s { values : @stride(4) array<f32>; };
struct U32s { values : @stride(4) array<u32>; };
struct I32s { values : @stride(4) array<i32>; };
struct AU32s { values : @stride(4) array<atomic<u32>>; };
struct AI32s { values : @stride(4) array<atomic<i32>>; };
// IN
[[binding(0), group(0)]] var<uniform> uniforms : Uniforms;
[[binding(10), group(0)]] var<storage, read_write> indices : U32s;
[[binding(11), group(0)]] var<storage, read_write> positions : F32s;
@binding(0) @group(0) var<uniform> uniforms : Uniforms;
@binding(10) @group(0) var<storage, read_write> indices : U32s;
@binding(11) @group(0) var<storage, read_write> positions : F32s;
// OUT
[[binding(20), group(0)]] var<storage, read_write> counters : AU32s;
[[binding(21), group(0)]] var<storage, read_write> LUT : AI32s;
@binding(20) @group(0) var<storage, read_write> counters : AU32s;
@binding(21) @group(0) var<storage, read_write> LUT : AI32s;
// DEBUG
[[binding(50), group(0)]] var<storage, read_write> dbg : Dbg;
@binding(50) @group(0) var<storage, read_write> dbg : Dbg;
fn toVoxelPos(position : vec3<f32>) -> vec3<f32>{
@@ -95,8 +95,8 @@ fn doIgnore(){
}
[[stage(compute), workgroup_size(128)]]
fn main_count([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(128)
fn main_count(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var triangleIndex = GlobalInvocationID.x;
@@ -132,8 +132,8 @@ fn main_count([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>)
}
[[stage(compute), workgroup_size(128)]]
fn main_create_lut([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(128)
fn main_create_lut(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var voxelIndex = GlobalInvocationID.x;
@@ -155,8 +155,8 @@ fn main_create_lut([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u
}
[[stage(compute), workgroup_size(128)]]
fn main_sort_triangles([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(128)
fn main_sort_triangles(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var triangleIndex = GlobalInvocationID.x;

View File

@@ -23,36 +23,36 @@ struct Dbg {
}
struct F32s {
values : [[stride(4)]] array<f32>;
values : @stride(4) array<f32>;
}
struct U32s {
values : [[stride(4)]] array<u32>;
values : @stride(4) array<u32>;
}
struct I32s {
values : [[stride(4)]] array<i32>;
values : @stride(4) array<i32>;
}
struct AU32s {
values : [[stride(4)]] array<atomic<u32>>;
values : @stride(4) array<atomic<u32>>;
}
struct AI32s {
values : [[stride(4)]] array<atomic<i32>>;
values : @stride(4) array<atomic<i32>>;
}
[[binding(0), group(0)]] var<uniform> uniforms : Uniforms;
@binding(0) @group(0) var<uniform> uniforms : Uniforms;
[[binding(10), group(0)]] var<storage, read_write> indices : U32s;
@binding(10) @group(0) var<storage, read_write> indices : U32s;
[[binding(11), group(0)]] var<storage, read_write> positions : F32s;
@binding(11) @group(0) var<storage, read_write> positions : F32s;
[[binding(20), group(0)]] var<storage, read_write> counters : AU32s;
@binding(20) @group(0) var<storage, read_write> counters : AU32s;
[[binding(21), group(0)]] var<storage, read_write> LUT : AI32s;
@binding(21) @group(0) var<storage, read_write> LUT : AI32s;
[[binding(50), group(0)]] var<storage, read_write> dbg : Dbg;
@binding(50) @group(0) var<storage, read_write> dbg : Dbg;
fn toVoxelPos(position : vec3<f32>) -> vec3<f32> {
var bbMin = vec3<f32>(uniforms.bbMin.x, uniforms.bbMin.y, uniforms.bbMin.z);
@@ -92,8 +92,8 @@ fn doIgnore() {
var g55 = atomicLoad(&(LUT.values[0]));
}
[[stage(compute), workgroup_size(128)]]
fn main_count([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(128)
fn main_count(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var triangleIndex = GlobalInvocationID.x;
if ((triangleIndex >= uniforms.numTriangles)) {
return;
@@ -117,8 +117,8 @@ fn main_count([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>)
}
}
[[stage(compute), workgroup_size(128)]]
fn main_create_lut([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(128)
fn main_create_lut(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var voxelIndex = GlobalInvocationID.x;
doIgnore();
var maxVoxels = ((uniforms.gridSize * uniforms.gridSize) * uniforms.gridSize);
@@ -133,8 +133,8 @@ fn main_create_lut([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u
atomicStore(&(LUT.values[voxelIndex]), offset);
}
[[stage(compute), workgroup_size(128)]]
fn main_sort_triangles([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(128)
fn main_sort_triangles(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var triangleIndex = GlobalInvocationID.x;
doIgnore();
if ((triangleIndex >= uniforms.numTriangles)) {

View File

@@ -15,7 +15,7 @@ struct LightData {
struct LightsBuffer {
lights: array<LightData>;
};
[[group(0), binding(0)]] var<storage, read_write> lightsBuffer: LightsBuffer;
@group(0) @binding(0) var<storage, read_write> lightsBuffer: LightsBuffer;
struct TileLightIdData {
count: atomic<u32>;
lightId: array<u32, 64>;
@@ -23,8 +23,8 @@ struct TileLightIdData {
struct Tiles {
data: array<TileLightIdData, 4>;
};
[[group(1), binding(0)]] var<storage, read_write> tileLightId: Tiles;
@group(1) @binding(0) var<storage, read_write> tileLightId: Tiles;
struct Config {
numLights : u32;
numTiles : u32;
@@ -33,7 +33,7 @@ struct TileLightIdData {
numTileLightSlot : u32;
tileSize : u32;
};
[[group(2), binding(0)]] var<uniform> config: Config;
@group(2) @binding(0) var<uniform> config: Config;
struct Uniforms {
min : vec4<f32>;
max : vec4<f32>;
@@ -43,16 +43,16 @@ struct TileLightIdData {
// Tile info
fullScreenSize : vec4<f32>; // width, height
};
[[group(3), binding(0)]] var<uniform> uniforms: Uniforms;
[[stage(compute), workgroup_size(64, 1, 1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@group(3) @binding(0) var<uniform> uniforms: Uniforms;
@stage(compute) @workgroup_size(64, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var index = GlobalInvocationID.x;
if (index >= config.numLights) {
return;
}
// Light position updating
lightsBuffer.lights[index].position.y = lightsBuffer.lights[index].position.y - 0.1 + 0.001 * (f32(index) - 64.0 * floor(f32(index) / 64.0));
if (lightsBuffer.lights[index].position.y < uniforms.min.y) {
lightsBuffer.lights[index].position.y = uniforms.max.y;
}

View File

@@ -8,7 +8,7 @@ struct LightsBuffer {
lights : array<LightData>;
}
[[group(0), binding(0)]] var<storage, read_write> lightsBuffer : LightsBuffer;
@group(0) @binding(0) var<storage, read_write> lightsBuffer : LightsBuffer;
struct TileLightIdData {
count : atomic<u32>;
@@ -19,7 +19,7 @@ struct Tiles {
data : array<TileLightIdData, 4>;
}
[[group(1), binding(0)]] var<storage, read_write> tileLightId : Tiles;
@group(1) @binding(0) var<storage, read_write> tileLightId : Tiles;
struct Config {
numLights : u32;
@@ -30,7 +30,7 @@ struct Config {
tileSize : u32;
}
[[group(2), binding(0)]] var<uniform> config : Config;
@group(2) @binding(0) var<uniform> config : Config;
struct Uniforms {
min : vec4<f32>;
@@ -40,10 +40,10 @@ struct Uniforms {
fullScreenSize : vec4<f32>;
}
[[group(3), binding(0)]] var<uniform> uniforms : Uniforms;
@group(3) @binding(0) var<uniform> uniforms : Uniforms;
[[stage(compute), workgroup_size(64, 1, 1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(64, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var index = GlobalInvocationID.x;
if ((index >= config.numLights)) {
return;

View File

@@ -1,3 +1,3 @@
struct Buffer { data: u32; };
[[group(0), binding(0)]] var<storage, read_write> buffer: Buffer;
@group(0) @binding(0) var<storage, read_write> buffer: Buffer;
fn main() { buffer.data = buffer.data + 1u; }

View File

@@ -2,7 +2,7 @@ struct Buffer {
data : u32;
}
[[group(0), binding(0)]] var<storage, read_write> buffer : Buffer;
@group(0) @binding(0) var<storage, read_write> buffer : Buffer;
fn main() {
buffer.data = (buffer.data + 1u);

View File

@@ -2,7 +2,7 @@ fn foo() -> i32 {
return 1;
}
[[stage(fragment)]]
@stage(fragment)
fn main() {
var arr = array<f32, 4>();
for (let a = &arr[foo()]; ;) {

View File

@@ -2,7 +2,7 @@ fn foo() -> i32 {
return 1;
}
[[stage(fragment)]]
@stage(fragment)
fn main() {
var arr = array<f32, 4>();
for(let a = &(arr[foo()]); ; ) {

View File

@@ -3,7 +3,7 @@ fn call_discard() -> bool {
return true;
}
[[stage(fragment)]]
@stage(fragment)
fn f() {
var v = call_discard();
var also_unreachable : bool;

View File

@@ -11,7 +11,7 @@ fn call_discard() -> bool {
return true;
}
[[stage(fragment)]]
@stage(fragment)
fn f() {
var v = call_discard();
var also_unreachable : bool;

View File

@@ -1,11 +1,11 @@
[[group(0), binding(1)]]
@group(0) @binding(1)
var<storage, read> data : array<i32>;
fn foo() -> i32 {
return data[0];
}
[[stage(compute), workgroup_size(16, 16, 1)]]
@stage(compute) @workgroup_size(16, 16, 1)
fn main() {
foo();
}

View File

@@ -1,10 +1,10 @@
[[group(0), binding(1)]] var<storage, read> data : array<i32>;
@group(0) @binding(1) var<storage, read> data : array<i32>;
fn foo() -> i32 {
return data[0];
}
[[stage(compute), workgroup_size(16, 16, 1)]]
@stage(compute) @workgroup_size(16, 16, 1)
fn main() {
foo();
}

View File

@@ -9,7 +9,7 @@ fn main_1() {
return;
}
[[stage(compute), workgroup_size(1, 1, 1)]]
@stage(compute) @workgroup_size(1, 1, 1)
fn main() {
main_1();
}

View File

@@ -5,9 +5,9 @@ struct Buf{
data : Arr;
};
[[group(0), binding (0)]] var<storage, read_write> b : Buf;
@group(0) @binding(0) var<storage, read_write> b : Buf;
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
var i : u32 = 0u;
loop {

View File

@@ -5,9 +5,9 @@ struct Buf {
data : Arr;
}
[[group(0), binding(0)]] var<storage, read_write> b : Buf;
@group(0) @binding(0) var<storage, read_write> b : Buf;
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
var i : u32 = 0u;
loop {

View File

@@ -1,5 +1,5 @@
[[stage(vertex)]]
fn main() -> [[builtin(position)]] vec4<f32> {
@stage(vertex)
fn main() -> @builtin(position) vec4<f32> {
var light : vec3<f32> = vec3<f32>(1.2, 1., 2.);
var negative_light : vec3<f32> = -light;
return vec4<f32>();

View File

@@ -1,5 +1,5 @@
[[stage(vertex)]]
fn main() -> [[builtin(position)]] vec4<f32> {
@stage(vertex)
fn main() -> @builtin(position) vec4<f32> {
var light : vec3<f32> = vec3<f32>(1.200000048, 1.0, 2.0);
var negative_light : vec3<f32> = -(light);
return vec4<f32>();

View File

@@ -3,6 +3,6 @@ struct Light {
colour : vec3<f32>;
};
struct Lights {
light : [[stride(32)]] array<Light>;
light : @stride(32) array<Light>;
};
[[group(0), binding(1)]] var<storage, read> lights : Lights;
@group(0) @binding(1) var<storage, read> lights : Lights;

View File

@@ -4,7 +4,7 @@ struct Light {
}
struct Lights {
light : [[stride(32)]] array<Light>;
light : @stride(32) array<Light>;
}
[[group(0), binding(1)]] var<storage, read> lights : Lights;
@group(0) @binding(1) var<storage, read> lights : Lights;

View File

@@ -2,5 +2,5 @@
m : mat2x2<f32>;
};
[[group(0), binding(0)]] var<storage> SSBO : S;
[[group(0), binding(0)]] var<uniform> UBO : S;
@group(0) @binding(0) var<storage> SSBO : S;
@group(0) @binding(0) var<uniform> UBO : S;

View File

@@ -2,6 +2,6 @@ struct S {
m : mat2x2<f32>;
}
[[group(0), binding(0)]] var<storage> SSBO : S;
@group(0) @binding(0) var<storage> SSBO : S;
[[group(0), binding(0)]] var<uniform> UBO : S;
@group(0) @binding(0) var<uniform> UBO : S;

View File

@@ -6,12 +6,12 @@ struct vertexUniformBuffer2 {
transform2 : mat2x2<f32>;
};
[[group(0), binding(0)]] var<uniform> x_20 : vertexUniformBuffer1;
[[group(1), binding(0)]] var<uniform> x_26 : vertexUniformBuffer2;
@group(0) @binding(0) var<uniform> x_20 : vertexUniformBuffer1;
@group(1) @binding(0) var<uniform> x_26 : vertexUniformBuffer2;
[[stage(vertex)]]
fn main([[builtin(vertex_index)]] gl_VertexIndex : u32) -> [[builtin(position)]] vec4<f32> {
@stage(vertex)
fn main(@builtin(vertex_index) gl_VertexIndex : u32) -> @builtin(position) vec4<f32> {
var indexable : array<vec2<f32>, 3>;
let x_23 : mat2x2<f32> = x_20.transform1;
let x_28 : mat2x2<f32> = x_26.transform2;

View File

@@ -6,12 +6,12 @@ struct vertexUniformBuffer2 {
transform2 : mat2x2<f32>;
}
[[group(0), binding(0)]] var<uniform> x_20 : vertexUniformBuffer1;
@group(0) @binding(0) var<uniform> x_20 : vertexUniformBuffer1;
[[group(1), binding(0)]] var<uniform> x_26 : vertexUniformBuffer2;
@group(1) @binding(0) var<uniform> x_26 : vertexUniformBuffer2;
[[stage(vertex)]]
fn main([[builtin(vertex_index)]] gl_VertexIndex : u32) -> [[builtin(position)]] vec4<f32> {
@stage(vertex)
fn main(@builtin(vertex_index) gl_VertexIndex : u32) -> @builtin(position) vec4<f32> {
var indexable : array<vec2<f32>, 3>;
let x_23 : mat2x2<f32> = x_20.transform1;
let x_28 : mat2x2<f32> = x_26.transform2;

View File

@@ -1,6 +1,6 @@
[[group(0), binding(0)]] var Src : texture_2d<u32>;
@group(0) @binding(0) var Src : texture_2d<u32>;
[[group(0), binding(1)]] var Dst : texture_storage_2d<r32uint, write>;
@group(0) @binding(1) var Dst : texture_storage_2d<r32uint, write>;
fn main_1() {
var srcValue : vec4<u32>;
@@ -13,7 +13,7 @@ fn main_1() {
return;
}
[[stage(compute), workgroup_size(1, 1, 1)]]
@stage(compute) @workgroup_size(1, 1, 1)
fn main() {
main_1();
}

View File

@@ -1,7 +1,7 @@
[[group(0), binding(0)]] var Src : texture_2d<u32>;
[[group(0), binding(1)]] var Dst : texture_storage_2d<r32uint, write>;
@group(0) @binding(0) var Src : texture_2d<u32>;
@group(0) @binding(1) var Dst : texture_storage_2d<r32uint, write>;
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
var srcValue : vec4<u32>;
let x_22 : vec4<u32> = textureLoad(Src, vec2<i32>(0, 0), 0);

View File

@@ -1,8 +1,8 @@
[[group(0), binding(0)]] var Src : texture_2d<u32>;
@group(0) @binding(0) var Src : texture_2d<u32>;
[[group(0), binding(1)]] var Dst : texture_storage_2d<r32uint, write>;
@group(0) @binding(1) var Dst : texture_storage_2d<r32uint, write>;
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
var srcValue : vec4<u32>;
let x_22 : vec4<u32> = textureLoad(Src, vec2<i32>(0, 0), 0);

View File

@@ -1,7 +1,7 @@
struct S { a : i32; };
[[group(0), binding(0)]] var<storage, read_write> buf : S;
@group(0) @binding(0) var<storage, read_write> buf : S;
[[stage(compute), workgroup_size(1)]] fn main() {
@stage(compute) @workgroup_size(1) fn main() {
let p : ptr<storage, i32, read_write> = &buf.a;
*p = 12;
}

View File

@@ -2,9 +2,9 @@ struct S {
a : i32;
}
[[group(0), binding(0)]] var<storage, read_write> buf : S;
@group(0) @binding(0) var<storage, read_write> buf : S;
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
let p : ptr<storage, i32, read_write> = &(buf.a);
*(p) = 12;

View File

@@ -5,21 +5,21 @@
channelCount : u32;
};
struct OutputBuf {
result : [[stride(4)]] array<u32>;
result : @stride(4) array<u32>;
};
[[group(0), binding(0)]] var src : texture_2d<f32>;
[[group(0), binding(1)]] var dst : texture_2d<f32>;
[[group(0), binding(2)]] var<storage_buffer, read_write> output : OutputBuf;
[[group(0), binding(3)]] var<uniform> uniforms : Uniforms;
//[[builtin(global_invocation_id)]] var<in> GlobalInvocationID : vec3<u32>;
@group(0) @binding(0) var src : texture_2d<f32>;
@group(0) @binding(1) var dst : texture_2d<f32>;
@group(0) @binding(2) var<storage_buffer, read_write> output : OutputBuf;
@group(0) @binding(3) var<uniform> uniforms : Uniforms;
//@builtin(global_invocation_id) var<in> GlobalInvocationID : vec3<u32>;
// Fp16 logic
// Infinity and NaN won't happen in this test case.
fn ConvertToFp16FloatValue(fp32 : f32) -> u32 {
return 1u;
}
[[stage(compute), workgroup_size(1, 1, 1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var size : vec2<i32> = textureDimensions(src);
var dstTexCoord : vec2<i32> = vec2<i32>(GlobalInvocationID.xy);
var srcTexCoord : vec2<i32> = dstTexCoord;

View File

@@ -6,23 +6,23 @@ struct Uniforms {
}
struct OutputBuf {
result : [[stride(4)]] array<u32>;
result : @stride(4) array<u32>;
}
[[group(0), binding(0)]] var src : texture_2d<f32>;
@group(0) @binding(0) var src : texture_2d<f32>;
[[group(0), binding(1)]] var dst : texture_2d<f32>;
@group(0) @binding(1) var dst : texture_2d<f32>;
[[group(0), binding(2)]] var<storage, read_write> output : OutputBuf;
@group(0) @binding(2) var<storage, read_write> output : OutputBuf;
[[group(0), binding(3)]] var<uniform> uniforms : Uniforms;
@group(0) @binding(3) var<uniform> uniforms : Uniforms;
fn ConvertToFp16FloatValue(fp32 : f32) -> u32 {
return 1u;
}
[[stage(compute), workgroup_size(1, 1, 1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var size : vec2<i32> = textureDimensions(src);
var dstTexCoord : vec2<i32> = vec2<i32>(GlobalInvocationID.xy);
var srcTexCoord : vec2<i32> = dstTexCoord;

View File

@@ -7,13 +7,13 @@
numbers: array<u32>;
};
[[group(0), binding(0)]] var<storage, read> firstMatrix : Matrix;
[[group(0), binding(1)]] var<storage, read> secondMatrix : Matrix;
[[group(0), binding(2)]] var<storage, write> resultMatrix : Matrix;
[[group(0), binding(3)]] var<uniform> uniforms : Uniforms;
@group(0) @binding(0) var<storage, read> firstMatrix : Matrix;
@group(0) @binding(1) var<storage, read> secondMatrix : Matrix;
@group(0) @binding(2) var<storage, write> resultMatrix : Matrix;
@group(0) @binding(3) var<uniform> uniforms : Uniforms;
[[stage(compute), workgroup_size(2,2,1)]]
fn main([[builtin(global_invocation_id)]] global_id : vec3<u32>) {
@stage(compute) @workgroup_size(2,2,1)
fn main(@builtin(global_invocation_id) global_id : vec3<u32>) {
let resultCell : vec2<u32> = vec2<u32>(global_id.y, global_id.x);
let dimInner : u32 = uniforms.aShape.y;
let dimOutter: u32 = uniforms.outShape.y;

View File

@@ -8,16 +8,16 @@ struct Matrix {
numbers : array<u32>;
}
[[group(0), binding(0)]] var<storage, read> firstMatrix : Matrix;
@group(0) @binding(0) var<storage, read> firstMatrix : Matrix;
[[group(0), binding(1)]] var<storage, read> secondMatrix : Matrix;
@group(0) @binding(1) var<storage, read> secondMatrix : Matrix;
[[group(0), binding(2)]] var<storage, write> resultMatrix : Matrix;
@group(0) @binding(2) var<storage, write> resultMatrix : Matrix;
[[group(0), binding(3)]] var<uniform> uniforms : Uniforms;
@group(0) @binding(3) var<uniform> uniforms : Uniforms;
[[stage(compute), workgroup_size(2, 2, 1)]]
fn main([[builtin(global_invocation_id)]] global_id : vec3<u32>) {
@stage(compute) @workgroup_size(2, 2, 1)
fn main(@builtin(global_invocation_id) global_id : vec3<u32>) {
let resultCell : vec2<u32> = vec2<u32>(global_id.y, global_id.x);
let dimInner : u32 = uniforms.aShape.y;
let dimOutter : u32 = uniforms.outShape.y;

View File

@@ -10,7 +10,7 @@ var<private> obj : QuicksortObject;
var<private> gl_FragCoord : vec4<f32>;
[[group(0), binding(0)]] var<uniform> x_188 : buf0;
@group(0) @binding(0) var<uniform> x_188 : buf0;
var<private> x_GLF_color : vec4<f32>;
@@ -1474,12 +1474,12 @@ fn main_1() {
}
struct main_out {
[[location(0)]]
@location(0)
x_GLF_color_1 : vec4<f32>;
}
[[stage(fragment)]]
fn main([[builtin(position)]] gl_FragCoord_param : vec4<f32>) -> main_out {
@stage(fragment)
fn main(@builtin(position) gl_FragCoord_param : vec4<f32>) -> main_out {
gl_FragCoord = gl_FragCoord_param;
main_1();
return main_out(x_GLF_color);

View File

@@ -3,16 +3,16 @@
level : i32;
};
[[group(0), binding(0)]] var<uniform> constants : Constants;
[[group(0), binding(1)]] var myTexture : texture_2d_array<f32>;
@group(0) @binding(0) var<uniform> constants : Constants;
@group(0) @binding(1) var myTexture : texture_2d_array<f32>;
struct Result {
values : [[stride(4)]] array<f32>;
values : @stride(4) array<f32>;
};
[[group(0), binding(3)]] var<storage, read_write> result : Result;
@group(0) @binding(3) var<storage, read_write> result : Result;
[[stage(compute), workgroup_size(1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var flatIndex : u32 =
2u * 2u * GlobalInvocationID.z +
2u * GlobalInvocationID.y +

View File

@@ -2,18 +2,18 @@ struct Constants {
level : i32;
}
[[group(0), binding(0)]] var<uniform> constants : Constants;
@group(0) @binding(0) var<uniform> constants : Constants;
[[group(0), binding(1)]] var myTexture : texture_2d_array<f32>;
@group(0) @binding(1) var myTexture : texture_2d_array<f32>;
struct Result {
values : [[stride(4)]] array<f32>;
values : @stride(4) array<f32>;
}
[[group(0), binding(3)]] var<storage, read_write> result : Result;
@group(0) @binding(3) var<storage, read_write> result : Result;
[[stage(compute), workgroup_size(1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
var flatIndex : u32 = ((((2u * 2u) * GlobalInvocationID.z) + (2u * GlobalInvocationID.y)) + GlobalInvocationID.x);
flatIndex = (flatIndex * 1u);
var texel : vec4<f32> = textureLoad(myTexture, vec2<i32>(GlobalInvocationID.xy), 0, 0);

View File

@@ -1,4 +1,4 @@
type ArrayExplicitStride = [[stride(4)]] array<i32, 2>;
type ArrayExplicitStride = @stride(4) array<i32, 2>;
type ArrayImplicitStride = array<i32, 2>;
fn foo() {

View File

@@ -1,4 +1,4 @@
type ArrayExplicitStride = [[stride(4)]] array<i32, 2>;
type ArrayExplicitStride = @stride(4) array<i32, 2>;
type ArrayImplicitStride = array<i32, 2>;

View File

@@ -10,7 +10,7 @@ struct S {
field1 : u32;
};
[[group(0), binding(0)]] var<uniform> x_75 : buf0;
@group(0) @binding(0) var<uniform> x_75 : buf0;
var<private> gl_FragCoord : vec4<f32>;

View File

@@ -10,7 +10,7 @@ struct S {
field1 : u32;
};
[[group(0), binding(0)]] var<uniform> x_75 : buf0;
@group(0) @binding(0) var<uniform> x_75 : buf0;
var<private> gl_FragCoord : vec4<f32>;

View File

@@ -1,10 +1,10 @@
struct Output {
[[builtin(position)]] Position : vec4<f32>;
[[location(0)]] color : vec4<f32>;
@builtin(position) Position : vec4<f32>;
@location(0) color : vec4<f32>;
};
[[stage(vertex)]] fn main(
[[builtin(vertex_index)]] VertexIndex : u32,
[[builtin(instance_index)]] InstanceIndex : u32) -> Output {
@stage(vertex) fn main(
@builtin(vertex_index) VertexIndex : u32,
@builtin(instance_index) InstanceIndex : u32) -> Output {
// TODO: remove workaround for Tint unary array access broke
let zv : array<vec2<f32>, 4> = array<vec2<f32>, 4>(
vec2<f32>(0.2, 0.2),

View File

@@ -1,12 +1,12 @@
struct Output {
[[builtin(position)]]
@builtin(position)
Position : vec4<f32>;
[[location(0)]]
@location(0)
color : vec4<f32>;
}
[[stage(vertex)]]
fn main([[builtin(vertex_index)]] VertexIndex : u32, [[builtin(instance_index)]] InstanceIndex : u32) -> Output {
@stage(vertex)
fn main(@builtin(vertex_index) VertexIndex : u32, @builtin(instance_index) InstanceIndex : u32) -> Output {
let zv : array<vec2<f32>, 4> = array<vec2<f32>, 4>(vec2<f32>(0.200000003, 0.200000003), vec2<f32>(0.300000012, 0.300000012), vec2<f32>(-0.100000001, -0.100000001), vec2<f32>(1.100000024, 1.100000024));
let z : f32 = zv[InstanceIndex].x;
var output : Output;

View File

@@ -4,11 +4,11 @@
let width : u32 = 128u;
[[group(0), binding(0)]] var tex : texture_depth_2d;
[[group(0), binding(1)]] var<storage, read_write> result : Result;
@group(0) @binding(0) var tex : texture_depth_2d;
@group(0) @binding(1) var<storage, read_write> result : Result;
[[stage(compute), workgroup_size(1)]] fn main(
[[builtin(global_invocation_id)]] GlobalInvocationId : vec3<u32>
@stage(compute) @workgroup_size(1) fn main(
@builtin(global_invocation_id) GlobalInvocationId : vec3<u32>
) {
result.values[GlobalInvocationId.y * width + GlobalInvocationId.x] = textureLoad(
tex, vec2<i32>(i32(GlobalInvocationId.x), i32(GlobalInvocationId.y)), 0);

View File

@@ -4,11 +4,11 @@ struct Result {
let width : u32 = 128u;
[[group(0), binding(0)]] var tex : texture_depth_2d;
@group(0) @binding(0) var tex : texture_depth_2d;
[[group(0), binding(1)]] var<storage, read_write> result : Result;
@group(0) @binding(1) var<storage, read_write> result : Result;
[[stage(compute), workgroup_size(1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationId : vec3<u32>) {
@stage(compute) @workgroup_size(1)
fn main(@builtin(global_invocation_id) GlobalInvocationId : vec3<u32>) {
result.values[((GlobalInvocationId.y * width) + GlobalInvocationId.x)] = textureLoad(tex, vec2<i32>(i32(GlobalInvocationId.x), i32(GlobalInvocationId.y)), 0);
}

View File

@@ -1,4 +1,4 @@
type Arr = [[stride(4)]] array<i32, 6u>;
type Arr = @stride(4) array<i32, 6u>;
struct sspp962805860buildInformationS {
footprint : vec4<f32>;
@@ -11,7 +11,7 @@ struct x_B4_BuildInformation {
passthru : sspp962805860buildInformationS;
}
[[group(0), binding(2)]] var<storage, read> sspp962805860buildInformation : x_B4_BuildInformation;
@group(0) @binding(2) var<storage, read> sspp962805860buildInformation : x_B4_BuildInformation;
fn main_1() {
var orientation : array<i32, 6u>;
@@ -25,7 +25,7 @@ fn main_1() {
return;
}
[[stage(fragment)]]
@stage(fragment)
fn main() {
main_1();
}

View File

@@ -8,16 +8,16 @@
struct OutputBuf {
result : array<u32>;
};
[[group(0), binding(0)]] var src : texture_2d<f32>;
[[group(0), binding(1)]] var dst : texture_2d<f32>;
[[group(0), binding(2)]] var<storage, read_write> output : OutputBuf;
[[group(0), binding(3)]] var<uniform> uniforms : Uniforms;
@group(0) @binding(0) var src : texture_2d<f32>;
@group(0) @binding(1) var dst : texture_2d<f32>;
@group(0) @binding(2) var<storage, read_write> output : OutputBuf;
@group(0) @binding(3) var<uniform> uniforms : Uniforms;
fn aboutEqual(value : f32, expect : f32) -> bool {
// The value diff should be smaller than the hard coded tolerance.
return abs(value - expect) < 0.001;
}
[[stage(compute), workgroup_size(1, 1, 1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
let srcSize : vec2<i32> = textureDimensions(src);
let dstSize : vec2<i32> = textureDimensions(dst);
let dstTexCoord : vec2<u32> = vec2<u32>(GlobalInvocationID.xy);
@@ -67,4 +67,4 @@ fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
} else {
output.result[outputIndex] = 0u;
}
}
}

View File

@@ -10,20 +10,20 @@ struct OutputBuf {
result : array<u32>;
}
[[group(0), binding(0)]] var src : texture_2d<f32>;
@group(0) @binding(0) var src : texture_2d<f32>;
[[group(0), binding(1)]] var dst : texture_2d<f32>;
@group(0) @binding(1) var dst : texture_2d<f32>;
[[group(0), binding(2)]] var<storage, read_write> output : OutputBuf;
@group(0) @binding(2) var<storage, read_write> output : OutputBuf;
[[group(0), binding(3)]] var<uniform> uniforms : Uniforms;
@group(0) @binding(3) var<uniform> uniforms : Uniforms;
fn aboutEqual(value : f32, expect : f32) -> bool {
return (abs((value - expect)) < 0.001);
}
[[stage(compute), workgroup_size(1, 1, 1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
let srcSize : vec2<i32> = textureDimensions(src);
let dstSize : vec2<i32> = textureDimensions(dst);
let dstTexCoord : vec2<u32> = vec2<u32>(GlobalInvocationID.xy);

View File

@@ -7,10 +7,10 @@
numbers: array<f32>;
};
[[group(0), binding(0)]] var<storage, read> firstMatrix : Matrix;
[[group(0), binding(1)]] var<storage, read> secondMatrix : Matrix;
[[group(0), binding(2)]] var<storage, write> resultMatrix : Matrix;
[[group(0), binding(3)]] var<uniform> uniforms : Uniforms;
@group(0) @binding(0) var<storage, read> firstMatrix : Matrix;
@group(0) @binding(1) var<storage, read> secondMatrix : Matrix;
@group(0) @binding(2) var<storage, write> resultMatrix : Matrix;
@group(0) @binding(3) var<uniform> uniforms : Uniforms;
fn mm_readA(row : u32, col : u32) -> f32 {
if (row < uniforms.dimAOuter && col < uniforms.dimInner)
@@ -45,9 +45,9 @@ let TileBOuter : u32 = 64u;
let TileInner : u32 = 64u;
var<workgroup> mm_Asub : array<array<f32, 64>, 64>;
var<workgroup> mm_Bsub : array<array<f32, 64>, 64>;
[[stage(compute), workgroup_size(16, 16, 1)]]
fn main([[builtin(local_invocation_id)]] local_id : vec3<u32>,
[[builtin(global_invocation_id)]] global_id : vec3<u32>) {
@stage(compute) @workgroup_size(16, 16, 1)
fn main(@builtin(local_invocation_id) local_id : vec3<u32>,
@builtin(global_invocation_id) global_id : vec3<u32>) {
let tileRow : u32 = local_id.y * RowPerThread;
let tileCol : u32 = local_id.x * ColPerThread;
@@ -120,4 +120,4 @@ fn main([[builtin(local_invocation_id)]] local_id : vec3<u32>,
acc[index]);
}
}
}
}

View File

@@ -8,13 +8,13 @@ struct Matrix {
numbers : array<f32>;
}
[[group(0), binding(0)]] var<storage, read> firstMatrix : Matrix;
@group(0) @binding(0) var<storage, read> firstMatrix : Matrix;
[[group(0), binding(1)]] var<storage, read> secondMatrix : Matrix;
@group(0) @binding(1) var<storage, read> secondMatrix : Matrix;
[[group(0), binding(2)]] var<storage, write> resultMatrix : Matrix;
@group(0) @binding(2) var<storage, write> resultMatrix : Matrix;
[[group(0), binding(3)]] var<uniform> uniforms : Uniforms;
@group(0) @binding(3) var<uniform> uniforms : Uniforms;
fn mm_readA(row : u32, col : u32) -> f32 {
if (((row < uniforms.dimAOuter) && (col < uniforms.dimInner))) {
@@ -53,8 +53,8 @@ var<workgroup> mm_Asub : array<array<f32, 64>, 64>;
var<workgroup> mm_Bsub : array<array<f32, 64>, 64>;
[[stage(compute), workgroup_size(16, 16, 1)]]
fn main([[builtin(local_invocation_id)]] local_id : vec3<u32>, [[builtin(global_invocation_id)]] global_id : vec3<u32>) {
@stage(compute) @workgroup_size(16, 16, 1)
fn main(@builtin(local_invocation_id) local_id : vec3<u32>, @builtin(global_invocation_id) global_id : vec3<u32>) {
let tileRow : u32 = (local_id.y * RowPerThread);
let tileCol : u32 = (local_id.x * ColPerThread);
let globalRow : u32 = (global_id.y * RowPerThread);

View File

@@ -21,25 +21,25 @@ struct ub_SceneParams {
};
struct ub_MaterialParams {
u_TexMtx: [[stride(32)]] array<Mat4x2_,1>;
u_TexMtx: @stride(32) array<Mat4x2_,1>;
u_Misc0_: vec4<f32>;
};
struct ub_PacketParams {
u_PosMtx: [[stride(48)]] array<Mat4x3_,32>;
u_PosMtx: @stride(48) array<Mat4x3_,32>;
};
struct VertexOutput {
[[location(0)]] v_Color: vec4<f32>;
[[location(1)]] v_TexCoord: vec2<f32>;
[[builtin(position)]] member: vec4<f32>;
@location(0) v_Color: vec4<f32>;
@location(1) v_TexCoord: vec2<f32>;
@builtin(position) member: vec4<f32>;
};
[[group(0), binding(0)]]
@group(0) @binding(0)
var<uniform> global: ub_SceneParams;
[[group(0), binding(1)]]
@group(0) @binding(1)
var<uniform> global1: ub_MaterialParams;
[[group(0), binding(2)]]
@group(0) @binding(2)
var<uniform> global2: ub_PacketParams;
var<private> a_Position1: vec3<f32>;
var<private> a_UV1: vec2<f32>;
@@ -283,8 +283,8 @@ fn main1() {
}
}
[[stage(vertex)]]
fn main([[location(0)]] a_Position: vec3<f32>, [[location(1)]] a_UV: vec2<f32>, [[location(2)]] a_Color: vec4<f32>, [[location(3)]] a_Normal: vec3<f32>, [[location(4)]] a_PosMtxIdx: f32) -> VertexOutput {
@stage(vertex)
fn main(@location(0) a_Position: vec3<f32>, @location(1) a_UV: vec2<f32>, @location(2) a_Color: vec4<f32>, @location(3) a_Normal: vec3<f32>, @location(4) a_PosMtxIdx: f32) -> VertexOutput {
a_Position1 = a_Position;
a_UV1 = a_UV;
a_Color1 = a_Color;

View File

@@ -21,28 +21,28 @@ struct ub_SceneParams {
}
struct ub_MaterialParams {
u_TexMtx : [[stride(32)]] array<Mat4x2_, 1>;
u_TexMtx : @stride(32) array<Mat4x2_, 1>;
u_Misc0_ : vec4<f32>;
}
struct ub_PacketParams {
u_PosMtx : [[stride(48)]] array<Mat4x3_, 32>;
u_PosMtx : @stride(48) array<Mat4x3_, 32>;
}
struct VertexOutput {
[[location(0)]]
@location(0)
v_Color : vec4<f32>;
[[location(1)]]
@location(1)
v_TexCoord : vec2<f32>;
[[builtin(position)]]
@builtin(position)
member : vec4<f32>;
}
[[group(0), binding(0)]] var<uniform> global : ub_SceneParams;
@group(0) @binding(0) var<uniform> global : ub_SceneParams;
[[group(0), binding(1)]] var<uniform> global1 : ub_MaterialParams;
@group(0) @binding(1) var<uniform> global1 : ub_MaterialParams;
[[group(0), binding(2)]] var<uniform> global2 : ub_PacketParams;
@group(0) @binding(2) var<uniform> global2 : ub_PacketParams;
var<private> a_Position1 : vec3<f32>;
@@ -279,8 +279,8 @@ fn main1() {
}
}
[[stage(vertex)]]
fn main([[location(0)]] a_Position : vec3<f32>, [[location(1)]] a_UV : vec2<f32>, [[location(2)]] a_Color : vec4<f32>, [[location(3)]] a_Normal : vec3<f32>, [[location(4)]] a_PosMtxIdx : f32) -> VertexOutput {
@stage(vertex)
fn main(@location(0) a_Position : vec3<f32>, @location(1) a_UV : vec2<f32>, @location(2) a_Color : vec4<f32>, @location(3) a_Normal : vec3<f32>, @location(4) a_PosMtxIdx : f32) -> VertexOutput {
a_Position1 = a_Position;
a_UV1 = a_UV;
a_Color1 = a_Color;

View File

@@ -1,12 +1,12 @@
struct DrawIndirectArgs {
vertexCount : atomic<u32>;
};
[[group(0), binding(5)]] var<storage, read_write> drawOut : DrawIndirectArgs;
@group(0) @binding(5) var<storage, read_write> drawOut : DrawIndirectArgs;
var<private> cubeVerts : u32 = 0u;
[[stage(compute), workgroup_size(1)]]
fn computeMain([[builtin(global_invocation_id)]] global_id : vec3<u32>) {
@stage(compute) @workgroup_size(1)
fn computeMain(@builtin(global_invocation_id) global_id : vec3<u32>) {
// Increment cubeVerts based on some criteria...
// This fails SPIR-V validation

View File

@@ -2,11 +2,11 @@ struct DrawIndirectArgs {
vertexCount : atomic<u32>;
}
[[group(0), binding(5)]] var<storage, read_write> drawOut : DrawIndirectArgs;
@group(0) @binding(5) var<storage, read_write> drawOut : DrawIndirectArgs;
var<private> cubeVerts : u32 = 0u;
[[stage(compute), workgroup_size(1)]]
fn computeMain([[builtin(global_invocation_id)]] global_id : vec3<u32>) {
@stage(compute) @workgroup_size(1)
fn computeMain(@builtin(global_invocation_id) global_id : vec3<u32>) {
let firstVertex : u32 = atomicAdd(&(drawOut.vertexCount), cubeVerts);
}

View File

@@ -3,15 +3,15 @@
blockDim : u32;
};
[[group(0), binding(0)]] var samp : sampler;
[[group(0), binding(1)]] var<uniform> params : Params;
[[group(1), binding(1)]] var inputTex : texture_2d<f32>;
[[group(1), binding(2)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
@group(0) @binding(0) var samp : sampler;
@group(0) @binding(1) var<uniform> params : Params;
@group(1) @binding(1) var inputTex : texture_2d<f32>;
@group(1) @binding(2) var outputTex : texture_storage_2d<rgba8unorm, write>;
struct Flip {
value : u32;
};
[[group(1), binding(3)]] var<uniform> flip : Flip;
@group(1) @binding(3) var<uniform> flip : Flip;
// This shader blurs the input texture in one direction, depending on whether
// |flip.value| is 0 or 1.
@@ -29,10 +29,10 @@
var<workgroup> tile : array<array<vec3<f32>, 256>, 4>;
[[stage(compute), workgroup_size(64, 1, 1)]]
@stage(compute) @workgroup_size(64, 1, 1)
fn main(
[[builtin(workgroup_id)]] WorkGroupID : vec3<u32>,
[[builtin(local_invocation_id)]] LocalInvocationID : vec3<u32>
@builtin(workgroup_id) WorkGroupID : vec3<u32>,
@builtin(local_invocation_id) LocalInvocationID : vec3<u32>
) {
let filterOffset : u32 = (params.filterDim - 1u) / 2u;
let dims : vec2<i32> = textureDimensions(inputTex, 0);

View File

@@ -3,24 +3,24 @@ struct Params {
blockDim : u32;
}
[[group(0), binding(0)]] var samp : sampler;
@group(0) @binding(0) var samp : sampler;
[[group(0), binding(1)]] var<uniform> params : Params;
@group(0) @binding(1) var<uniform> params : Params;
[[group(1), binding(1)]] var inputTex : texture_2d<f32>;
@group(1) @binding(1) var inputTex : texture_2d<f32>;
[[group(1), binding(2)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
@group(1) @binding(2) var outputTex : texture_storage_2d<rgba8unorm, write>;
struct Flip {
value : u32;
}
[[group(1), binding(3)]] var<uniform> flip : Flip;
@group(1) @binding(3) var<uniform> flip : Flip;
var<workgroup> tile : array<array<vec3<f32>, 256>, 4>;
[[stage(compute), workgroup_size(64, 1, 1)]]
fn main([[builtin(workgroup_id)]] WorkGroupID : vec3<u32>, [[builtin(local_invocation_id)]] LocalInvocationID : vec3<u32>) {
@stage(compute) @workgroup_size(64, 1, 1)
fn main(@builtin(workgroup_id) WorkGroupID : vec3<u32>, @builtin(local_invocation_id) LocalInvocationID : vec3<u32>) {
let filterOffset : u32 = ((params.filterDim - 1u) / 2u);
let dims : vec2<i32> = textureDimensions(inputTex, 0);
let baseIndex = (vec2<i32>(((WorkGroupID.xy * vec2<u32>(params.blockDim, 4u)) + (LocalInvocationID.xy * vec2<u32>(4u, 1u)))) - vec2<i32>(i32(filterOffset), 0));

View File

@@ -1,28 +1,28 @@
struct Uniforms {
NAN : f32;
[[size(12)]]
@size(12)
padding : u32;
aShape : vec3<i32>;
[[size(4)]]
@size(4)
padding_1 : u32;
bShape : vec3<i32>;
[[size(4)]]
@size(4)
padding_2 : u32;
outShape : vec3<i32>;
[[size(4)]]
@size(4)
padding_3 : u32;
outShapeStrides : vec2<i32>;
}
type RTArr = [[stride(4)]] array<f32>;
type RTArr = @stride(4) array<f32>;
type RTArr_1 = [[stride(4)]] array<f32>;
type RTArr_1 = @stride(4) array<f32>;
struct ssbOut {
result : RTArr_1;
}
type RTArr_2 = [[stride(4)]] array<f32>;
type RTArr_2 = @stride(4) array<f32>;
struct ssbA {
A : RTArr_1;
@@ -34,13 +34,13 @@ struct ssbB {
var<private> dimAOuter_1 : i32;
[[group(0), binding(3)]] var<uniform> x_48 : Uniforms;
@group(0) @binding(3) var<uniform> x_48 : Uniforms;
var<private> dimInner_1 : i32;
var<private> dimBOuter_1 : i32;
[[group(0), binding(0)]] var<storage, read_write> x_54 : ssbOut;
@group(0) @binding(0) var<storage, read_write> x_54 : ssbOut;
var<private> gl_LocalInvocationID : vec3<u32>;
@@ -50,11 +50,11 @@ var<workgroup> mm_Asub : array<array<f32, 64u>, 64u>;
var<workgroup> mm_Bsub : array<array<f32, 1u>, 64u>;
[[group(0), binding(1)]] var<storage, read> x_165 : ssbA;
@group(0) @binding(1) var<storage, read> x_165 : ssbA;
var<private> batch : i32;
[[group(0), binding(2)]] var<storage, read> x_185 : ssbB;
@group(0) @binding(2) var<storage, read> x_185 : ssbB;
fn coordsInBounds_vi2_vi2_(coord : ptr<function, vec2<i32>>, shape : ptr<function, vec2<i32>>) -> bool {
var x_87 : bool;
@@ -514,8 +514,8 @@ fn main_1() {
return;
}
[[stage(compute), workgroup_size(1, 64, 1)]]
fn main([[builtin(local_invocation_id)]] gl_LocalInvocationID_param : vec3<u32>, [[builtin(global_invocation_id)]] gl_GlobalInvocationID_param : vec3<u32>) {
@stage(compute) @workgroup_size(1, 64, 1)
fn main(@builtin(local_invocation_id) gl_LocalInvocationID_param : vec3<u32>, @builtin(global_invocation_id) gl_GlobalInvocationID_param : vec3<u32>) {
gl_LocalInvocationID = gl_LocalInvocationID_param;
gl_GlobalInvocationID = gl_GlobalInvocationID_param;
main_1();

View File

@@ -1,6 +1,6 @@
struct LeftOver {
time : f32;
[[size(12)]]
@size(12)
padding : u32;
worldViewProjection : mat4x4<f32>;
outputSize : vec2<f32>;
@@ -11,29 +11,29 @@ struct LeftOver {
colorMul : vec3<f32>;
};
[[group(2), binding(9)]] var<uniform> x_20 : LeftOver;
@group(2) @binding(9) var<uniform> x_20 : LeftOver;
[[group(2), binding(3)]] var frameMapTexture : texture_2d<f32>;
@group(2) @binding(3) var frameMapTexture : texture_2d<f32>;
[[group(2), binding(2)]] var frameMapSampler : sampler;
@group(2) @binding(2) var frameMapSampler : sampler;
var<private> tUV : vec2<f32>;
[[group(2), binding(5)]] var tileMapsTexture0 : texture_2d<f32>;
@group(2) @binding(5) var tileMapsTexture0 : texture_2d<f32>;
[[group(2), binding(4)]] var tileMapsSampler : sampler;
@group(2) @binding(4) var tileMapsSampler : sampler;
[[group(2), binding(6)]] var tileMapsTexture1 : texture_2d<f32>;
@group(2) @binding(6) var tileMapsTexture1 : texture_2d<f32>;
[[group(2), binding(8)]] var animationMapTexture : texture_2d<f32>;
@group(2) @binding(8) var animationMapTexture : texture_2d<f32>;
[[group(2), binding(7)]] var animationMapSampler : sampler;
@group(2) @binding(7) var animationMapSampler : sampler;
var<private> mt : f32;
[[group(2), binding(1)]] var spriteSheetTexture : texture_2d<f32>;
@group(2) @binding(1) var spriteSheetTexture : texture_2d<f32>;
[[group(2), binding(0)]] var spriteSheetSampler : sampler;
@group(2) @binding(0) var spriteSheetSampler : sampler;
var<private> glFragColor : vec4<f32>;
@@ -211,12 +211,12 @@ fn main_1() {
}
struct main_out {
[[location(0)]]
@location(0)
glFragColor_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main([[location(2)]] tUV_param : vec2<f32>, [[location(5)]] tileID_1_param : vec2<f32>, [[location(4)]] levelUnits_param : vec2<f32>, [[location(3)]] stageUnits_1_param : vec2<f32>, [[location(0)]] vPosition_param : vec3<f32>, [[location(1)]] vUV_param : vec2<f32>) -> main_out {
@stage(fragment)
fn main(@location(2) tUV_param : vec2<f32>, @location(5) tileID_1_param : vec2<f32>, @location(4) levelUnits_param : vec2<f32>, @location(3) stageUnits_1_param : vec2<f32>, @location(0) vPosition_param : vec3<f32>, @location(1) vUV_param : vec2<f32>) -> main_out {
tUV = tUV_param;
tileID_1 = tileID_1_param;
levelUnits = levelUnits_param;
@@ -225,4 +225,4 @@ fn main([[location(2)]] tUV_param : vec2<f32>, [[location(5)]] tileID_1_param :
vUV = vUV_param;
main_1();
return main_out(glFragColor);
}
}

View File

@@ -1,6 +1,6 @@
struct LeftOver {
time : f32;
[[size(12)]]
@size(12)
padding : u32;
worldViewProjection : mat4x4<f32>;
outputSize : vec2<f32>;
@@ -11,29 +11,29 @@ struct LeftOver {
colorMul : vec3<f32>;
}
[[group(2), binding(9)]] var<uniform> x_20 : LeftOver;
@group(2) @binding(9) var<uniform> x_20 : LeftOver;
[[group(2), binding(3)]] var frameMapTexture : texture_2d<f32>;
@group(2) @binding(3) var frameMapTexture : texture_2d<f32>;
[[group(2), binding(2)]] var frameMapSampler : sampler;
@group(2) @binding(2) var frameMapSampler : sampler;
var<private> tUV : vec2<f32>;
[[group(2), binding(5)]] var tileMapsTexture0 : texture_2d<f32>;
@group(2) @binding(5) var tileMapsTexture0 : texture_2d<f32>;
[[group(2), binding(4)]] var tileMapsSampler : sampler;
@group(2) @binding(4) var tileMapsSampler : sampler;
[[group(2), binding(6)]] var tileMapsTexture1 : texture_2d<f32>;
@group(2) @binding(6) var tileMapsTexture1 : texture_2d<f32>;
[[group(2), binding(8)]] var animationMapTexture : texture_2d<f32>;
@group(2) @binding(8) var animationMapTexture : texture_2d<f32>;
[[group(2), binding(7)]] var animationMapSampler : sampler;
@group(2) @binding(7) var animationMapSampler : sampler;
var<private> mt : f32;
[[group(2), binding(1)]] var spriteSheetTexture : texture_2d<f32>;
@group(2) @binding(1) var spriteSheetTexture : texture_2d<f32>;
[[group(2), binding(0)]] var spriteSheetSampler : sampler;
@group(2) @binding(0) var spriteSheetSampler : sampler;
var<private> glFragColor : vec4<f32>;
@@ -211,12 +211,12 @@ fn main_1() {
}
struct main_out {
[[location(0)]]
@location(0)
glFragColor_1 : vec4<f32>;
}
[[stage(fragment)]]
fn main([[location(2)]] tUV_param : vec2<f32>, [[location(5)]] tileID_1_param : vec2<f32>, [[location(4)]] levelUnits_param : vec2<f32>, [[location(3)]] stageUnits_1_param : vec2<f32>, [[location(0)]] vPosition_param : vec3<f32>, [[location(1)]] vUV_param : vec2<f32>) -> main_out {
@stage(fragment)
fn main(@location(2) tUV_param : vec2<f32>, @location(5) tileID_1_param : vec2<f32>, @location(4) levelUnits_param : vec2<f32>, @location(3) stageUnits_1_param : vec2<f32>, @location(0) vPosition_param : vec3<f32>, @location(1) vUV_param : vec2<f32>) -> main_out {
tUV = tUV_param;
tileID_1 = tileID_1_param;
levelUnits = levelUnits_param;

View File

@@ -8,12 +8,12 @@ struct LeftOver {
u_World : mat4x4<f32>;
u_ViewProjection : mat4x4<f32>;
u_bumpStrength : f32;
[[size(12)]]
@size(12)
padding : u32;
u_cameraPosition : vec3<f32>;
u_parallaxScale : f32;
textureInfoName : f32;
[[size(4)]]
@size(4)
padding_1 : u32;
tangentSpaceParameter0 : vec2<f32>;
};
@@ -23,7 +23,7 @@ struct Light0 {
vLightDiffuse : vec4<f32>;
vLightSpecular : vec4<f32>;
vLightGround : vec3<f32>;
[[size(4)]]
@size(4)
padding_2 : u32;
shadowsInfo : vec4<f32>;
depthValues : vec2<f32>;
@@ -33,13 +33,13 @@ var<private> u_Float : f32;
var<private> u_Color : vec3<f32>;
[[group(2), binding(1)]] var TextureSamplerTexture : texture_2d<f32>;
@group(2) @binding(1) var TextureSamplerTexture : texture_2d<f32>;
[[group(2), binding(0)]] var TextureSamplerSampler : sampler;
@group(2) @binding(0) var TextureSamplerSampler : sampler;
var<private> vMainuv : vec2<f32>;
[[group(2), binding(6)]] var<uniform> x_269 : LeftOver;
@group(2) @binding(6) var<uniform> x_269 : LeftOver;
var<private> v_output1 : vec4<f32>;
@@ -49,17 +49,17 @@ var<private> v_uv : vec2<f32>;
var<private> v_output2 : vec4<f32>;
[[group(2), binding(3)]] var TextureSampler1Texture : texture_2d<f32>;
@group(2) @binding(3) var TextureSampler1Texture : texture_2d<f32>;
[[group(2), binding(2)]] var TextureSampler1Sampler : sampler;
@group(2) @binding(2) var TextureSampler1Sampler : sampler;
[[group(0), binding(5)]] var<uniform> light0 : Light0;
@group(0) @binding(5) var<uniform> light0 : Light0;
var<private> glFragColor : vec4<f32>;
[[group(2), binding(4)]] var bumpSamplerSampler : sampler;
@group(2) @binding(4) var bumpSamplerSampler : sampler;
[[group(2), binding(5)]] var bumpSamplerTexture : texture_2d<f32>;
@group(2) @binding(5) var bumpSamplerTexture : texture_2d<f32>;
fn cotangent_frame_vf3_vf3_vf2_vf2_(normal_1 : ptr<function, vec3<f32>>, p : ptr<function, vec3<f32>>, uv : ptr<function, vec2<f32>>, tangentSpaceParams : ptr<function, vec2<f32>>) -> mat3x3<f32> {
var dp1 : vec3<f32>;
@@ -437,12 +437,12 @@ fn main_1() {
}
struct main_out {
[[location(0)]]
@location(0)
glFragColor_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main([[location(1)]] vMainuv_param : vec2<f32>, [[location(0)]] v_output1_param : vec4<f32>, [[builtin(front_facing)]] gl_FrontFacing_param : bool, [[location(3)]] v_uv_param : vec2<f32>, [[location(2)]] v_output2_param : vec4<f32>) -> main_out {
@stage(fragment)
fn main(@location(1) vMainuv_param : vec2<f32>, @location(0) v_output1_param : vec4<f32>, @builtin(front_facing) gl_FrontFacing_param : bool, @location(3) v_uv_param : vec2<f32>, @location(2) v_output2_param : vec4<f32>) -> main_out {
vMainuv = vMainuv_param;
v_output1 = v_output1_param;
gl_FrontFacing = gl_FrontFacing_param;
@@ -450,4 +450,4 @@ fn main([[location(1)]] vMainuv_param : vec2<f32>, [[location(0)]] v_output1_par
v_output2 = v_output2_param;
main_1();
return main_out(glFragColor);
}
}

View File

@@ -7,12 +7,12 @@ struct LeftOver {
u_World : mat4x4<f32>;
u_ViewProjection : mat4x4<f32>;
u_bumpStrength : f32;
[[size(12)]]
@size(12)
padding : u32;
u_cameraPosition : vec3<f32>;
u_parallaxScale : f32;
textureInfoName : f32;
[[size(4)]]
@size(4)
padding_1 : u32;
tangentSpaceParameter0 : vec2<f32>;
}
@@ -22,7 +22,7 @@ struct Light0 {
vLightDiffuse : vec4<f32>;
vLightSpecular : vec4<f32>;
vLightGround : vec3<f32>;
[[size(4)]]
@size(4)
padding_2 : u32;
shadowsInfo : vec4<f32>;
depthValues : vec2<f32>;
@@ -32,13 +32,13 @@ var<private> u_Float : f32;
var<private> u_Color : vec3<f32>;
[[group(2), binding(1)]] var TextureSamplerTexture : texture_2d<f32>;
@group(2) @binding(1) var TextureSamplerTexture : texture_2d<f32>;
[[group(2), binding(0)]] var TextureSamplerSampler : sampler;
@group(2) @binding(0) var TextureSamplerSampler : sampler;
var<private> vMainuv : vec2<f32>;
[[group(2), binding(6)]] var<uniform> x_269 : LeftOver;
@group(2) @binding(6) var<uniform> x_269 : LeftOver;
var<private> v_output1 : vec4<f32>;
@@ -48,17 +48,17 @@ var<private> v_uv : vec2<f32>;
var<private> v_output2 : vec4<f32>;
[[group(2), binding(3)]] var TextureSampler1Texture : texture_2d<f32>;
@group(2) @binding(3) var TextureSampler1Texture : texture_2d<f32>;
[[group(2), binding(2)]] var TextureSampler1Sampler : sampler;
@group(2) @binding(2) var TextureSampler1Sampler : sampler;
[[group(0), binding(5)]] var<uniform> light0 : Light0;
@group(0) @binding(5) var<uniform> light0 : Light0;
var<private> glFragColor : vec4<f32>;
[[group(2), binding(4)]] var bumpSamplerSampler : sampler;
@group(2) @binding(4) var bumpSamplerSampler : sampler;
[[group(2), binding(5)]] var bumpSamplerTexture : texture_2d<f32>;
@group(2) @binding(5) var bumpSamplerTexture : texture_2d<f32>;
fn cotangent_frame_vf3_vf3_vf2_vf2_(normal_1 : ptr<function, vec3<f32>>, p : ptr<function, vec3<f32>>, uv : ptr<function, vec2<f32>>, tangentSpaceParams : ptr<function, vec2<f32>>) -> mat3x3<f32> {
var dp1 : vec3<f32>;
@@ -436,12 +436,12 @@ fn main_1() {
}
struct main_out {
[[location(0)]]
@location(0)
glFragColor_1 : vec4<f32>;
}
[[stage(fragment)]]
fn main([[location(1)]] vMainuv_param : vec2<f32>, [[location(0)]] v_output1_param : vec4<f32>, [[builtin(front_facing)]] gl_FrontFacing_param : bool, [[location(3)]] v_uv_param : vec2<f32>, [[location(2)]] v_output2_param : vec4<f32>) -> main_out {
@stage(fragment)
fn main(@location(1) vMainuv_param : vec2<f32>, @location(0) v_output1_param : vec4<f32>, @builtin(front_facing) gl_FrontFacing_param : bool, @location(3) v_uv_param : vec2<f32>, @location(2) v_output2_param : vec4<f32>) -> main_out {
vMainuv = vMainuv_param;
v_output1 = v_output1_param;
gl_FrontFacing = gl_FrontFacing_param;

View File

@@ -1,6 +1,6 @@
type RTArr = [[stride(4)]] array<f32>;
type RTArr = @stride(4) array<f32>;
type RTArr_1 = [[stride(4)]] array<f32>;
type RTArr_1 = @stride(4) array<f32>;
struct ssbOut {
result : RTArr_1;
@@ -18,13 +18,13 @@ struct Uniforms {
size : i32;
}
[[group(0), binding(0)]] var<storage, read_write> x_16 : ssbOut;
@group(0) @binding(0) var<storage, read_write> x_16 : ssbOut;
[[group(0), binding(1)]] var<storage, read> x_20 : ssbA;
@group(0) @binding(1) var<storage, read> x_20 : ssbA;
var<private> gl_GlobalInvocationID : vec3<u32>;
[[group(0), binding(2)]] var<uniform> x_24 : Uniforms;
@group(0) @binding(2) var<uniform> x_24 : Uniforms;
fn getAAtOutCoords_() -> f32 {
let x_42 : u32 = gl_GlobalInvocationID.x;
@@ -72,8 +72,8 @@ fn main_1() {
return;
}
[[stage(compute), workgroup_size(128, 1, 1)]]
fn main([[builtin(global_invocation_id)]] gl_GlobalInvocationID_param : vec3<u32>) {
@stage(compute) @workgroup_size(128, 1, 1)
fn main(@builtin(global_invocation_id) gl_GlobalInvocationID_param : vec3<u32>) {
gl_GlobalInvocationID = gl_GlobalInvocationID_param;
main_1();
}

View File

@@ -7,58 +7,58 @@ struct S {
a : f32;
};
[[group(0), binding(0)]] var<storage> b0 : S;
[[group(1), binding(0)]] var<storage> b1 : S;
[[group(2), binding(0)]] var<storage> b2 : S;
[[group(3), binding(0)]] var<storage> b3 : S;
[[group(4), binding(0)]] var<storage> b4 : S;
[[group(5), binding(0)]] var<storage> b5 : S;
[[group(6), binding(0)]] var<storage> b6 : S;
[[group(7), binding(0)]] var<storage> b7 : S;
[[group(9), binding(1)]] var<uniform> b8 : S;
[[group(8), binding(1)]] var<uniform> b9 : S;
[[group(10), binding(1)]] var<uniform> b10 : S;
[[group(11), binding(1)]] var<uniform> b11 : S;
[[group(12), binding(1)]] var<uniform> b12 : S;
[[group(13), binding(1)]] var<uniform> b13 : S;
[[group(14), binding(1)]] var<uniform> b14 : S;
[[group(15), binding(1)]] var<uniform> b15 : S;
@group(0) @binding(0) var<storage> b0 : S;
@group(1) @binding(0) var<storage> b1 : S;
@group(2) @binding(0) var<storage> b2 : S;
@group(3) @binding(0) var<storage> b3 : S;
@group(4) @binding(0) var<storage> b4 : S;
@group(5) @binding(0) var<storage> b5 : S;
@group(6) @binding(0) var<storage> b6 : S;
@group(7) @binding(0) var<storage> b7 : S;
@group(9) @binding(1) var<uniform> b8 : S;
@group(8) @binding(1) var<uniform> b9 : S;
@group(10) @binding(1) var<uniform> b10 : S;
@group(11) @binding(1) var<uniform> b11 : S;
@group(12) @binding(1) var<uniform> b12 : S;
@group(13) @binding(1) var<uniform> b13 : S;
@group(14) @binding(1) var<uniform> b14 : S;
@group(15) @binding(1) var<uniform> b15 : S;
[[group(0), binding(1)]] var t0 : texture_2d<f32>;
[[group(1), binding(1)]] var t1 : texture_2d<f32>;
[[group(2), binding(1)]] var t2 : texture_2d<f32>;
[[group(3), binding(1)]] var t3 : texture_2d<f32>;
[[group(4), binding(1)]] var t4 : texture_2d<f32>;
[[group(5), binding(1)]] var t5 : texture_2d<f32>;
[[group(6), binding(1)]] var t6 : texture_2d<f32>;
[[group(7), binding(1)]] var t7 : texture_2d<f32>;
[[group(8), binding(200)]] var t8 : texture_depth_2d;
[[group(9), binding(200)]] var t9 : texture_depth_2d;
[[group(10), binding(200)]] var t10 : texture_depth_2d;
[[group(11), binding(200)]] var t11 : texture_depth_2d;
[[group(12), binding(200)]] var t12 : texture_depth_2d;
[[group(13), binding(200)]] var t13 : texture_depth_2d;
[[group(14), binding(200)]] var t14 : texture_depth_2d;
[[group(15), binding(200)]] var t15 : texture_depth_2d;
@group(0) @binding(1) var t0 : texture_2d<f32>;
@group(1) @binding(1) var t1 : texture_2d<f32>;
@group(2) @binding(1) var t2 : texture_2d<f32>;
@group(3) @binding(1) var t3 : texture_2d<f32>;
@group(4) @binding(1) var t4 : texture_2d<f32>;
@group(5) @binding(1) var t5 : texture_2d<f32>;
@group(6) @binding(1) var t6 : texture_2d<f32>;
@group(7) @binding(1) var t7 : texture_2d<f32>;
@group(8) @binding(200) var t8 : texture_depth_2d;
@group(9) @binding(200) var t9 : texture_depth_2d;
@group(10) @binding(200) var t10 : texture_depth_2d;
@group(11) @binding(200) var t11 : texture_depth_2d;
@group(12) @binding(200) var t12 : texture_depth_2d;
@group(13) @binding(200) var t13 : texture_depth_2d;
@group(14) @binding(200) var t14 : texture_depth_2d;
@group(15) @binding(200) var t15 : texture_depth_2d;
[[group(0), binding(200)]] var s0 : sampler;
[[group(1), binding(200)]] var s1 : sampler;
[[group(2), binding(200)]] var s2 : sampler;
[[group(3), binding(200)]] var s3 : sampler;
[[group(4), binding(200)]] var s4 : sampler;
[[group(5), binding(200)]] var s5 : sampler;
[[group(6), binding(200)]] var s6 : sampler;
[[group(7), binding(200)]] var s7 : sampler;
[[group(8), binding(300)]] var s8 : sampler_comparison;
[[group(9), binding(300)]] var s9 : sampler_comparison;
[[group(10), binding(300)]] var s10 : sampler_comparison;
[[group(11), binding(300)]] var s11 : sampler_comparison;
[[group(12), binding(300)]] var s12 : sampler_comparison;
[[group(13), binding(300)]] var s13 : sampler_comparison;
[[group(14), binding(300)]] var s14 : sampler_comparison;
[[group(15), binding(300)]] var s15 : sampler_comparison;
@group(0) @binding(200) var s0 : sampler;
@group(1) @binding(200) var s1 : sampler;
@group(2) @binding(200) var s2 : sampler;
@group(3) @binding(200) var s3 : sampler;
@group(4) @binding(200) var s4 : sampler;
@group(5) @binding(200) var s5 : sampler;
@group(6) @binding(200) var s6 : sampler;
@group(7) @binding(200) var s7 : sampler;
@group(8) @binding(300) var s8 : sampler_comparison;
@group(9) @binding(300) var s9 : sampler_comparison;
@group(10) @binding(300) var s10 : sampler_comparison;
@group(11) @binding(300) var s11 : sampler_comparison;
@group(12) @binding(300) var s12 : sampler_comparison;
@group(13) @binding(300) var s13 : sampler_comparison;
@group(14) @binding(300) var s14 : sampler_comparison;
@group(15) @binding(300) var s15 : sampler_comparison;
[[stage(fragment)]]
@stage(fragment)
fn main() {
_ = b0;
_ = b1;

View File

@@ -2,103 +2,103 @@ struct S {
a : f32;
}
[[group(0), binding(0)]] var<storage> b0 : S;
@group(0) @binding(0) var<storage> b0 : S;
[[group(1), binding(0)]] var<storage> b1 : S;
@group(1) @binding(0) var<storage> b1 : S;
[[group(2), binding(0)]] var<storage> b2 : S;
@group(2) @binding(0) var<storage> b2 : S;
[[group(3), binding(0)]] var<storage> b3 : S;
@group(3) @binding(0) var<storage> b3 : S;
[[group(4), binding(0)]] var<storage> b4 : S;
@group(4) @binding(0) var<storage> b4 : S;
[[group(5), binding(0)]] var<storage> b5 : S;
@group(5) @binding(0) var<storage> b5 : S;
[[group(6), binding(0)]] var<storage> b6 : S;
@group(6) @binding(0) var<storage> b6 : S;
[[group(7), binding(0)]] var<storage> b7 : S;
@group(7) @binding(0) var<storage> b7 : S;
[[group(9), binding(1)]] var<uniform> b8 : S;
@group(9) @binding(1) var<uniform> b8 : S;
[[group(8), binding(1)]] var<uniform> b9 : S;
@group(8) @binding(1) var<uniform> b9 : S;
[[group(10), binding(1)]] var<uniform> b10 : S;
@group(10) @binding(1) var<uniform> b10 : S;
[[group(11), binding(1)]] var<uniform> b11 : S;
@group(11) @binding(1) var<uniform> b11 : S;
[[group(12), binding(1)]] var<uniform> b12 : S;
@group(12) @binding(1) var<uniform> b12 : S;
[[group(13), binding(1)]] var<uniform> b13 : S;
@group(13) @binding(1) var<uniform> b13 : S;
[[group(14), binding(1)]] var<uniform> b14 : S;
@group(14) @binding(1) var<uniform> b14 : S;
[[group(15), binding(1)]] var<uniform> b15 : S;
@group(15) @binding(1) var<uniform> b15 : S;
[[group(0), binding(1)]] var t0 : texture_2d<f32>;
@group(0) @binding(1) var t0 : texture_2d<f32>;
[[group(1), binding(1)]] var t1 : texture_2d<f32>;
@group(1) @binding(1) var t1 : texture_2d<f32>;
[[group(2), binding(1)]] var t2 : texture_2d<f32>;
@group(2) @binding(1) var t2 : texture_2d<f32>;
[[group(3), binding(1)]] var t3 : texture_2d<f32>;
@group(3) @binding(1) var t3 : texture_2d<f32>;
[[group(4), binding(1)]] var t4 : texture_2d<f32>;
@group(4) @binding(1) var t4 : texture_2d<f32>;
[[group(5), binding(1)]] var t5 : texture_2d<f32>;
@group(5) @binding(1) var t5 : texture_2d<f32>;
[[group(6), binding(1)]] var t6 : texture_2d<f32>;
@group(6) @binding(1) var t6 : texture_2d<f32>;
[[group(7), binding(1)]] var t7 : texture_2d<f32>;
@group(7) @binding(1) var t7 : texture_2d<f32>;
[[group(8), binding(200)]] var t8 : texture_depth_2d;
@group(8) @binding(200) var t8 : texture_depth_2d;
[[group(9), binding(200)]] var t9 : texture_depth_2d;
@group(9) @binding(200) var t9 : texture_depth_2d;
[[group(10), binding(200)]] var t10 : texture_depth_2d;
@group(10) @binding(200) var t10 : texture_depth_2d;
[[group(11), binding(200)]] var t11 : texture_depth_2d;
@group(11) @binding(200) var t11 : texture_depth_2d;
[[group(12), binding(200)]] var t12 : texture_depth_2d;
@group(12) @binding(200) var t12 : texture_depth_2d;
[[group(13), binding(200)]] var t13 : texture_depth_2d;
@group(13) @binding(200) var t13 : texture_depth_2d;
[[group(14), binding(200)]] var t14 : texture_depth_2d;
@group(14) @binding(200) var t14 : texture_depth_2d;
[[group(15), binding(200)]] var t15 : texture_depth_2d;
@group(15) @binding(200) var t15 : texture_depth_2d;
[[group(0), binding(200)]] var s0 : sampler;
@group(0) @binding(200) var s0 : sampler;
[[group(1), binding(200)]] var s1 : sampler;
@group(1) @binding(200) var s1 : sampler;
[[group(2), binding(200)]] var s2 : sampler;
@group(2) @binding(200) var s2 : sampler;
[[group(3), binding(200)]] var s3 : sampler;
@group(3) @binding(200) var s3 : sampler;
[[group(4), binding(200)]] var s4 : sampler;
@group(4) @binding(200) var s4 : sampler;
[[group(5), binding(200)]] var s5 : sampler;
@group(5) @binding(200) var s5 : sampler;
[[group(6), binding(200)]] var s6 : sampler;
@group(6) @binding(200) var s6 : sampler;
[[group(7), binding(200)]] var s7 : sampler;
@group(7) @binding(200) var s7 : sampler;
[[group(8), binding(300)]] var s8 : sampler_comparison;
@group(8) @binding(300) var s8 : sampler_comparison;
[[group(9), binding(300)]] var s9 : sampler_comparison;
@group(9) @binding(300) var s9 : sampler_comparison;
[[group(10), binding(300)]] var s10 : sampler_comparison;
@group(10) @binding(300) var s10 : sampler_comparison;
[[group(11), binding(300)]] var s11 : sampler_comparison;
@group(11) @binding(300) var s11 : sampler_comparison;
[[group(12), binding(300)]] var s12 : sampler_comparison;
@group(12) @binding(300) var s12 : sampler_comparison;
[[group(13), binding(300)]] var s13 : sampler_comparison;
@group(13) @binding(300) var s13 : sampler_comparison;
[[group(14), binding(300)]] var s14 : sampler_comparison;
@group(14) @binding(300) var s14 : sampler_comparison;
[[group(15), binding(300)]] var s15 : sampler_comparison;
@group(15) @binding(300) var s15 : sampler_comparison;
[[stage(fragment)]]
@stage(fragment)
fn main() {
_ = b0;
_ = b1;

View File

@@ -1,12 +1,12 @@
type RTArr = [[stride(4)]] array<f32>;
type RTArr = @stride(4) array<f32>;
type RTArr_1 = [[stride(4)]] array<f32>;
type RTArr_1 = @stride(4) array<f32>;
struct ResultMatrix {
numbers : RTArr_1;
}
type RTArr_2 = [[stride(4)]] array<f32>;
type RTArr_2 = @stride(4) array<f32>;
struct FirstMatrix {
numbers : RTArr_1;
@@ -24,13 +24,13 @@ struct Uniforms {
var<private> gl_GlobalInvocationID : vec3<u32>;
[[group(0), binding(2)]] var<storage, read_write> resultMatrix : ResultMatrix;
@group(0) @binding(2) var<storage, read_write> resultMatrix : ResultMatrix;
[[group(0), binding(0)]] var<storage, read> firstMatrix : FirstMatrix;
@group(0) @binding(0) var<storage, read> firstMatrix : FirstMatrix;
[[group(0), binding(1)]] var<storage, read> secondMatrix : SecondMatrix;
@group(0) @binding(1) var<storage, read> secondMatrix : SecondMatrix;
[[group(0), binding(3)]] var<uniform> x_46 : Uniforms;
@group(0) @binding(3) var<uniform> x_46 : Uniforms;
fn binaryOperation_f1_f1_(a : ptr<function, f32>, b : ptr<function, f32>) -> f32 {
var x_26 : f32;
@@ -69,8 +69,8 @@ fn main_1() {
return;
}
[[stage(compute), workgroup_size(1, 1, 1)]]
fn main([[builtin(global_invocation_id)]] gl_GlobalInvocationID_param : vec3<u32>) {
@stage(compute) @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) gl_GlobalInvocationID_param : vec3<u32>) {
gl_GlobalInvocationID = gl_GlobalInvocationID_param;
main_1();
}

View File

@@ -1,20 +1,20 @@
struct FragmentInput
{
[[ location( 2 ) ]] vUv : vec2<f32>;
@location(2) vUv : vec2<f32>;
};
struct FragmentOutput
{
[[ location( 0 ) ]] color : vec4<f32>;
@location(0) color : vec4<f32>;
};
[[ binding( 5 ), group( 1 ) ]] var depthMap : texture_depth_2d;
@binding(5) @group(1) var depthMap : texture_depth_2d;
[[ binding( 3 ), group( 1 ) ]] var texSampler : sampler;
@binding(3) @group(1) var texSampler : sampler;
[[stage(fragment)]]
@stage(fragment)
fn main( fIn : FragmentInput ) -> FragmentOutput
{
let sample : f32 = textureSample( depthMap , texSampler, fIn.vUv );

View File

@@ -1,18 +1,18 @@
struct FragmentInput {
[[location(2)]]
@location(2)
vUv : vec2<f32>;
}
struct FragmentOutput {
[[location(0)]]
@location(0)
color : vec4<f32>;
}
[[binding(5), group(1)]] var depthMap : texture_depth_2d;
@binding(5) @group(1) var depthMap : texture_depth_2d;
[[binding(3), group(1)]] var texSampler : sampler;
@binding(3) @group(1) var texSampler : sampler;
[[stage(fragment)]]
@stage(fragment)
fn main(fIn : FragmentInput) -> FragmentOutput {
let sample : f32 = textureSample(depthMap, texSampler, fIn.vUv);
let color : vec3<f32> = vec3<f32>(sample, sample, sample);

View File

@@ -6,8 +6,8 @@ fn Bad(index: u32, rd: vec3<f32>) -> vec3<f32> {
}
struct S { v : vec3<f32>; i : u32; };
[[binding(0), group(0)]] var<storage, read_write> io : S;
[[stage(compute), workgroup_size(1)]]
fn main([[builtin(local_invocation_index)]] idx : u32) {
@binding(0) @group(0) var<storage, read_write> io : S;
@stage(compute) @workgroup_size(1)
fn main(@builtin(local_invocation_index) idx : u32) {
io.v = Bad(io.i, io.v);
}

View File

@@ -9,9 +9,9 @@ struct S {
i : u32;
}
[[binding(0), group(0)]] var<storage, read_write> io : S;
@binding(0) @group(0) var<storage, read_write> io : S;
[[stage(compute), workgroup_size(1)]]
fn main([[builtin(local_invocation_index)]] idx : u32) {
@stage(compute) @workgroup_size(1)
fn main(@builtin(local_invocation_index) idx : u32) {
io.v = Bad(io.i, io.v);
}

View File

@@ -1,5 +1,5 @@
[[stage(fragment)]]
fn frag_main() -> [[location(0)]] vec4<f32> {
@stage(fragment)
fn frag_main() -> @location(0) vec4<f32> {
var b: f32 = 0.0;
var v: vec3<f32> = vec3<f32>(b);
return vec4<f32>(v, 1.0);

View File

@@ -1,5 +1,5 @@
[[stage(fragment)]]
fn frag_main() -> [[location(0)]] vec4<f32> {
@stage(fragment)
fn frag_main() -> @location(0) vec4<f32> {
var b : f32 = 0.0;
var v : vec3<f32> = vec3<f32>(b);
return vec4<f32>(v, 1.0);

View File

@@ -2,23 +2,23 @@
struct Constants {
zero: u32;
};
[[group(1), binding(0)]] var<uniform> constants: Constants;
@group(1) @binding(0) var<uniform> constants: Constants;
struct Result {
value: u32;
};
[[group(1), binding(1)]] var<storage, write> result: Result;
@group(1) @binding(1) var<storage, write> result: Result;
struct TestData {
data: array<atomic<i32>,3>;
};
[[group(0), binding(0)]] var<storage, read_write> s: TestData;
@group(0) @binding(0) var<storage, read_write> s: TestData;
fn runTest() -> i32 {
return atomicLoad(&s.data[(0u) + u32(constants.zero)]);
}
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
result.value = u32(runTest());
}
}

View File

@@ -2,25 +2,25 @@ struct Constants {
zero : u32;
}
[[group(1), binding(0)]] var<uniform> constants : Constants;
@group(1) @binding(0) var<uniform> constants : Constants;
struct Result {
value : u32;
}
[[group(1), binding(1)]] var<storage, write> result : Result;
@group(1) @binding(1) var<storage, write> result : Result;
struct TestData {
data : array<atomic<i32>, 3>;
}
[[group(0), binding(0)]] var<storage, read_write> s : TestData;
@group(0) @binding(0) var<storage, read_write> s : TestData;
fn runTest() -> i32 {
return atomicLoad(&(s.data[(0u + u32(constants.zero))]));
}
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
result.value = u32(runTest());
}

View File

@@ -1,19 +1,19 @@
struct Constants {
zero: u32;
};
[[group(1), binding(0)]] var<uniform> constants: Constants;
@group(1) @binding(0) var<uniform> constants: Constants;
struct Result {
value: u32;
};
[[group(1), binding(1)]] var<storage, write> result: Result;
@group(1) @binding(1) var<storage, write> result: Result;
struct S {
data: array<u32, 3>;
};
var<private> s: S;
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
s.data[constants.zero] = 0u;
}
}

View File

@@ -2,13 +2,13 @@ struct Constants {
zero : u32;
}
[[group(1), binding(0)]] var<uniform> constants : Constants;
@group(1) @binding(0) var<uniform> constants : Constants;
struct Result {
value : u32;
}
[[group(1), binding(1)]] var<storage, write> result : Result;
@group(1) @binding(1) var<storage, write> result : Result;
struct S {
data : array<u32, 3>;
@@ -16,7 +16,7 @@ struct S {
var<private> s : S;
[[stage(compute), workgroup_size(1)]]
@stage(compute) @workgroup_size(1)
fn main() {
s.data[constants.zero] = 0u;
}