Skip to content

Commit f8f3585

Browse files
committed
reproduction
1 parent c51fe57 commit f8f3585

File tree

8 files changed

+99
-0
lines changed

8 files changed

+99
-0
lines changed

naga/tests/in/wgsl/empty-if.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[spv]
2+
version = [1, 6]

naga/tests/in/wgsl/empty-if.wgsl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@workgroup_size(1)
2+
@compute
3+
fn comp(@builtin(global_invocation_id) id: vec3<u32>) {
4+
if (id.x == 0) {
5+
6+
}
7+
_ = 1+1;
8+
return;
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#version 310 es
2+
3+
precision highp float;
4+
precision highp int;
5+
6+
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
7+
8+
9+
void main() {
10+
uvec3 id = gl_GlobalInvocationID;
11+
if ((id.x == 0u)) {
12+
}
13+
return;
14+
}
15+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[numthreads(1, 1, 1)]
2+
void comp(uint3 id : SV_DispatchThreadID)
3+
{
4+
if ((id.x == 0u)) {
5+
}
6+
return;
7+
}

naga/tests/out/hlsl/wgsl-empty-if.ron

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(
2+
vertex:[
3+
],
4+
fragment:[
5+
],
6+
compute:[
7+
(
8+
entry_point:"comp",
9+
target_profile:"cs_5_1",
10+
),
11+
],
12+
)

naga/tests/out/msl/wgsl-empty-if.msl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// language: metal1.0
2+
#include <metal_stdlib>
3+
#include <simd/simd.h>
4+
5+
using metal::uint;
6+
7+
8+
struct compInput {
9+
};
10+
kernel void comp(
11+
metal::uint3 id [[thread_position_in_grid]]
12+
) {
13+
if (id.x == 0u) {
14+
}
15+
return;
16+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; SPIR-V
2+
; Version: 1.6
3+
; Generator: rspirv
4+
; Bound: 19
5+
OpCapability Shader
6+
%1 = OpExtInstImport "GLSL.std.450"
7+
OpMemoryModel Logical GLSL450
8+
OpEntryPoint GLCompute %9 "comp" %6
9+
OpExecutionMode %9 LocalSize 1 1 1
10+
OpDecorate %6 BuiltIn GlobalInvocationId
11+
%2 = OpTypeVoid
12+
%4 = OpTypeInt 32 0
13+
%3 = OpTypeVector %4 3
14+
%7 = OpTypePointer Input %3
15+
%6 = OpVariable %7 Input
16+
%10 = OpTypeFunction %2
17+
%11 = OpConstant %4 0
18+
%12 = OpTypeInt 32 1
19+
%13 = OpConstant %12 2
20+
%16 = OpTypeBool
21+
%9 = OpFunction %2 None %10
22+
%5 = OpLabel
23+
%8 = OpLoad %3 %6
24+
OpBranch %14
25+
%14 = OpLabel
26+
%15 = OpCompositeExtract %4 %8 0
27+
%17 = OpIEqual %16 %15 %11
28+
OpSelectionMerge %18 None
29+
OpBranchConditional %17 %18 %18
30+
%18 = OpLabel
31+
OpReturn
32+
OpFunctionEnd
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@compute @workgroup_size(1, 1, 1)
2+
fn comp(@builtin(global_invocation_id) id: vec3<u32>) {
3+
if (id.x == 0u) {
4+
}
5+
return;
6+
}

0 commit comments

Comments
 (0)