From 943c410d513fcf280523cf50032abd6c735963b8 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Fri, 19 Nov 2021 17:46:13 +0000 Subject: [PATCH] GLSL: implement atomics. Bug: tint:1314 Change-Id: Ic7a88761752d2db3374be043c94f02fd20684c03 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/69560 Kokoro: Kokoro Reviewed-by: Ben Clayton Commit-Queue: Stephen White --- src/writer/glsl/generator_impl.cc | 176 +++++---------- .../glsl/generator_impl_workgroup_var_test.cc | 4 +- .../dynamic_index/read.wgsl.expected.glsl | 2 + .../read/workgroup.wgsl.expected.glsl | 12 +- .../write/workgroup.wgsl.expected.glsl | 12 +- test/bug/tint/1113.wgsl.expected.glsl | 66 +----- test/bug/tint/1121.wgsl.expected.glsl | 4 +- test/bug/tint/914.wgsl.expected.glsl | 20 +- test/bug/tint/926.wgsl.expected.glsl | 13 +- test/bug/tint/942.wgsl.expected.glsl | 13 +- test/bug/tint/943.spvasm.expected.glsl | 18 +- test/bug/tint/993.wgsl.expected.glsl | 13 +- .../gen/atomicAdd/794055.wgsl.expected.glsl | 19 +- .../gen/atomicAdd/8a199a.wgsl.expected.glsl | 24 +- .../gen/atomicAdd/d32fe4.wgsl.expected.glsl | 24 +- .../gen/atomicAdd/d5db1d.wgsl.expected.glsl | 19 +- .../gen/atomicAnd/152966.wgsl.expected.glsl | 24 +- .../gen/atomicAnd/34edd3.wgsl.expected.glsl | 19 +- .../gen/atomicAnd/45a819.wgsl.expected.glsl | 19 +- .../gen/atomicAnd/85a8d9.wgsl.expected.glsl | 24 +- .../12871c.wgsl.expected.glsl | 44 ++-- .../6673da.wgsl.expected.glsl | 44 ++-- .../89ea3b.wgsl.expected.glsl | 29 +-- .../b2ab2c.wgsl.expected.glsl | 29 +-- .../atomicExchange/0a5dca.wgsl.expected.glsl | 19 +- .../atomicExchange/d59712.wgsl.expected.glsl | 24 +- .../atomicExchange/e114ba.wgsl.expected.glsl | 19 +- .../atomicExchange/f2e22f.wgsl.expected.glsl | 24 +- .../gen/atomicLoad/0806ad.wgsl.expected.glsl | 24 +- .../gen/atomicLoad/361bf1.wgsl.expected.glsl | 19 +- .../gen/atomicLoad/afcc03.wgsl.expected.glsl | 19 +- .../gen/atomicLoad/fe6cc3.wgsl.expected.glsl | 24 +- .../gen/atomicMax/51b9be.wgsl.expected.glsl | 24 +- .../gen/atomicMax/92aa72.wgsl.expected.glsl | 24 +- .../gen/atomicMax/a89cc3.wgsl.expected.glsl | 19 +- .../gen/atomicMax/beccfc.wgsl.expected.glsl | 19 +- .../gen/atomicMin/278235.wgsl.expected.glsl | 19 +- .../gen/atomicMin/69d383.wgsl.expected.glsl | 19 +- .../gen/atomicMin/8e38dc.wgsl.expected.glsl | 24 +- .../gen/atomicMin/c67a74.wgsl.expected.glsl | 24 +- .../gen/atomicOr/5e3d61.wgsl.expected.glsl | 19 +- .../gen/atomicOr/5e95d4.wgsl.expected.glsl | 24 +- .../gen/atomicOr/8d96a0.wgsl.expected.glsl | 24 +- .../gen/atomicOr/d09248.wgsl.expected.glsl | 19 +- .../gen/atomicStore/726882.wgsl.expected.glsl | 18 +- .../gen/atomicStore/8bea94.wgsl.expected.glsl | 18 +- .../gen/atomicStore/cdc29e.wgsl.expected.glsl | 22 +- .../gen/atomicStore/d1e9a6.wgsl.expected.glsl | 22 +- .../gen/atomicSub/051100.wgsl.expected.glsl | 24 +- .../gen/atomicSub/0d26c2.wgsl.expected.glsl | 19 +- .../gen/atomicSub/15bfc9.wgsl.expected.glsl | 24 +- .../gen/atomicSub/77883a.wgsl.expected.glsl | 19 +- .../gen/atomicXor/54510e.wgsl.expected.glsl | 24 +- .../gen/atomicXor/75dc95.wgsl.expected.glsl | 19 +- .../gen/atomicXor/c1b78c.wgsl.expected.glsl | 24 +- .../gen/atomicXor/c8e6be.wgsl.expected.glsl | 19 +- .../storageBarrier/d87211.wgsl.expected.glsl | 11 +- .../a17f7f.wgsl.expected.glsl | 11 +- test/let/global/global.wgsl.expected.glsl | 11 - .../local/ptr_workgroup.wgsl.expected.glsl | 12 +- .../types/module_scope_let.wgsl.expected.glsl | 11 - .../workgroup/array.wgsl.expected.glsl | 12 +- .../workgroup/matrix.wgsl.expected.glsl | 12 +- .../workgroup/scalar.wgsl.expected.glsl | 12 +- .../workgroup/struct.wgsl.expected.glsl | 12 +- .../workgroup/vector.wgsl.expected.glsl | 12 +- .../many_workgroup_vars.wgsl.expected.glsl | 210 +++++++++--------- test/var/uses/workgroup.wgsl.expected.glsl | 34 +-- 68 files changed, 400 insertions(+), 1313 deletions(-) diff --git a/src/writer/glsl/generator_impl.cc b/src/writer/glsl/generator_impl.cc index 32b4d94ae2..824fdda763 100644 --- a/src/writer/glsl/generator_impl.cc +++ b/src/writer/glsl/generator_impl.cc @@ -607,162 +607,102 @@ bool GeneratorImpl::EmitTypeConstructor(std::ostream& out, bool GeneratorImpl::EmitWorkgroupAtomicCall(std::ostream& out, const ast::CallExpression* expr, const sem::Intrinsic* intrinsic) { - std::string result = UniqueIdentifier("atomic_result"); - - if (!intrinsic->ReturnType()->Is()) { - auto pre = line(); - if (!EmitTypeAndName(pre, intrinsic->ReturnType(), ast::StorageClass::kNone, - ast::Access::kUndefined, result)) { - return false; - } - pre << " = "; - if (!EmitZeroValue(pre, intrinsic->ReturnType())) { - return false; - } - pre << ";"; - } - auto call = [&](const char* name) { - auto pre = line(); - pre << name; - + out << name; { - ScopedParen sp(pre); + ScopedParen sp(out); for (size_t i = 0; i < expr->args.size(); i++) { auto* arg = expr->args[i]; if (i > 0) { - pre << ", "; + out << ", "; } - if (!EmitExpression(pre, arg)) { + if (!EmitExpression(out, arg)) { return false; } } - - pre << ", " << result; } - - pre << ";"; - - out << result; return true; }; switch (intrinsic->Type()) { case sem::IntrinsicType::kAtomicLoad: { - // GLSL does not have an InterlockedLoad, so we emulate it with - // InterlockedOr using 0 as the OR value - auto pre = line(); - pre << "InterlockedOr"; - { - ScopedParen sp(pre); - if (!EmitExpression(pre, expr->args[0])) { - return false; - } - pre << ", 0, " << result; - } - pre << ";"; - - out << result; - return true; - } - case sem::IntrinsicType::kAtomicStore: { - // GLSL does not have an InterlockedStore, so we emulate it with - // InterlockedExchange and discard the returned value - { // T result = 0; - auto pre = line(); - auto* value_ty = intrinsic->Parameters()[1]->Type(); - if (!EmitTypeAndName(pre, value_ty, ast::StorageClass::kNone, - ast::Access::kUndefined, result)) { - return false; - } - pre << " = "; - if (!EmitZeroValue(pre, value_ty)) { - return false; - } - pre << ";"; - } - - out << "InterlockedExchange"; + // GLSL does not have an atomicLoad, so we emulate it with + // atomicOr using 0 as the OR value + out << "atomicOr"; { ScopedParen sp(out); if (!EmitExpression(out, expr->args[0])) { return false; } - out << ", "; - if (!EmitExpression(out, expr->args[1])) { - return false; + out << ", 0"; + if (intrinsic->ReturnType()->Is()) { + out << "u"; } - out << ", " << result; } return true; } case sem::IntrinsicType::kAtomicCompareExchangeWeak: { - auto* dest = expr->args[0]; - auto* compare_value = expr->args[1]; - auto* value = expr->args[2]; - - std::string compare = UniqueIdentifier("atomic_compare_value"); - - { // T compare_value = ; - auto pre = line(); - if (!EmitTypeAndName(pre, TypeOf(compare_value), - ast::StorageClass::kNone, ast::Access::kUndefined, - compare)) { - return false; - } - pre << " = "; - if (!EmitExpression(pre, compare_value)) { - return false; - } - pre << ";"; - } - - { // InterlockedCompareExchange(dst, compare, value, result.x); - auto pre = line(); - pre << "InterlockedCompareExchange"; - { - ScopedParen sp(pre); - if (!EmitExpression(pre, dest)) { - return false; - } - pre << ", " << compare << ", "; - if (!EmitExpression(pre, value)) { - return false; - } - pre << ", " << result << ".x"; - } - pre << ";"; - } - - { // result.y = result.x == compare; - line() << result << ".y = " << result << ".x == " << compare << ";"; - } - - out << result; - return true; + return CallIntrinsicHelper( + out, expr, intrinsic, + [&](TextBuffer* b, const std::vector& params) { + { + auto pre = line(b); + if (!EmitTypeAndName(pre, intrinsic->ReturnType(), + ast::StorageClass::kNone, + ast::Access::kUndefined, "result")) { + return false; + } + pre << ";"; + } + { + auto pre = line(b); + pre << "result.x = atomicCompSwap"; + { + ScopedParen sp(pre); + pre << params[0]; + pre << ", " << params[1]; + pre << ", " << params[2]; + } + pre << ";"; + } + { + auto pre = line(b); + pre << "result.y = result.x == " << params[2] << " ? "; + if (TypeOf(expr->args[2])->Is()) { + pre << "1u : 0u;"; + } else { + pre << "1 : 0;"; + } + } + line(b) << "return result;"; + return true; + }); } case sem::IntrinsicType::kAtomicAdd: case sem::IntrinsicType::kAtomicSub: - return call("InterlockedAdd"); + return call("atomicAdd"); case sem::IntrinsicType::kAtomicMax: - return call("InterlockedMax"); + return call("atomicMax"); case sem::IntrinsicType::kAtomicMin: - return call("InterlockedMin"); + return call("atomicMin"); case sem::IntrinsicType::kAtomicAnd: - return call("InterlockedAnd"); + return call("atomicAnd"); case sem::IntrinsicType::kAtomicOr: - return call("InterlockedOr"); + return call("atomicOr"); case sem::IntrinsicType::kAtomicXor: - return call("InterlockedXor"); + return call("atomicXor"); case sem::IntrinsicType::kAtomicExchange: - return call("InterlockedExchange"); + case sem::IntrinsicType::kAtomicStore: + // GLSL does not have an atomicStore, so we emulate it with + // atomicExchange. + return call("atomicExchange"); default: break; @@ -1160,9 +1100,9 @@ bool GeneratorImpl::EmitBarrierCall(std::ostream& out, // TODO(crbug.com/tint/661): Combine sequential barriers to a single // instruction. if (intrinsic->Type() == sem::IntrinsicType::kWorkgroupBarrier) { - out << "GroupMemoryBarrierWithGroupSync()"; + out << "memoryBarrierShared()"; } else if (intrinsic->Type() == sem::IntrinsicType::kStorageBarrier) { - out << "DeviceMemoryBarrierWithGroupSync()"; + out << "memoryBarrierBuffer()"; } else { TINT_UNREACHABLE(Writer, diagnostics_) << "unexpected barrier intrinsic type " << sem::str(intrinsic->Type()); @@ -1765,7 +1705,7 @@ bool GeneratorImpl::EmitWorkgroupVariable(const sem::Variable* var) { auto* decl = var->Declaration(); auto out = line(); - out << "groupshared "; + out << "shared "; auto name = builder_.Symbols().NameFor(decl->symbol); auto* type = var->Type()->UnwrapRef(); diff --git a/src/writer/glsl/generator_impl_workgroup_var_test.cc b/src/writer/glsl/generator_impl_workgroup_var_test.cc index 40bc9c98d2..42d5d53482 100644 --- a/src/writer/glsl/generator_impl_workgroup_var_test.cc +++ b/src/writer/glsl/generator_impl_workgroup_var_test.cc @@ -36,7 +36,7 @@ TEST_F(GlslGeneratorImplTest_WorkgroupVar, Basic) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_THAT(gen.result(), HasSubstr("groupshared float wg;\n")); + EXPECT_THAT(gen.result(), HasSubstr("shared float wg;\n")); } TEST_F(GlslGeneratorImplTest_WorkgroupVar, Aliased) { @@ -52,7 +52,7 @@ TEST_F(GlslGeneratorImplTest_WorkgroupVar, Aliased) { GeneratorImpl& gen = Build(); ASSERT_TRUE(gen.Generate()) << gen.error(); - EXPECT_THAT(gen.result(), HasSubstr("groupshared float wg;\n")); + EXPECT_THAT(gen.result(), HasSubstr("shared float wg;\n")); } } // namespace diff --git a/test/buffer/uniform/dynamic_index/read.wgsl.expected.glsl b/test/buffer/uniform/dynamic_index/read.wgsl.expected.glsl index a21368d327..30c6e8f62e 100644 --- a/test/buffer/uniform/dynamic_index/read.wgsl.expected.glsl +++ b/test/buffer/uniform/dynamic_index/read.wgsl.expected.glsl @@ -33,6 +33,8 @@ void tint_symbol_inner(uint idx) { ivec2 g = s.arr[idx].g; ivec2 h = s.arr[idx].h; mat2x3 i = s.arr[idx].i; + mat3x2 j = s.arr[idx].j; + ivec4 k[4] = s.arr[idx].k; } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; diff --git a/test/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.glsl b/test/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.glsl index c1acee0839..517ad2e7c3 100644 --- a/test/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.glsl +++ b/test/bug/fxc/dyn_array_idx/read/workgroup.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -15,7 +13,7 @@ struct S { layout (binding = 1) buffer Result_1 { int tint_symbol; } result; -groupshared S s; +shared S s; struct tint_symbol_2 { uint local_invocation_index; @@ -28,7 +26,7 @@ void f_inner(uint local_invocation_index) { s.data[i] = 0; } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); result.tint_symbol = s.data[ubo.dynamic_idx]; } @@ -44,9 +42,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:16: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.glsl b/test/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.glsl index c56168834d..e28fc0b6bc 100644 --- a/test/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.glsl +++ b/test/bug/fxc/dyn_array_idx/write/workgroup.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -15,7 +13,7 @@ struct S { layout (binding = 1) buffer Result_1 { int tint_symbol; } result; -groupshared S s; +shared S s; struct tint_symbol_2 { uint local_invocation_index; @@ -28,7 +26,7 @@ void f_inner(uint local_invocation_index) { s.data[i] = 0; } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); s.data[ubo.dynamic_idx] = 1; result.tint_symbol = s.data[3]; } @@ -45,9 +43,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:16: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/bug/tint/1113.wgsl.expected.glsl b/test/bug/tint/1113.wgsl.expected.glsl index 0aeef4e9ac..07877d9003 100644 --- a/test/bug/tint/1113.wgsl.expected.glsl +++ b/test/bug/tint/1113.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -64,14 +62,10 @@ vec3 loadPosition(uint vertexIndex) { void doIgnore() { uint g42 = uniforms.numTriangles; uint kj6 = dbg.value1; - uint atomic_result = 0u; - InterlockedOr(counters.values[0], 0, atomic_result); - uint b53 = atomic_result; + uint b53 = atomicOr(counters.values[0], 0u); uint rwg = indices.values[0]; float rb5 = positions.values[0]; - int atomic_result_1 = 0; - InterlockedOr(LUT.values[0], 0, atomic_result_1); - int g55 = atomic_result_1; + int g55 = atomicOr(LUT.values[0], 0); } struct tint_symbol_1 { @@ -93,9 +87,7 @@ void main_count_inner(uvec3 GlobalInvocationID) { vec3 center = (((p0 + p1) + p2) / 3.0f); vec3 voxelPos = toVoxelPos(center); uint voxelIndex = toIndex1D(uniforms.gridSize, voxelPos); - uint atomic_result_2 = 0u; - InterlockedAdd(counters.values[voxelIndex], 1u, atomic_result_2); - uint acefg = atomic_result_2; + uint acefg = atomicAdd(counters.values[voxelIndex], 1u); if ((triangleIndex == 0u)) { dbg.value0 = uniforms.gridSize; dbg.value_f32_0 = center.x; @@ -123,13 +115,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:66: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:66: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -172,14 +157,10 @@ layout (binding = 50) buffer Dbg_1 { void doIgnore() { uint g42 = uniforms.numTriangles; uint kj6 = dbg.value1; - uint atomic_result = 0u; - InterlockedOr(counters.values[0], 0, atomic_result); - uint b53 = atomic_result; + uint b53 = atomicOr(counters.values[0], 0u); uint rwg = indices.values[0]; float rb5 = positions.values[0]; - int atomic_result_1 = 0; - InterlockedOr(LUT.values[0], 0, atomic_result_1); - int g55 = atomic_result_1; + int g55 = atomicOr(LUT.values[0], 0); } struct tint_symbol_1 { @@ -196,17 +177,12 @@ void main_create_lut_inner(uvec3 GlobalInvocationID) { if ((voxelIndex >= maxVoxels)) { return; } - uint atomic_result_2 = 0u; - InterlockedOr(counters.values[voxelIndex], 0, atomic_result_2); - uint numTriangles = atomic_result_2; + uint numTriangles = atomicOr(counters.values[voxelIndex], 0u); int offset = -1; if ((numTriangles > 0u)) { - uint atomic_result_3 = 0u; - InterlockedAdd(dbg.offsetCounter, numTriangles, atomic_result_3); - offset = int(atomic_result_3); + offset = int(atomicAdd(dbg.offsetCounter, numTriangles)); } - int atomic_result_4 = 0; - InterlockedExchange(LUT.values[voxelIndex], offset, atomic_result_4); + atomicExchange(LUT.values[voxelIndex], offset); } struct tint_symbol_5 { @@ -225,13 +201,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:44: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:44: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -296,14 +265,10 @@ vec3 loadPosition(uint vertexIndex) { void doIgnore() { uint g42 = uniforms.numTriangles; uint kj6 = dbg.value1; - uint atomic_result = 0u; - InterlockedOr(counters.values[0], 0, atomic_result); - uint b53 = atomic_result; + uint b53 = atomicOr(counters.values[0], 0u); uint rwg = indices.values[0]; float rb5 = positions.values[0]; - int atomic_result_1 = 0; - InterlockedOr(LUT.values[0], 0, atomic_result_1); - int g55 = atomic_result_1; + int g55 = atomicOr(LUT.values[0], 0); } struct tint_symbol_1 { @@ -331,9 +296,7 @@ void main_sort_triangles_inner(uvec3 GlobalInvocationID) { vec3 center = (((p0 + p1) + p2) / 3.0f); vec3 voxelPos = toVoxelPos(center); uint voxelIndex = toIndex1D(uniforms.gridSize, voxelPos); - int atomic_result_2 = 0; - InterlockedAdd(LUT.values[voxelIndex], 1, atomic_result_2); - int triangleOffset = atomic_result_2; + int triangleOffset = atomicAdd(LUT.values[voxelIndex], 1); } layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in; @@ -348,10 +311,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:66: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:66: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/bug/tint/1121.wgsl.expected.glsl b/test/bug/tint/1121.wgsl.expected.glsl index 5dd520f165..1dad2dbcf2 100644 --- a/test/bug/tint/1121.wgsl.expected.glsl +++ b/test/bug/tint/1121.wgsl.expected.glsl @@ -111,9 +111,7 @@ void tint_symbol_2_inner(uvec3 GlobalInvocationID) { if ((tint_tmp)) { continue; } - uint atomic_result = 0u; - InterlockedAdd(tileLightId.data[tileId].count, 1u, atomic_result); - uint offset = atomic_result; + uint offset = atomicAdd(tileLightId.data[tileId].count, 1u); if ((offset >= config.numTileLightSlot)) { continue; } diff --git a/test/bug/tint/914.wgsl.expected.glsl b/test/bug/tint/914.wgsl.expected.glsl index 026388eb24..951dea5dbf 100644 --- a/test/bug/tint/914.wgsl.expected.glsl +++ b/test/bug/tint/914.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -56,11 +54,9 @@ void mm_write(uint row, uint col, float value) { const uint RowPerThread = 4u; const uint ColPerThread = 4u; -const uint TileAOuter = 64u; -const uint TileBOuter = 64u; const uint TileInner = 64u; -groupshared float mm_Asub[64][64]; -groupshared float mm_Bsub[64][64]; +shared float mm_Asub[64][64]; +shared float mm_Bsub[64][64]; struct tint_symbol_2 { uvec3 local_id; @@ -77,7 +73,7 @@ void tint_symbol_inner(uvec3 local_id, uvec3 global_id, uint local_invocation_in mm_Bsub[i][i_1] = 0.0f; } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); uint tileRow = (local_id.y * RowPerThread); uint tileCol = (local_id.x * ColPerThread); uint globalRow = (global_id.y * RowPerThread); @@ -119,7 +115,7 @@ void tint_symbol_inner(uvec3 local_id, uvec3 global_id, uint local_invocation_in } } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); { for(uint k = 0u; (k < TileInner); k = (k + 1u)) { { @@ -140,7 +136,7 @@ void tint_symbol_inner(uvec3 local_id, uvec3 global_id, uint local_invocation_in } } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); } } { @@ -169,9 +165,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:60: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/bug/tint/926.wgsl.expected.glsl b/test/bug/tint/926.wgsl.expected.glsl index e1fb812f19..c54318df46 100644 --- a/test/bug/tint/926.wgsl.expected.glsl +++ b/test/bug/tint/926.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -14,9 +12,7 @@ struct tint_symbol_1 { }; void computeMain_inner(uvec3 global_id) { - uint atomic_result = 0u; - InterlockedAdd(drawOut.vertexCount, cubeVerts, atomic_result); - uint firstVertex = atomic_result; + uint firstVertex = atomicAdd(drawOut.vertexCount, cubeVerts); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -31,10 +27,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:16: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:16: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/bug/tint/942.wgsl.expected.glsl b/test/bug/tint/942.wgsl.expected.glsl index a011f7e5f0..464422e63f 100644 --- a/test/bug/tint/942.wgsl.expected.glsl +++ b/test/bug/tint/942.wgsl.expected.glsl @@ -15,7 +15,7 @@ uniform highp writeonly image2D outputTex; layout (binding = 3) uniform Flip_1 { uint value; } flip; -groupshared vec3 tile[4][256]; +shared vec3 tile[4][256]; struct tint_symbol_2 { uvec3 LocalInvocationID; @@ -31,7 +31,7 @@ void tint_symbol_inner(uvec3 WorkGroupID, uvec3 LocalInvocationID, uint local_in tile[i_1][i_2] = vec3(0.0f, 0.0f, 0.0f); } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); uint filterOffset = ((params.filterDim - 1u) / 2u); ivec2 dims = textureSize(inputTex0); ivec2 baseIndex = (ivec2(((WorkGroupID.xy * uvec2(params.blockDim, 4u)) + (LocalInvocationID.xy * uvec2(4u, 1u)))) - ivec2(int(filterOffset), 0)); @@ -48,7 +48,7 @@ void tint_symbol_inner(uvec3 WorkGroupID, uvec3 LocalInvocationID, uint local_in } } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); { for(uint r = 0u; (r < 4u); r = (r + 1u)) { { @@ -97,8 +97,11 @@ void main() { Error parsing GLSL shader: -ERROR: 0:16: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. +ERROR: 0:34: 'inputTex0' : undeclared identifier +ERROR: 0:34: 'textureSize' : no matching overloaded function found +ERROR: 0:34: '=' : cannot convert from ' const float' to ' temp highp 2-component vector of int' +ERROR: 0:34: '' : compilation terminated +ERROR: 4 compilation errors. No code generated. diff --git a/test/bug/tint/943.spvasm.expected.glsl b/test/bug/tint/943.spvasm.expected.glsl index 1ae68446a7..f04b212848 100644 --- a/test/bug/tint/943.spvasm.expected.glsl +++ b/test/bug/tint/943.spvasm.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -19,8 +17,8 @@ layout (binding = 0) buffer ssbOut_1 { } x_54; uvec3 tint_symbol = uvec3(0u, 0u, 0u); uvec3 tint_symbol_1 = uvec3(0u, 0u, 0u); -groupshared float mm_Asub[64][64]; -groupshared float mm_Bsub[64][1]; +shared float mm_Asub[64][64]; +shared float mm_Bsub[64][1]; layout (binding = 1) buffer ssbA_1 { float A[]; } x_165; @@ -258,7 +256,7 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB } } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); k = 0; { for(; (k < 64); k = (k + 1)) { @@ -290,7 +288,7 @@ void mm_matMul_i1_i1_i1_(inout int dimAOuter, inout int dimInner, inout int dimB } } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); } } innerRow_4 = 0; @@ -374,7 +372,7 @@ void tint_symbol_2_inner(uvec3 tint_symbol_3, uvec3 tint_symbol_4, uint local_in mm_Asub[i][i_1] = 0.0f; } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); tint_symbol = tint_symbol_3; tint_symbol_1 = tint_symbol_4; main_1(); @@ -394,9 +392,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:20: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/bug/tint/993.wgsl.expected.glsl b/test/bug/tint/993.wgsl.expected.glsl index 685ccded10..e0485c5142 100644 --- a/test/bug/tint/993.wgsl.expected.glsl +++ b/test/bug/tint/993.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -17,9 +15,7 @@ layout (binding = 0) buffer TestData_1 { } s; int runTest() { - int atomic_result = 0; - InterlockedOr(s.data[(0u + uint(constants.zero))], 0, atomic_result); - return atomic_result; + return atomicOr(s.data[(0u + uint(constants.zero))], 0); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -32,10 +28,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:19: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:19: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicAdd/794055.wgsl.expected.glsl b/test/intrinsics/gen/atomicAdd/794055.wgsl.expected.glsl index cc143ec6fd..55ffa257a7 100644 --- a/test/intrinsics/gen/atomicAdd/794055.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicAdd/794055.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicAdd_794055() { - int atomic_result = 0; - InterlockedAdd(arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAdd(arg_0, 1); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicAdd_794055(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicAdd/8a199a.wgsl.expected.glsl b/test/intrinsics/gen/atomicAdd/8a199a.wgsl.expected.glsl index 139df57fe7..f2dd43a8b7 100644 --- a/test/intrinsics/gen/atomicAdd/8a199a.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicAdd/8a199a.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicAdd_8a199a() { - uint atomic_result = 0u; - InterlockedAdd(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAdd(sb_rw.arg_0, 1u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicAdd_8a199a() { - uint atomic_result = 0u; - InterlockedAdd(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAdd(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicAdd/d32fe4.wgsl.expected.glsl b/test/intrinsics/gen/atomicAdd/d32fe4.wgsl.expected.glsl index e157ee3e48..a324c7aeed 100644 --- a/test/intrinsics/gen/atomicAdd/d32fe4.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicAdd/d32fe4.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicAdd_d32fe4() { - int atomic_result = 0; - InterlockedAdd(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAdd(sb_rw.arg_0, 1); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicAdd_d32fe4() { - int atomic_result = 0; - InterlockedAdd(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAdd(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicAdd/d5db1d.wgsl.expected.glsl b/test/intrinsics/gen/atomicAdd/d5db1d.wgsl.expected.glsl index 1c43164fd6..9a3d9a1226 100644 --- a/test/intrinsics/gen/atomicAdd/d5db1d.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicAdd/d5db1d.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicAdd_d5db1d() { - uint atomic_result = 0u; - InterlockedAdd(arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAdd(arg_0, 1u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicAdd_d5db1d(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicAnd/152966.wgsl.expected.glsl b/test/intrinsics/gen/atomicAnd/152966.wgsl.expected.glsl index 813e5218db..a4c446d4d5 100644 --- a/test/intrinsics/gen/atomicAnd/152966.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicAnd/152966.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicAnd_152966() { - int atomic_result = 0; - InterlockedAnd(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAnd(sb_rw.arg_0, 1); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAnd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicAnd_152966() { - int atomic_result = 0; - InterlockedAnd(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAnd(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAnd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicAnd/34edd3.wgsl.expected.glsl b/test/intrinsics/gen/atomicAnd/34edd3.wgsl.expected.glsl index 05f66bbb6b..8ab60de264 100644 --- a/test/intrinsics/gen/atomicAnd/34edd3.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicAnd/34edd3.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicAnd_34edd3() { - uint atomic_result = 0u; - InterlockedAnd(arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAnd(arg_0, 1u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicAnd_34edd3(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicAnd/45a819.wgsl.expected.glsl b/test/intrinsics/gen/atomicAnd/45a819.wgsl.expected.glsl index 10635fb42f..af28d896e8 100644 --- a/test/intrinsics/gen/atomicAnd/45a819.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicAnd/45a819.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicAnd_45a819() { - int atomic_result = 0; - InterlockedAnd(arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAnd(arg_0, 1); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicAnd_45a819(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicAnd/85a8d9.wgsl.expected.glsl b/test/intrinsics/gen/atomicAnd/85a8d9.wgsl.expected.glsl index 50f0b04b58..c7c96012b9 100644 --- a/test/intrinsics/gen/atomicAnd/85a8d9.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicAnd/85a8d9.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicAnd_85a8d9() { - uint atomic_result = 0u; - InterlockedAnd(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAnd(sb_rw.arg_0, 1u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAnd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicAnd_85a8d9() { - uint atomic_result = 0u; - InterlockedAnd(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAnd(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAnd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicCompareExchangeWeak/12871c.wgsl.expected.glsl b/test/intrinsics/gen/atomicCompareExchangeWeak/12871c.wgsl.expected.glsl index f15fa37601..93d6d9eafe 100644 --- a/test/intrinsics/gen/atomicCompareExchangeWeak/12871c.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicCompareExchangeWeak/12871c.wgsl.expected.glsl @@ -1,19 +1,21 @@ -SKIP: FAILED - #version 310 es precision mediump float; +ivec2 tint_atomicCompareExchangeWeak(inout int param_0, int param_1, int param_2) { + ivec2 result; + result.x = atomicCompSwap(param_0, param_1, param_2); + result.y = result.x == param_2 ? 1 : 0; + return result; +} + + layout (binding = 0) buffer SB_RW_1 { int arg_0; } sb_rw; void atomicCompareExchangeWeak_12871c() { - ivec2 atomic_result = ivec2(0, 0); - int atomic_compare_value = 1; - InterlockedCompareExchange(sb_rw.arg_0, atomic_compare_value, 1, atomic_result.x); - atomic_result.y = atomic_result.x == atomic_compare_value; - ivec2 res = atomic_result; + ivec2 res = tint_atomicCompareExchangeWeak(sb_rw.arg_0, 1, 1); } void fragment_main() { @@ -25,27 +27,24 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:12: 'InterlockedCompareExchange' : no matching overloaded function found -ERROR: 0:12: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; +ivec2 tint_atomicCompareExchangeWeak(inout int param_0, int param_1, int param_2) { + ivec2 result; + result.x = atomicCompSwap(param_0, param_1, param_2); + result.y = result.x == param_2 ? 1 : 0; + return result; +} + + layout (binding = 0) buffer SB_RW_1 { int arg_0; } sb_rw; void atomicCompareExchangeWeak_12871c() { - ivec2 atomic_result = ivec2(0, 0); - int atomic_compare_value = 1; - InterlockedCompareExchange(sb_rw.arg_0, atomic_compare_value, 1, atomic_result.x); - atomic_result.y = atomic_result.x == atomic_compare_value; - ivec2 res = atomic_result; + ivec2 res = tint_atomicCompareExchangeWeak(sb_rw.arg_0, 1, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -58,10 +57,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:12: 'InterlockedCompareExchange' : no matching overloaded function found -ERROR: 0:12: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicCompareExchangeWeak/6673da.wgsl.expected.glsl b/test/intrinsics/gen/atomicCompareExchangeWeak/6673da.wgsl.expected.glsl index f1cde2476d..72a7f09cda 100644 --- a/test/intrinsics/gen/atomicCompareExchangeWeak/6673da.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicCompareExchangeWeak/6673da.wgsl.expected.glsl @@ -1,19 +1,21 @@ -SKIP: FAILED - #version 310 es precision mediump float; +uvec2 tint_atomicCompareExchangeWeak(inout uint param_0, uint param_1, uint param_2) { + uvec2 result; + result.x = atomicCompSwap(param_0, param_1, param_2); + result.y = result.x == param_2 ? 1u : 0u; + return result; +} + + layout (binding = 0) buffer SB_RW_1 { uint arg_0; } sb_rw; void atomicCompareExchangeWeak_6673da() { - uvec2 atomic_result = uvec2(0u, 0u); - uint atomic_compare_value = 1u; - InterlockedCompareExchange(sb_rw.arg_0, atomic_compare_value, 1u, atomic_result.x); - atomic_result.y = atomic_result.x == atomic_compare_value; - uvec2 res = atomic_result; + uvec2 res = tint_atomicCompareExchangeWeak(sb_rw.arg_0, 1u, 1u); } void fragment_main() { @@ -25,27 +27,24 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:12: 'InterlockedCompareExchange' : no matching overloaded function found -ERROR: 0:12: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; +uvec2 tint_atomicCompareExchangeWeak(inout uint param_0, uint param_1, uint param_2) { + uvec2 result; + result.x = atomicCompSwap(param_0, param_1, param_2); + result.y = result.x == param_2 ? 1u : 0u; + return result; +} + + layout (binding = 0) buffer SB_RW_1 { uint arg_0; } sb_rw; void atomicCompareExchangeWeak_6673da() { - uvec2 atomic_result = uvec2(0u, 0u); - uint atomic_compare_value = 1u; - InterlockedCompareExchange(sb_rw.arg_0, atomic_compare_value, 1u, atomic_result.x); - atomic_result.y = atomic_result.x == atomic_compare_value; - uvec2 res = atomic_result; + uvec2 res = tint_atomicCompareExchangeWeak(sb_rw.arg_0, 1u, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -58,10 +57,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:12: 'InterlockedCompareExchange' : no matching overloaded function found -ERROR: 0:12: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicCompareExchangeWeak/89ea3b.wgsl.expected.glsl b/test/intrinsics/gen/atomicCompareExchangeWeak/89ea3b.wgsl.expected.glsl index 9760452bd9..aaaf1776d2 100644 --- a/test/intrinsics/gen/atomicCompareExchangeWeak/89ea3b.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicCompareExchangeWeak/89ea3b.wgsl.expected.glsl @@ -1,16 +1,18 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +ivec2 tint_atomicCompareExchangeWeak(inout int param_0, int param_1, int param_2) { + ivec2 result; + result.x = atomicCompSwap(param_0, param_1, param_2); + result.y = result.x == param_2 ? 1 : 0; + return result; +} + + +shared int arg_0; void atomicCompareExchangeWeak_89ea3b() { - ivec2 atomic_result = ivec2(0, 0); - int atomic_compare_value = 1; - InterlockedCompareExchange(arg_0, atomic_compare_value, 1, atomic_result.x); - atomic_result.y = atomic_result.x == atomic_compare_value; - ivec2 res = atomic_result; + ivec2 res = tint_atomicCompareExchangeWeak(arg_0, 1, 1); } struct tint_symbol_1 { @@ -19,10 +21,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicCompareExchangeWeak_89ea3b(); } @@ -38,9 +39,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicCompareExchangeWeak/b2ab2c.wgsl.expected.glsl b/test/intrinsics/gen/atomicCompareExchangeWeak/b2ab2c.wgsl.expected.glsl index be102ee99e..03b6857849 100644 --- a/test/intrinsics/gen/atomicCompareExchangeWeak/b2ab2c.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicCompareExchangeWeak/b2ab2c.wgsl.expected.glsl @@ -1,16 +1,18 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +uvec2 tint_atomicCompareExchangeWeak(inout uint param_0, uint param_1, uint param_2) { + uvec2 result; + result.x = atomicCompSwap(param_0, param_1, param_2); + result.y = result.x == param_2 ? 1u : 0u; + return result; +} + + +shared uint arg_0; void atomicCompareExchangeWeak_b2ab2c() { - uvec2 atomic_result = uvec2(0u, 0u); - uint atomic_compare_value = 1u; - InterlockedCompareExchange(arg_0, atomic_compare_value, 1u, atomic_result.x); - atomic_result.y = atomic_result.x == atomic_compare_value; - uvec2 res = atomic_result; + uvec2 res = tint_atomicCompareExchangeWeak(arg_0, 1u, 1u); } struct tint_symbol_1 { @@ -19,10 +21,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicCompareExchangeWeak_b2ab2c(); } @@ -38,9 +39,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicExchange/0a5dca.wgsl.expected.glsl b/test/intrinsics/gen/atomicExchange/0a5dca.wgsl.expected.glsl index 8b094238b8..c97fd12719 100644 --- a/test/intrinsics/gen/atomicExchange/0a5dca.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicExchange/0a5dca.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicExchange_0a5dca() { - uint atomic_result = 0u; - InterlockedExchange(arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicExchange(arg_0, 1u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicExchange_0a5dca(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicExchange/d59712.wgsl.expected.glsl b/test/intrinsics/gen/atomicExchange/d59712.wgsl.expected.glsl index 7e1913c52a..a4f0b7f6aa 100644 --- a/test/intrinsics/gen/atomicExchange/d59712.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicExchange/d59712.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicExchange_d59712() { - uint atomic_result = 0u; - InterlockedExchange(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicExchange(sb_rw.arg_0, 1u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedExchange' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicExchange_d59712() { - uint atomic_result = 0u; - InterlockedExchange(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicExchange(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedExchange' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicExchange/e114ba.wgsl.expected.glsl b/test/intrinsics/gen/atomicExchange/e114ba.wgsl.expected.glsl index d847eaf1ac..52ae007ff8 100644 --- a/test/intrinsics/gen/atomicExchange/e114ba.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicExchange/e114ba.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicExchange_e114ba() { - int atomic_result = 0; - InterlockedExchange(arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicExchange(arg_0, 1); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicExchange_e114ba(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicExchange/f2e22f.wgsl.expected.glsl b/test/intrinsics/gen/atomicExchange/f2e22f.wgsl.expected.glsl index f777a170f4..bc0e46e286 100644 --- a/test/intrinsics/gen/atomicExchange/f2e22f.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicExchange/f2e22f.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicExchange_f2e22f() { - int atomic_result = 0; - InterlockedExchange(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicExchange(sb_rw.arg_0, 1); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedExchange' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicExchange_f2e22f() { - int atomic_result = 0; - InterlockedExchange(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicExchange(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedExchange' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicLoad/0806ad.wgsl.expected.glsl b/test/intrinsics/gen/atomicLoad/0806ad.wgsl.expected.glsl index 2f8cb3d7d2..68355ced02 100644 --- a/test/intrinsics/gen/atomicLoad/0806ad.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicLoad/0806ad.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicLoad_0806ad() { - int atomic_result = 0; - InterlockedOr(sb_rw.arg_0, 0, atomic_result); - int res = atomic_result; + int res = atomicOr(sb_rw.arg_0, 0); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicLoad_0806ad() { - int atomic_result = 0; - InterlockedOr(sb_rw.arg_0, 0, atomic_result); - int res = atomic_result; + int res = atomicOr(sb_rw.arg_0, 0); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicLoad/361bf1.wgsl.expected.glsl b/test/intrinsics/gen/atomicLoad/361bf1.wgsl.expected.glsl index e0c94f0931..de8c6c6d28 100644 --- a/test/intrinsics/gen/atomicLoad/361bf1.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicLoad/361bf1.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicLoad_361bf1() { - uint atomic_result = 0u; - InterlockedOr(arg_0, 0, atomic_result); - uint res = atomic_result; + uint res = atomicOr(arg_0, 0u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicLoad_361bf1(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicLoad/afcc03.wgsl.expected.glsl b/test/intrinsics/gen/atomicLoad/afcc03.wgsl.expected.glsl index 74351a3853..3f9ee82718 100644 --- a/test/intrinsics/gen/atomicLoad/afcc03.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicLoad/afcc03.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicLoad_afcc03() { - int atomic_result = 0; - InterlockedOr(arg_0, 0, atomic_result); - int res = atomic_result; + int res = atomicOr(arg_0, 0); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicLoad_afcc03(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicLoad/fe6cc3.wgsl.expected.glsl b/test/intrinsics/gen/atomicLoad/fe6cc3.wgsl.expected.glsl index 7fc06238f0..373dafa205 100644 --- a/test/intrinsics/gen/atomicLoad/fe6cc3.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicLoad/fe6cc3.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicLoad_fe6cc3() { - uint atomic_result = 0u; - InterlockedOr(sb_rw.arg_0, 0, atomic_result); - uint res = atomic_result; + uint res = atomicOr(sb_rw.arg_0, 0u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicLoad_fe6cc3() { - uint atomic_result = 0u; - InterlockedOr(sb_rw.arg_0, 0, atomic_result); - uint res = atomic_result; + uint res = atomicOr(sb_rw.arg_0, 0u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicMax/51b9be.wgsl.expected.glsl b/test/intrinsics/gen/atomicMax/51b9be.wgsl.expected.glsl index 4a35e2cbb1..e95789e099 100644 --- a/test/intrinsics/gen/atomicMax/51b9be.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicMax/51b9be.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicMax_51b9be() { - uint atomic_result = 0u; - InterlockedMax(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicMax(sb_rw.arg_0, 1u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedMax' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicMax_51b9be() { - uint atomic_result = 0u; - InterlockedMax(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicMax(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedMax' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicMax/92aa72.wgsl.expected.glsl b/test/intrinsics/gen/atomicMax/92aa72.wgsl.expected.glsl index 5c77b71251..f5392cfdcb 100644 --- a/test/intrinsics/gen/atomicMax/92aa72.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicMax/92aa72.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicMax_92aa72() { - int atomic_result = 0; - InterlockedMax(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicMax(sb_rw.arg_0, 1); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedMax' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicMax_92aa72() { - int atomic_result = 0; - InterlockedMax(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicMax(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedMax' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicMax/a89cc3.wgsl.expected.glsl b/test/intrinsics/gen/atomicMax/a89cc3.wgsl.expected.glsl index 526868b17d..8a4aaddc15 100644 --- a/test/intrinsics/gen/atomicMax/a89cc3.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicMax/a89cc3.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicMax_a89cc3() { - int atomic_result = 0; - InterlockedMax(arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicMax(arg_0, 1); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicMax_a89cc3(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicMax/beccfc.wgsl.expected.glsl b/test/intrinsics/gen/atomicMax/beccfc.wgsl.expected.glsl index e34d9e952c..085ee2eca4 100644 --- a/test/intrinsics/gen/atomicMax/beccfc.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicMax/beccfc.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicMax_beccfc() { - uint atomic_result = 0u; - InterlockedMax(arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicMax(arg_0, 1u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicMax_beccfc(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicMin/278235.wgsl.expected.glsl b/test/intrinsics/gen/atomicMin/278235.wgsl.expected.glsl index cf4724c99a..a3e2d3be12 100644 --- a/test/intrinsics/gen/atomicMin/278235.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicMin/278235.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicMin_278235() { - int atomic_result = 0; - InterlockedMin(arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicMin(arg_0, 1); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicMin_278235(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicMin/69d383.wgsl.expected.glsl b/test/intrinsics/gen/atomicMin/69d383.wgsl.expected.glsl index ade228014f..10e70a6293 100644 --- a/test/intrinsics/gen/atomicMin/69d383.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicMin/69d383.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicMin_69d383() { - uint atomic_result = 0u; - InterlockedMin(arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicMin(arg_0, 1u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicMin_69d383(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicMin/8e38dc.wgsl.expected.glsl b/test/intrinsics/gen/atomicMin/8e38dc.wgsl.expected.glsl index da27730785..089703221e 100644 --- a/test/intrinsics/gen/atomicMin/8e38dc.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicMin/8e38dc.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicMin_8e38dc() { - int atomic_result = 0; - InterlockedMin(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicMin(sb_rw.arg_0, 1); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedMin' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicMin_8e38dc() { - int atomic_result = 0; - InterlockedMin(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicMin(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedMin' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicMin/c67a74.wgsl.expected.glsl b/test/intrinsics/gen/atomicMin/c67a74.wgsl.expected.glsl index 719cf8eb15..85e42ddc15 100644 --- a/test/intrinsics/gen/atomicMin/c67a74.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicMin/c67a74.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicMin_c67a74() { - uint atomic_result = 0u; - InterlockedMin(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicMin(sb_rw.arg_0, 1u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedMin' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicMin_c67a74() { - uint atomic_result = 0u; - InterlockedMin(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicMin(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedMin' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicOr/5e3d61.wgsl.expected.glsl b/test/intrinsics/gen/atomicOr/5e3d61.wgsl.expected.glsl index 6638375ad0..9fd6dfba54 100644 --- a/test/intrinsics/gen/atomicOr/5e3d61.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicOr/5e3d61.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicOr_5e3d61() { - uint atomic_result = 0u; - InterlockedOr(arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicOr(arg_0, 1u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicOr_5e3d61(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicOr/5e95d4.wgsl.expected.glsl b/test/intrinsics/gen/atomicOr/5e95d4.wgsl.expected.glsl index 85663d2924..aafb344871 100644 --- a/test/intrinsics/gen/atomicOr/5e95d4.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicOr/5e95d4.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicOr_5e95d4() { - uint atomic_result = 0u; - InterlockedOr(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicOr(sb_rw.arg_0, 1u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicOr_5e95d4() { - uint atomic_result = 0u; - InterlockedOr(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicOr(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicOr/8d96a0.wgsl.expected.glsl b/test/intrinsics/gen/atomicOr/8d96a0.wgsl.expected.glsl index 9996d052e5..b5f1e995ea 100644 --- a/test/intrinsics/gen/atomicOr/8d96a0.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicOr/8d96a0.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicOr_8d96a0() { - int atomic_result = 0; - InterlockedOr(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicOr(sb_rw.arg_0, 1); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicOr_8d96a0() { - int atomic_result = 0; - InterlockedOr(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicOr(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedOr' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicOr/d09248.wgsl.expected.glsl b/test/intrinsics/gen/atomicOr/d09248.wgsl.expected.glsl index 239746dcc6..1bd396d099 100644 --- a/test/intrinsics/gen/atomicOr/d09248.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicOr/d09248.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicOr_d09248() { - int atomic_result = 0; - InterlockedOr(arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicOr(arg_0, 1); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicOr_d09248(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicStore/726882.wgsl.expected.glsl b/test/intrinsics/gen/atomicStore/726882.wgsl.expected.glsl index 29aec50fff..1539167b34 100644 --- a/test/intrinsics/gen/atomicStore/726882.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicStore/726882.wgsl.expected.glsl @@ -1,13 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicStore_726882() { - uint atomic_result = 0u; - InterlockedExchange(arg_0, 1u, atomic_result); + atomicExchange(arg_0, 1u); } struct tint_symbol_1 { @@ -16,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicStore_726882(); } @@ -35,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicStore/8bea94.wgsl.expected.glsl b/test/intrinsics/gen/atomicStore/8bea94.wgsl.expected.glsl index cd08ad30da..d338acca00 100644 --- a/test/intrinsics/gen/atomicStore/8bea94.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicStore/8bea94.wgsl.expected.glsl @@ -1,13 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicStore_8bea94() { - int atomic_result = 0; - InterlockedExchange(arg_0, 1, atomic_result); + atomicExchange(arg_0, 1); } struct tint_symbol_1 { @@ -16,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicStore_8bea94(); } @@ -35,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicStore/cdc29e.wgsl.expected.glsl b/test/intrinsics/gen/atomicStore/cdc29e.wgsl.expected.glsl index 1f768b3450..e81b3564f8 100644 --- a/test/intrinsics/gen/atomicStore/cdc29e.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicStore/cdc29e.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,8 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicStore_cdc29e() { - uint atomic_result = 0u; - InterlockedExchange(sb_rw.arg_0, 1u, atomic_result); + atomicExchange(sb_rw.arg_0, 1u); } void fragment_main() { @@ -22,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedExchange' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -38,8 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicStore_cdc29e() { - uint atomic_result = 0u; - InterlockedExchange(sb_rw.arg_0, 1u, atomic_result); + atomicExchange(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -52,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedExchange' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicStore/d1e9a6.wgsl.expected.glsl b/test/intrinsics/gen/atomicStore/d1e9a6.wgsl.expected.glsl index 6df74dce0b..eba2fdbcc7 100644 --- a/test/intrinsics/gen/atomicStore/d1e9a6.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicStore/d1e9a6.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,8 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicStore_d1e9a6() { - int atomic_result = 0; - InterlockedExchange(sb_rw.arg_0, 1, atomic_result); + atomicExchange(sb_rw.arg_0, 1); } void fragment_main() { @@ -22,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedExchange' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -38,8 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicStore_d1e9a6() { - int atomic_result = 0; - InterlockedExchange(sb_rw.arg_0, 1, atomic_result); + atomicExchange(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -52,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedExchange' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicSub/051100.wgsl.expected.glsl b/test/intrinsics/gen/atomicSub/051100.wgsl.expected.glsl index 1da7814447..f9984be57d 100644 --- a/test/intrinsics/gen/atomicSub/051100.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicSub/051100.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicSub_051100() { - int atomic_result = 0; - InterlockedAdd(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAdd(sb_rw.arg_0, 1); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicSub_051100() { - int atomic_result = 0; - InterlockedAdd(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAdd(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicSub/0d26c2.wgsl.expected.glsl b/test/intrinsics/gen/atomicSub/0d26c2.wgsl.expected.glsl index 58896e81f2..b0bddda8d0 100644 --- a/test/intrinsics/gen/atomicSub/0d26c2.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicSub/0d26c2.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicSub_0d26c2() { - uint atomic_result = 0u; - InterlockedAdd(arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAdd(arg_0, 1u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicSub_0d26c2(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicSub/15bfc9.wgsl.expected.glsl b/test/intrinsics/gen/atomicSub/15bfc9.wgsl.expected.glsl index 13a73bc894..0f5901ca7b 100644 --- a/test/intrinsics/gen/atomicSub/15bfc9.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicSub/15bfc9.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicSub_15bfc9() { - uint atomic_result = 0u; - InterlockedAdd(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAdd(sb_rw.arg_0, 1u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicSub_15bfc9() { - uint atomic_result = 0u; - InterlockedAdd(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicAdd(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedAdd' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicSub/77883a.wgsl.expected.glsl b/test/intrinsics/gen/atomicSub/77883a.wgsl.expected.glsl index 83ef6a0f85..9c70e9930b 100644 --- a/test/intrinsics/gen/atomicSub/77883a.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicSub/77883a.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicSub_77883a() { - int atomic_result = 0; - InterlockedAdd(arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicAdd(arg_0, 1); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicSub_77883a(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicXor/54510e.wgsl.expected.glsl b/test/intrinsics/gen/atomicXor/54510e.wgsl.expected.glsl index 9e9f4ca7a8..feabaaf757 100644 --- a/test/intrinsics/gen/atomicXor/54510e.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicXor/54510e.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicXor_54510e() { - uint atomic_result = 0u; - InterlockedXor(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicXor(sb_rw.arg_0, 1u); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedXor' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicXor_54510e() { - uint atomic_result = 0u; - InterlockedXor(sb_rw.arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicXor(sb_rw.arg_0, 1u); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedXor' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicXor/75dc95.wgsl.expected.glsl b/test/intrinsics/gen/atomicXor/75dc95.wgsl.expected.glsl index 62485eda50..99173566c7 100644 --- a/test/intrinsics/gen/atomicXor/75dc95.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicXor/75dc95.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int arg_0; +shared int arg_0; void atomicXor_75dc95() { - int atomic_result = 0; - InterlockedXor(arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicXor(arg_0, 1); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - int atomic_result_1 = 0; - InterlockedExchange(arg_0, 0, atomic_result_1); + atomicExchange(arg_0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicXor_75dc95(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicXor/c1b78c.wgsl.expected.glsl b/test/intrinsics/gen/atomicXor/c1b78c.wgsl.expected.glsl index 0a43b25a36..6e8d36156f 100644 --- a/test/intrinsics/gen/atomicXor/c1b78c.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicXor/c1b78c.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -9,9 +7,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicXor_c1b78c() { - int atomic_result = 0; - InterlockedXor(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicXor(sb_rw.arg_0, 1); } void fragment_main() { @@ -23,13 +19,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedXor' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - #version 310 es precision mediump float; @@ -39,9 +28,7 @@ layout (binding = 0) buffer SB_RW_1 { } sb_rw; void atomicXor_c1b78c() { - int atomic_result = 0; - InterlockedXor(sb_rw.arg_0, 1, atomic_result); - int res = atomic_result; + int res = atomicXor(sb_rw.arg_0, 1); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -54,10 +41,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:11: 'InterlockedXor' : no matching overloaded function found -ERROR: 0:11: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/atomicXor/c8e6be.wgsl.expected.glsl b/test/intrinsics/gen/atomicXor/c8e6be.wgsl.expected.glsl index a68b9b6e3a..bcc49d9191 100644 --- a/test/intrinsics/gen/atomicXor/c8e6be.wgsl.expected.glsl +++ b/test/intrinsics/gen/atomicXor/c8e6be.wgsl.expected.glsl @@ -1,14 +1,10 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared uint arg_0; +shared uint arg_0; void atomicXor_c8e6be() { - uint atomic_result = 0u; - InterlockedXor(arg_0, 1u, atomic_result); - uint res = atomic_result; + uint res = atomicXor(arg_0, 1u); } struct tint_symbol_1 { @@ -17,10 +13,9 @@ struct tint_symbol_1 { void compute_main_inner(uint local_invocation_index) { { - uint atomic_result_1 = 0u; - InterlockedExchange(arg_0, 0u, atomic_result_1); + atomicExchange(arg_0, 0u); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); atomicXor_c8e6be(); } @@ -36,9 +31,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.glsl b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.glsl index 2d34b7e041..289b86f1f4 100644 --- a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.glsl +++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void storageBarrier_d87211() { - DeviceMemoryBarrierWithGroupSync(); + memoryBarrierBuffer(); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -17,10 +15,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:5: 'DeviceMemoryBarrierWithGroupSync' : no matching overloaded function found -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.glsl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.glsl index d923b6dfed..c099196719 100644 --- a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.glsl +++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void workgroupBarrier_a17f7f() { - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -17,10 +15,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:5: 'GroupMemoryBarrierWithGroupSync' : no matching overloaded function found -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/let/global/global.wgsl.expected.glsl b/test/let/global/global.wgsl.expected.glsl index daeec49763..188a6dab41 100644 --- a/test/let/global/global.wgsl.expected.glsl +++ b/test/let/global/global.wgsl.expected.glsl @@ -4,17 +4,6 @@ precision mediump float; struct MyStruct { float f1; }; - -const int v1 = 1; -const uint v2 = 1u; -const float v3 = 1.0f; -const ivec3 v4 = ivec3(1, 1, 1); -const uvec3 v5 = uvec3(1u, 1u, 1u); -const vec3 v6 = vec3(1.0f, 1.0f, 1.0f); -const mat3 v7 = mat3(vec3(1.0f, 1.0f, 1.0f), vec3(1.0f, 1.0f, 1.0f), vec3(1.0f, 1.0f, 1.0f)); -const MyStruct v8 = MyStruct(0.0f); -const float v9[10] = float[10](0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); - struct tint_symbol_1 { vec4 value; }; diff --git a/test/ptr_ref/load/local/ptr_workgroup.wgsl.expected.glsl b/test/ptr_ref/load/local/ptr_workgroup.wgsl.expected.glsl index c27e6cdd8c..9fbac12a3d 100644 --- a/test/ptr_ref/load/local/ptr_workgroup.wgsl.expected.glsl +++ b/test/ptr_ref/load/local/ptr_workgroup.wgsl.expected.glsl @@ -1,9 +1,7 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int i; +shared int i; struct tint_symbol_2 { uint local_invocation_index; @@ -13,7 +11,7 @@ void tint_symbol_inner(uint local_invocation_index) { { i = 0; } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); i = 123; int use = (i + 1); } @@ -30,9 +28,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/types/module_scope_let.wgsl.expected.glsl b/test/types/module_scope_let.wgsl.expected.glsl index bd84301f5b..166c6c7fe4 100644 --- a/test/types/module_scope_let.wgsl.expected.glsl +++ b/test/types/module_scope_let.wgsl.expected.glsl @@ -5,17 +5,6 @@ struct S { float a; }; -const bool bool_let = false; -const int i32_let = 0; -const uint u32_let = 0u; -const float f32_let = 0.0f; -const ivec2 v2i32_let = ivec2(0, 0); -const uvec3 v3u32_let = uvec3(0u, 0u, 0u); -const vec4 v4f32_let = vec4(0.0f, 0.0f, 0.0f, 0.0f); -const mat3x4 m3x4_let = mat3x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); -const float arr_let[4] = float[4](0.0f, 0.0f, 0.0f, 0.0f); -const S struct_let = S(0.0f); - layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; void tint_symbol() { return; diff --git a/test/var/initialization/workgroup/array.wgsl.expected.glsl b/test/var/initialization/workgroup/array.wgsl.expected.glsl index 803d29b0e3..c53f318f29 100644 --- a/test/var/initialization/workgroup/array.wgsl.expected.glsl +++ b/test/var/initialization/workgroup/array.wgsl.expected.glsl @@ -1,9 +1,7 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int v[3]; +shared int v[3]; struct tint_symbol_2 { uint local_invocation_index; @@ -16,7 +14,7 @@ void tint_symbol_inner(uint local_invocation_index) { v[i] = 0; } } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -31,9 +29,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/var/initialization/workgroup/matrix.wgsl.expected.glsl b/test/var/initialization/workgroup/matrix.wgsl.expected.glsl index 427c0d3e69..8ea3faa2f5 100644 --- a/test/var/initialization/workgroup/matrix.wgsl.expected.glsl +++ b/test/var/initialization/workgroup/matrix.wgsl.expected.glsl @@ -1,9 +1,7 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared mat2x3 v; +shared mat2x3 v; struct tint_symbol_2 { uint local_invocation_index; @@ -13,7 +11,7 @@ void tint_symbol_inner(uint local_invocation_index) { { v = mat2x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -28,9 +26,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/var/initialization/workgroup/scalar.wgsl.expected.glsl b/test/var/initialization/workgroup/scalar.wgsl.expected.glsl index 398d676253..51471caffb 100644 --- a/test/var/initialization/workgroup/scalar.wgsl.expected.glsl +++ b/test/var/initialization/workgroup/scalar.wgsl.expected.glsl @@ -1,9 +1,7 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int v; +shared int v; struct tint_symbol_2 { uint local_invocation_index; @@ -13,7 +11,7 @@ void tint_symbol_inner(uint local_invocation_index) { { v = 0; } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -28,9 +26,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/var/initialization/workgroup/struct.wgsl.expected.glsl b/test/var/initialization/workgroup/struct.wgsl.expected.glsl index f7cd58a201..bb6cf9201d 100644 --- a/test/var/initialization/workgroup/struct.wgsl.expected.glsl +++ b/test/var/initialization/workgroup/struct.wgsl.expected.glsl @@ -1,5 +1,3 @@ -SKIP: FAILED - #version 310 es precision mediump float; @@ -8,7 +6,7 @@ struct S { float b; }; -groupshared S v; +shared S v; struct tint_symbol_2 { uint local_invocation_index; @@ -19,7 +17,7 @@ void tint_symbol_inner(uint local_invocation_index) { S tint_symbol_3 = S(0, 0.0f); v = tint_symbol_3; } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -34,9 +32,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:9: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/var/initialization/workgroup/vector.wgsl.expected.glsl b/test/var/initialization/workgroup/vector.wgsl.expected.glsl index 6662b52d93..af1722c651 100644 --- a/test/var/initialization/workgroup/vector.wgsl.expected.glsl +++ b/test/var/initialization/workgroup/vector.wgsl.expected.glsl @@ -1,9 +1,7 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared ivec3 v; +shared ivec3 v; struct tint_symbol_2 { uint local_invocation_index; @@ -13,7 +11,7 @@ void tint_symbol_inner(uint local_invocation_index) { { v = ivec3(0, 0, 0); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); } layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; @@ -28,9 +26,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/var/uses/many_workgroup_vars.wgsl.expected.glsl b/test/var/uses/many_workgroup_vars.wgsl.expected.glsl index 479388b1fc..42cbfeb1bb 100644 --- a/test/var/uses/many_workgroup_vars.wgsl.expected.glsl +++ b/test/var/uses/many_workgroup_vars.wgsl.expected.glsl @@ -1,108 +1,106 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared mat2 m00; -groupshared mat2 m01; -groupshared mat2 m02; -groupshared mat2 m03; -groupshared mat2 m04; -groupshared mat2 m05; -groupshared mat2 m06; -groupshared mat2 m07; -groupshared mat2 m08; -groupshared mat2 m09; -groupshared mat2 m10; -groupshared mat2 m11; -groupshared mat2 m12; -groupshared mat2 m13; -groupshared mat2 m14; -groupshared mat2 m15; -groupshared mat2 m16; -groupshared mat2 m17; -groupshared mat2 m18; -groupshared mat2 m19; -groupshared mat2 m20; -groupshared mat2 m21; -groupshared mat2 m22; -groupshared mat2 m23; -groupshared mat2 m24; -groupshared mat2 m25; -groupshared mat2 m26; -groupshared mat2 m27; -groupshared mat2 m28; -groupshared mat2 m29; -groupshared mat2 m30; -groupshared mat2 m31; -groupshared mat2 m32; -groupshared mat2 m33; -groupshared mat2 m34; -groupshared mat2 m35; -groupshared mat2 m36; -groupshared mat2 m37; -groupshared mat2 m38; -groupshared mat2 m39; -groupshared mat2 m40; -groupshared mat2 m41; -groupshared mat2 m42; -groupshared mat2 m43; -groupshared mat2 m44; -groupshared mat2 m45; -groupshared mat2 m46; -groupshared mat2 m47; -groupshared mat2 m48; -groupshared mat2 m49; -groupshared mat2 m50; -groupshared mat2 m51; -groupshared mat2 m52; -groupshared mat2 m53; -groupshared mat2 m54; -groupshared mat2 m55; -groupshared mat2 m56; -groupshared mat2 m57; -groupshared mat2 m58; -groupshared mat2 m59; -groupshared mat2 m60; -groupshared mat2 m61; -groupshared mat2 m62; -groupshared mat2 m63; -groupshared mat2 m64; -groupshared mat2 m65; -groupshared mat2 m66; -groupshared mat2 m67; -groupshared mat2 m68; -groupshared mat2 m69; -groupshared mat2 m70; -groupshared mat2 m71; -groupshared mat2 m72; -groupshared mat2 m73; -groupshared mat2 m74; -groupshared mat2 m75; -groupshared mat2 m76; -groupshared mat2 m77; -groupshared mat2 m78; -groupshared mat2 m79; -groupshared mat2 m80; -groupshared mat2 m81; -groupshared mat2 m82; -groupshared mat2 m83; -groupshared mat2 m84; -groupshared mat2 m85; -groupshared mat2 m86; -groupshared mat2 m87; -groupshared mat2 m88; -groupshared mat2 m89; -groupshared mat2 m90; -groupshared mat2 m91; -groupshared mat2 m92; -groupshared mat2 m93; -groupshared mat2 m94; -groupshared mat2 m95; -groupshared mat2 m96; -groupshared mat2 m97; -groupshared mat2 m98; -groupshared mat2 m99; +shared mat2 m00; +shared mat2 m01; +shared mat2 m02; +shared mat2 m03; +shared mat2 m04; +shared mat2 m05; +shared mat2 m06; +shared mat2 m07; +shared mat2 m08; +shared mat2 m09; +shared mat2 m10; +shared mat2 m11; +shared mat2 m12; +shared mat2 m13; +shared mat2 m14; +shared mat2 m15; +shared mat2 m16; +shared mat2 m17; +shared mat2 m18; +shared mat2 m19; +shared mat2 m20; +shared mat2 m21; +shared mat2 m22; +shared mat2 m23; +shared mat2 m24; +shared mat2 m25; +shared mat2 m26; +shared mat2 m27; +shared mat2 m28; +shared mat2 m29; +shared mat2 m30; +shared mat2 m31; +shared mat2 m32; +shared mat2 m33; +shared mat2 m34; +shared mat2 m35; +shared mat2 m36; +shared mat2 m37; +shared mat2 m38; +shared mat2 m39; +shared mat2 m40; +shared mat2 m41; +shared mat2 m42; +shared mat2 m43; +shared mat2 m44; +shared mat2 m45; +shared mat2 m46; +shared mat2 m47; +shared mat2 m48; +shared mat2 m49; +shared mat2 m50; +shared mat2 m51; +shared mat2 m52; +shared mat2 m53; +shared mat2 m54; +shared mat2 m55; +shared mat2 m56; +shared mat2 m57; +shared mat2 m58; +shared mat2 m59; +shared mat2 m60; +shared mat2 m61; +shared mat2 m62; +shared mat2 m63; +shared mat2 m64; +shared mat2 m65; +shared mat2 m66; +shared mat2 m67; +shared mat2 m68; +shared mat2 m69; +shared mat2 m70; +shared mat2 m71; +shared mat2 m72; +shared mat2 m73; +shared mat2 m74; +shared mat2 m75; +shared mat2 m76; +shared mat2 m77; +shared mat2 m78; +shared mat2 m79; +shared mat2 m80; +shared mat2 m81; +shared mat2 m82; +shared mat2 m83; +shared mat2 m84; +shared mat2 m85; +shared mat2 m86; +shared mat2 m87; +shared mat2 m88; +shared mat2 m89; +shared mat2 m90; +shared mat2 m91; +shared mat2 m92; +shared mat2 m93; +shared mat2 m94; +shared mat2 m95; +shared mat2 m96; +shared mat2 m97; +shared mat2 m98; +shared mat2 m99; struct tint_symbol_2 { uint idx; @@ -211,7 +209,7 @@ void tint_symbol_inner(uint idx) { m98 = mat2(0.0f, 0.0f, 0.0f, 0.0f); m99 = mat2(0.0f, 0.0f, 0.0f, 0.0f); } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); m00[0][0] = 1.0f; m01[0][0] = 1.0f; m02[0][0] = 1.0f; @@ -326,9 +324,3 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - diff --git a/test/var/uses/workgroup.wgsl.expected.glsl b/test/var/uses/workgroup.wgsl.expected.glsl index 8b19e03346..b577200a92 100644 --- a/test/var/uses/workgroup.wgsl.expected.glsl +++ b/test/var/uses/workgroup.wgsl.expected.glsl @@ -1,9 +1,7 @@ -SKIP: FAILED - #version 310 es precision mediump float; -groupshared int a; +shared int a; void uses_a() { a = (a + 1); @@ -17,7 +15,7 @@ void main1_inner(uint local_invocation_index) { { a = 0; } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); a = 42; uses_a(); } @@ -41,16 +39,10 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - #version 310 es precision mediump float; -groupshared int b; +shared int b; void uses_b() { b = (b * 2); @@ -67,7 +59,7 @@ void main2_inner(uint local_invocation_index_1) { { b = 0; } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); b = 7; uses_b(); } @@ -88,17 +80,11 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - #version 310 es precision mediump float; -groupshared int a; -groupshared int b; +shared int a; +shared int b; void uses_a() { a = (a + 1); @@ -138,7 +124,7 @@ void main3_inner(uint local_invocation_index_2) { a = 0; b = 0; } - GroupMemoryBarrierWithGroupSync(); + memoryBarrierShared(); outer(); no_uses(); } @@ -155,12 +141,6 @@ void main() { } -Error parsing GLSL shader: -ERROR: 0:4: '' : syntax error, unexpected IDENTIFIER -ERROR: 1 compilation errors. No code generated. - - - #version 310 es precision mediump float;