summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cross-compile/func-resource-param-array.slang3
-rw-r--r--tests/cross-compile/func-resource-param-array.slang.glsl87
-rw-r--r--tests/cross-compile/vk-texture-indexing.slang.glsl18
-rw-r--r--tests/experimental/liveness/liveness-4.slang.expected41
-rw-r--r--tests/ir/dce-rw-buffer-load.slang21
-rw-r--r--tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang.glsl15
-rw-r--r--tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl11
-rw-r--r--tests/pipeline/ray-tracing/ray-query-subroutine.slang6
-rw-r--r--tests/pipeline/ray-tracing/ray-query-subroutine.slang.hlsl30
-rw-r--r--tests/pipeline/ray-tracing/trace-ray-inline.slang4
-rw-r--r--tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl114
-rw-r--r--tests/pipeline/ray-tracing/trace-ray-inline.slang.hlsl150
12 files changed, 288 insertions, 212 deletions
diff --git a/tests/cross-compile/func-resource-param-array.slang b/tests/cross-compile/func-resource-param-array.slang
index 7062169dc..d7b7fca99 100644
--- a/tests/cross-compile/func-resource-param-array.slang
+++ b/tests/cross-compile/func-resource-param-array.slang
@@ -32,7 +32,6 @@ void main(uint3 tid : SV_DispatchThreadID)
{
uint ii = tid.x;
uint jj = tid.y;
- uint kk = tid.z;
// Can we specialize `f`?
//
@@ -56,7 +55,7 @@ void main(uint3 tid : SV_DispatchThreadID)
// What if the function takes an array, and we pass
// in an element of an array-of-arrays?
//
- tmp += g(c[ii], jj, kk);
+ tmp += g(c[ii], jj, tid.z);
a[ii] = tmp;
}
diff --git a/tests/cross-compile/func-resource-param-array.slang.glsl b/tests/cross-compile/func-resource-param-array.slang.glsl
index e9d1b5a97..d5d1bd08c 100644
--- a/tests/cross-compile/func-resource-param-array.slang.glsl
+++ b/tests/cross-compile/func-resource-param-array.slang.glsl
@@ -1,93 +1,48 @@
-// func-resource-param-array.slang.glsl
#version 450
+layout(row_major) uniform;
+layout(row_major) buffer;
-#define a a_0
-#define b b_0
-#define c c_0
-#define ii ii_0
-#define jj jj_0
-#define kk kk_0
-
-#define f_a f_0
-#define f_b f_1
-#define g_b g_0
-#define g_c g_1
-
-#define a_block _S1
-#define b_block _S2
-#define c_block _S3
-
-#define f_a_i _S4
-#define f_b_t _S5
-#define f_b_i _S6
-#define g_b_i _S7
-#define g_b_j _S8
-#define g_c_t _S9
-#define g_c_i _S10
-#define g_c_j _S11
-
-#define tmp_f_a_ii _S12
-#define tmp_f_a_jj _S13
-
-#define tmp_f_b _S14
-#define tmp_g_b _S15
-#define tmp_g_c _S16
-
-layout(std430, binding = 0) buffer a_block {
+layout(std430, binding = 0) buffer _S1 {
int _data[];
-} a;
+} a_0;
-layout(std430, binding = 1) buffer b_block {
+layout(std430, binding = 1) buffer _S2 {
int _data[];
-} b[3];
+} b_0[3];
-layout(std430, binding = 2) buffer c_block {
+layout(std430, binding = 2) buffer _S3 {
int _data[];
-} c[4][3];
+} c_0[4][3];
-int f_a(uint f_a_i)
+int f_0(uint _S4)
{
- return a._data[f_a_i];
+ return ((a_0)._data[(_S4)]);
}
-int f_b(uint f_b_t, uint f_b_i)
+int f_1(uint _S5, uint _S6)
{
- return b[f_b_t]._data[f_b_i];
+ return ((b_0[_S5])._data[(_S6)]);
}
-int g_b(uint g_b_i, uint g_b_j)
+int g_0(uint _S7, uint _S8)
{
- return b[g_b_i]._data[g_b_j];
+ return ((b_0[_S7])._data[(_S8)]);
}
-int g_c(uint g_c_t, uint g_c_i, uint g_c_j)
+int g_1(uint _S9, uint _S10, uint _S11)
{
- return c[g_c_t][g_c_i]._data[g_c_j];
+ return ((c_0[_S9][_S10])._data[(_S11)]);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-
void main()
{
- uint ii = gl_GlobalInvocationID.x;
- uint jj = gl_GlobalInvocationID.y;
- uint kk = gl_GlobalInvocationID.z;
+ uint ii_0 = gl_GlobalInvocationID.x;
+ uint jj_0 = gl_GlobalInvocationID.y;
- int tmp_f_a_ii = f_a(ii);
-
- int tmp_f_a_jj = f_a(jj);
- int tmp_0 = tmp_f_a_ii + tmp_f_a_jj;
-
- int tmp_f_b = f_b(ii, jj);
- int tmp_1 = tmp_0 + tmp_f_b;
-
- int tmp_g_b = g_b(ii, jj);
- int tmp_2 = tmp_1 + tmp_g_b;
-
- int tmp_g_c = g_c(ii, jj, kk);
- int tmp_3 = tmp_2 + tmp_g_c;
-
- a._data[ii] = tmp_3;
+ int tmp_0 = f_0(ii_0) + f_0(jj_0) + f_1(ii_0, jj_0) + g_0(ii_0, jj_0) + g_1(ii_0, jj_0, gl_GlobalInvocationID.z);
+ ((a_0)._data[(ii_0)]) = tmp_0;
return;
}
+
diff --git a/tests/cross-compile/vk-texture-indexing.slang.glsl b/tests/cross-compile/vk-texture-indexing.slang.glsl
index 069e6efc3..73513c623 100644
--- a/tests/cross-compile/vk-texture-indexing.slang.glsl
+++ b/tests/cross-compile/vk-texture-indexing.slang.glsl
@@ -1,16 +1,16 @@
#version 450
-#extension GL_EXT_nonuniform_qualifier : require
#extension GL_EXT_samplerless_texture_functions : require
+#extension GL_EXT_nonuniform_qualifier : require
+layout(row_major) uniform;
+layout(row_major) buffer;
layout(binding = 0)
uniform texture2D gParams_textures_0[10];
+
float fetchData_0(uvec2 coords_0, uint index_0)
{
- float _S1 = texelFetch(
- gParams_textures_0[nonuniformEXT(index_0)],
- ivec2(coords_0),
- 0).x;
+ float _S1 = (texelFetch((gParams_textures_0[nonuniformEXT(index_0)]), ivec2((coords_0)), 0).x);
return _S1;
}
@@ -18,12 +18,16 @@ float fetchData_0(uvec2 coords_0, uint index_0)
layout(location = 0)
out vec4 _S2;
+
flat layout(location = 0)
in uvec3 _S3;
+
void main()
{
- float v_0 = fetchData_0(_S3.xy, _S3.z);
- _S2 = vec4(v_0);
+
+ _S2 = vec4(fetchData_0(_S3.xy, _S3.z));
+
return;
}
+
diff --git a/tests/experimental/liveness/liveness-4.slang.expected b/tests/experimental/liveness/liveness-4.slang.expected
index 802388e40..ee7986319 100644
--- a/tests/experimental/liveness/liveness-4.slang.expected
+++ b/tests/experimental/liveness/liveness-4.slang.expected
@@ -10,25 +10,15 @@ layout(std430, binding = 0) buffer _S1 {
int _data[];
} outputBuffer_0;
spirv_instruction(id = 256)
-void livenessStart_0(spirv_by_reference int _0[2], spirv_literal int _1);
-
-spirv_instruction(id = 256)
-void livenessStart_1(spirv_by_reference int _0, spirv_literal int _1);
+void livenessStart_0(spirv_by_reference int _0, spirv_literal int _1);
spirv_instruction(id = 257)
void livenessEnd_0(spirv_by_reference int _0, spirv_literal int _1);
-spirv_instruction(id = 257)
-void livenessEnd_1(spirv_by_reference int _0[2], spirv_literal int _1);
-
int calcThing_0(int offset_0)
{
- int another_0[2];
- livenessStart_0(another_0, 0);
- another_0[0] = 1;
- another_0[1] = 2;
int k_0;
- livenessStart_1(k_0, 0);
+ livenessStart_0(k_0, 0);
k_0 = 0;
for(;;)
{
@@ -41,33 +31,16 @@ int calcThing_0(int offset_0)
break;
}
bool _S2 = (k_0 + 7) % 5 == 4;
- int k_1 = k_0 + 1;
- int i_0;
- livenessStart_1(i_0, 0);
- i_0 = 0;
- for(;;)
- {
- if(i_0 < 17)
- {
- }
- else
- {
- livenessEnd_0(i_0, 0);
- break;
- }
- another_0[i_0 & 1] = another_0[i_0 & 1] + (k_0 + i_0);
- i_0 = i_0 + 1;
- }
+ int _S3 = k_0;
livenessEnd_0(k_0, 0);
+ int k_1 = _S3 + 1;
if(_S2)
{
- livenessEnd_1(another_0, 0);
return 1;
}
- livenessStart_1(k_0, 0);
+ livenessStart_0(k_0, 0);
k_0 = k_1;
}
- livenessEnd_1(another_0, 0);
return -2;
}
@@ -75,8 +48,8 @@ layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
void main()
{
int index_0 = int(gl_GlobalInvocationID.x);
- int _S3 = calcThing_0(index_0);
- ((outputBuffer_0)._data[(uint(index_0))]) = _S3;
+ int _S4 = calcThing_0(index_0);
+ ((outputBuffer_0)._data[(uint(index_0))]) = _S4;
return;
}
diff --git a/tests/ir/dce-rw-buffer-load.slang b/tests/ir/dce-rw-buffer-load.slang
new file mode 100644
index 000000000..01a14ee45
--- /dev/null
+++ b/tests/ir/dce-rw-buffer-load.slang
@@ -0,0 +1,21 @@
+//TEST:SIMPLE(filecheck=CHECK): -target hlsl -profile cs_5_0 -entry computeMain -line-directive-mode none
+
+// Test that we can DCE load of a rw buffer.
+
+RWStructuredBuffer<float> gOutputBuffer;
+
+float test()
+{
+ return gOutputBuffer[0];
+}
+
+[numthreads(1, 1, 1)]
+void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
+{
+ test();
+}
+
+// CHECK: void computeMain
+// CHECK-NOT: test
+// CHECK: }
+
diff --git a/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang.glsl b/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang.glsl
index 5819d657d..0374569fe 100644
--- a/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang.glsl
+++ b/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang.glsl
@@ -1,18 +1,11 @@
#version 460
-
-#extension GL_NV_ray_tracing : require
-
-int helper_0(accelerationStructureNV a_0, int b_0)
-{
- return b_0;
-}
-
-layout(binding = 1)
-uniform accelerationStructureNV entryPointParams_x_0;
+layout(row_major) uniform;
+layout(row_major) buffer;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main()
{
- int _S1 = helper_0(entryPointParams_x_0, 1);
+
return;
}
+
diff --git a/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl b/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl
index 83797d2d5..0374569fe 100644
--- a/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl
+++ b/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl
@@ -1,18 +1,11 @@
#version 460
-#extension GL_EXT_ray_tracing : require
layout(row_major) uniform;
layout(row_major) buffer;
-int helper_0(accelerationStructureEXT a_0, int b_0)
-{
- return b_0;
-}
-
-layout(binding = 1)
-uniform accelerationStructureEXT entryPointParams_x_0;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main()
{
- int _S1 = helper_0(entryPointParams_x_0, 1);
+
return;
}
+
diff --git a/tests/pipeline/ray-tracing/ray-query-subroutine.slang b/tests/pipeline/ray-tracing/ray-query-subroutine.slang
index 501071717..3279acc12 100644
--- a/tests/pipeline/ray-tracing/ray-query-subroutine.slang
+++ b/tests/pipeline/ray-tracing/ray-query-subroutine.slang
@@ -7,7 +7,7 @@
RWStructuredBuffer<int> gOutput;
RaytracingAccelerationStructure gScene;
-int helper<let N : int>(RayQuery<N> q)
+float3 helper<let N : int>(RayQuery<N> q)
{
RayDesc ray;
ray.Origin = 0;
@@ -20,7 +20,7 @@ int helper<let N : int>(RayQuery<N> q)
/* instanceInclusionmask: */ 0xFFFFFFFF,
/* ray: */ ray );
- return 1;
+ return q.WorldRayDirection();
}
[shader("compute")]
@@ -36,5 +36,5 @@ void computeMain(uint tid : SV_DispatchThreadID)
RayQuery<0> rayQuery;
let result = helper(rayQuery);
- gOutput[tid.x] = result;
+ gOutput[tid.x] = int(result.x);
}
diff --git a/tests/pipeline/ray-tracing/ray-query-subroutine.slang.hlsl b/tests/pipeline/ray-tracing/ray-query-subroutine.slang.hlsl
index 5906823e5..db97f4278 100644
--- a/tests/pipeline/ray-tracing/ray-query-subroutine.slang.hlsl
+++ b/tests/pipeline/ray-tracing/ray-query-subroutine.slang.hlsl
@@ -1,26 +1,32 @@
-//TEST_IGNORE_FILE:
-
RaytracingAccelerationStructure gScene_0 : register(t0);
-int helper_0(RayQuery<int(0) > q_0)
+RWStructuredBuffer<int > gOutput_0 : register(u0);
+
+float3 helper_0(RayQuery<int(0) > q_0)
{
+ RayQuery<int(0) > _S1 = q_0;
+
RayDesc ray_0;
- ray_0.Origin = (vector<float,3>) int(0);
- ray_0.Direction = (vector<float,3>) int(0);
- ray_0.TMin = (float) int(0);
- ray_0.TMax = 1000.00000000000000000000;
- q_0.TraceRayInline(gScene_0, (uint) int(0), (uint) int(-1), ray_0);
- return int(1);
+ float3 _S2 = (float3)0.0;
+
+ ray_0.Origin = _S2;
+ ray_0.Direction = _S2;
+ ray_0.TMin = 0.0;
+ ray_0.TMax = 1000.0;
+ _S1.TraceRayInline(gScene_0, 0U, 4294967295U, ray_0);
+
+ return _S1.WorldRayDirection();
}
-RWStructuredBuffer<int > gOutput_0 : register(u0);
[shader("compute")][numthreads(1, 1, 1)]
void computeMain(uint tid_0 : SV_DISPATCHTHREADID)
{
RayQuery<int(0) > rayQuery_0;
- int _S1 = helper_0(rayQuery_0);
- gOutput_0[tid_0.x] = _S1;
+ int _S3 = int(helper_0(rayQuery_0).x);
+
+ gOutput_0[tid_0.x] = _S3;
return;
}
+
diff --git a/tests/pipeline/ray-tracing/trace-ray-inline.slang b/tests/pipeline/ray-tracing/trace-ray-inline.slang
index d44500e18..e952bb802 100644
--- a/tests/pipeline/ray-tracing/trace-ray-inline.slang
+++ b/tests/pipeline/ray-tracing/trace-ray-inline.slang
@@ -83,6 +83,8 @@ bool myProceduralIntersection(inout float tHit, inout MyProceduralHitAttrs hitAt
return true;
}
+RWStructuredBuffer<int> resultBuffer;
+
// In order to kick of tracing we need the properties of a ray
// query to trace, so we will pipe those in via a constant buffer.
//
@@ -169,4 +171,6 @@ void main(uint3 tid : SV_DispatchThreadID)
myMiss(payload);
break;
}
+
+ resultBuffer[index] = payload.value;
} \ No newline at end of file
diff --git a/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl b/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl
index bb605a14a..56926e956 100644
--- a/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl
+++ b/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl
@@ -4,7 +4,7 @@
layout(row_major) uniform;
layout(row_major) buffer;
-#line 89 "tests/pipeline/ray-tracing/trace-ray-inline.slang"
+#line 91 "tests/pipeline/ray-tracing/trace-ray-inline.slang"
struct SLANG_ParameterGroup_C_0
{
vec3 origin_0;
@@ -17,8 +17,8 @@ struct SLANG_ParameterGroup_C_0
};
-#line 89
-layout(binding = 1)
+#line 91
+layout(binding = 2)
layout(std140) uniform _S1
{
vec3 origin_0;
@@ -35,6 +35,11 @@ layout(binding = 0)
uniform accelerationStructureEXT myAccelerationStructure_0;
+#line 86
+layout(std430, binding = 1) buffer _S2 {
+ int _data[];
+} resultBuffer_0;
+
#line 59
struct MyProceduralHitAttrs_0
{
@@ -94,61 +99,64 @@ void myMiss_0(inout MyRayPayload_0 payload_4)
}
-#line 103
+#line 105
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main()
{
- rayQueryEXT query_0;
-
+#line 107
+ uint index_0 = gl_GlobalInvocationID.x;
+#line 112
MyRayPayload_0 payload_5;
-#line 110
+#line 112
payload_5.value_1 = -1;
+#line 109
+ rayQueryEXT query_0;
+
+#line 114
rayQueryInitializeEXT((query_0), (myAccelerationStructure_0), (C_0.rayFlags_0 | 512), (C_0.instanceMask_0), (C_0.origin_0), (C_0.tMin_0), (C_0.direction_0), (C_0.tMax_0));
-#line 112
+#line 114
MyProceduralHitAttrs_0 committedProceduralAttrs_0;
-#line 112
+#line 114
for(;;)
{
-#line 121
- bool _S2 = rayQueryProceedEXT(query_0);
+#line 123
+ bool _S3 = rayQueryProceedEXT(query_0);
-#line 121
- if(!_S2)
+#line 123
+ if(!_S3)
{
-#line 121
+#line 123
break;
}
- uint _S3 = (rayQueryGetIntersectionTypeEXT((query_0), false));
#line 123
MyProceduralHitAttrs_0 committedProceduralAttrs_1;
-#line 123
- switch(_S3)
+ switch((rayQueryGetIntersectionTypeEXT((query_0), false)))
{
case 1U:
{
MyProceduralHitAttrs_0 candidateProceduralAttrs_0;
-#line 127
+#line 129
candidateProceduralAttrs_0.value_0 = 0;
float tHit_1 = 0.0;
bool _S4 = myProceduralIntersection_0(tHit_1, candidateProceduralAttrs_0);
-#line 129
+#line 131
if(_S4)
{
bool _S5 = myProceduralAnyHit_0(payload_5);
-#line 131
+#line 133
if(_S5)
{
rayQueryGenerateIntersectionEXT(query_0, tHit_1);
@@ -156,136 +164,132 @@ void main()
if(C_0.shouldStopAtFirstHit_0 != 0U)
{
-#line 136
+#line 138
rayQueryTerminateEXT(query_0);
-#line 135
+#line 137
}
else
{
-#line 135
+#line 137
}
-#line 135
+#line 137
committedProceduralAttrs_1 = _S6;
-#line 135
+#line 137
}
else
{
-#line 135
+#line 137
committedProceduralAttrs_1 = committedProceduralAttrs_0;
-#line 135
+#line 137
}
-#line 135
+#line 137
}
else
{
-#line 135
+#line 137
committedProceduralAttrs_1 = committedProceduralAttrs_0;
-#line 135
+#line 137
}
-#line 135
+#line 137
break;
}
case 0U:
{
-#line 144
+#line 146
bool _S7 = myTriangleAnyHit_0(payload_5);
-#line 144
+#line 146
if(_S7)
{
rayQueryConfirmIntersectionEXT(query_0);
if(C_0.shouldStopAtFirstHit_0 != 0U)
{
-#line 148
+#line 150
rayQueryTerminateEXT(query_0);
-#line 147
+#line 149
}
else
{
-#line 147
+#line 149
}
-#line 144
+#line 146
}
else
{
-#line 144
+#line 146
}
-#line 144
+#line 146
committedProceduralAttrs_1 = committedProceduralAttrs_0;
-#line 144
+#line 146
break;
}
default:
{
-#line 144
+#line 146
committedProceduralAttrs_1 = committedProceduralAttrs_0;
-#line 144
+#line 146
break;
}
}
-#line 119
+#line 121
committedProceduralAttrs_0 = committedProceduralAttrs_1;
-#line 119
+#line 121
}
-#line 158
- uint _S8 = (rayQueryGetIntersectionTypeEXT((query_0), true));
-
-#line 158
- switch(_S8)
+#line 160
+ switch((rayQueryGetIntersectionTypeEXT((query_0), true)))
{
case 1U:
{
-#line 161
+#line 163
myTriangleClosestHit_0(payload_5);
break;
}
case 2U:
{
-#line 165
+#line 167
myProceduralClosestHit_0(payload_5, committedProceduralAttrs_0);
break;
}
case 0U:
{
-#line 169
+#line 171
myMiss_0(payload_5);
break;
}
default:
{
-#line 170
+#line 172
break;
}
}
-
-#line 172
+ ((resultBuffer_0)._data[(index_0)]) = payload_5.value_1;
return;
}
diff --git a/tests/pipeline/ray-tracing/trace-ray-inline.slang.hlsl b/tests/pipeline/ray-tracing/trace-ray-inline.slang.hlsl
index a85415065..e96cbb8f4 100644
--- a/tests/pipeline/ray-tracing/trace-ray-inline.slang.hlsl
+++ b/tests/pipeline/ray-tracing/trace-ray-inline.slang.hlsl
@@ -4,6 +4,8 @@
#endif
#pragma warning(disable: 3557)
+
+#line 91 "tests/pipeline/ray-tracing/trace-ray-inline.slang"
struct SLANG_ParameterGroup_C_0
{
float3 origin_0;
@@ -15,150 +17,272 @@ struct SLANG_ParameterGroup_C_0
uint shouldStopAtFirstHit_0;
};
+
+#line 91
cbuffer C_0 : register(b0)
{
SLANG_ParameterGroup_C_0 C_0;
}
+
+#line 12
RaytracingAccelerationStructure myAccelerationStructure_0 : register(t0);
+
+#line 86
+RWStructuredBuffer<int > resultBuffer_0 : register(u0);
+
+
+#line 59
struct MyProceduralHitAttrs_0
{
int value_0;
};
+
+#line 81
bool myProceduralIntersection_0(inout float tHit_0, inout MyProceduralHitAttrs_0 hitAttrs_0)
{
return true;
}
+
+#line 26
struct MyRayPayload_0
{
int value_1;
};
+
+#line 69
bool myProceduralAnyHit_0(inout MyRayPayload_0 payload_0)
{
return true;
}
+
+#line 51
bool myTriangleAnyHit_0(inout MyRayPayload_0 payload_1)
{
return true;
}
+
+#line 40
void myTriangleClosestHit_0(inout MyRayPayload_0 payload_2)
{
payload_2.value_1 = int(1);
return;
}
+
+#line 65
void myProceduralClosestHit_0(inout MyRayPayload_0 payload_3, MyProceduralHitAttrs_0 attrs_0)
{
payload_3.value_1 = attrs_0.value_0;
return;
}
+
+#line 33
void myMiss_0(inout MyRayPayload_0 payload_4)
{
payload_4.value_1 = int(0);
return;
}
+
+#line 105
[shader("compute")][numthreads(1, 1, 1)]
void main(uint3 tid_0 : SV_DISPATCHTHREADID)
{
- RayQuery<int(512) > query_0;
+#line 107
+ uint index_0 = tid_0.x;
+
+#line 112
MyRayPayload_0 payload_5;
+
+#line 112
payload_5.value_1 = int(-1);
RayDesc ray_0 = { C_0.origin_0, C_0.tMin_0, C_0.direction_0, C_0.tMax_0 };
+
+#line 109
+ RayQuery<int(512) > query_0;
+
+#line 114
query_0.TraceRayInline(myAccelerationStructure_0, C_0.rayFlags_0, C_0.instanceMask_0, ray_0);
+
+#line 114
MyProceduralHitAttrs_0 committedProceduralAttrs_0;
+
+#line 114
for(;;)
{
+
+#line 123
bool _S1 = query_0.Proceed();
+
+#line 123
if(!_S1)
{
+
+#line 123
break;
}
- uint _S2 = query_0.CandidateType();
+
+#line 123
MyProceduralHitAttrs_0 committedProceduralAttrs_1;
- switch(_S2)
+
+ switch(query_0.CandidateType())
{
case 1U:
{
MyProceduralHitAttrs_0 candidateProceduralAttrs_0;
+
+#line 129
candidateProceduralAttrs_0.value_0 = int(0);
float tHit_1 = 0.0;
- bool _S3 = myProceduralIntersection_0(tHit_1, candidateProceduralAttrs_0);
- if(_S3)
+ bool _S2 = myProceduralIntersection_0(tHit_1, candidateProceduralAttrs_0);
+
+#line 131
+ if(_S2)
{
- bool _S4 = myProceduralAnyHit_0(payload_5);
- if(_S4)
+ bool _S3 = myProceduralAnyHit_0(payload_5);
+
+#line 133
+ if(_S3)
{
query_0.CommitProceduralPrimitiveHit(tHit_1);
- MyProceduralHitAttrs_0 _S5 = candidateProceduralAttrs_0;
+ MyProceduralHitAttrs_0 _S4 = candidateProceduralAttrs_0;
if(C_0.shouldStopAtFirstHit_0 != 0U)
{
+
+#line 138
query_0.Abort();
+
+#line 137
+ }
+ else
+ {
+
+#line 137
}
- committedProceduralAttrs_1 = _S5;
+
+#line 137
+ committedProceduralAttrs_1 = _S4;
+
+#line 137
}
else
{
+
+#line 137
committedProceduralAttrs_1 = committedProceduralAttrs_0;
+
+#line 137
}
+
+#line 137
}
else
{
+
+#line 137
committedProceduralAttrs_1 = committedProceduralAttrs_0;
+
+#line 137
}
+
+#line 137
break;
}
case 0U:
{
- bool _S6 = myTriangleAnyHit_0(payload_5);
- if(_S6)
+
+#line 146
+ bool _S5 = myTriangleAnyHit_0(payload_5);
+
+#line 146
+ if(_S5)
{
query_0.CommitNonOpaqueTriangleHit();
if(C_0.shouldStopAtFirstHit_0 != 0U)
{
+
+#line 150
query_0.Abort();
+
+#line 149
+ }
+ else
+ {
+
+#line 149
}
+
+#line 146
+ }
+ else
+ {
+
+#line 146
}
+
+#line 146
committedProceduralAttrs_1 = committedProceduralAttrs_0;
+
+#line 146
break;
}
default:
{
+
+#line 146
committedProceduralAttrs_1 = committedProceduralAttrs_0;
+
+#line 146
break;
}
}
+
+#line 121
committedProceduralAttrs_0 = committedProceduralAttrs_1;
+
+#line 121
}
- uint _S7 = query_0.CommittedStatus();
- switch(_S7)
+
+#line 160
+ switch(query_0.CommittedStatus())
{
case 1U:
{
+
+#line 163
myTriangleClosestHit_0(payload_5);
break;
}
case 2U:
{
+
+#line 167
myProceduralClosestHit_0(payload_5, committedProceduralAttrs_0);
break;
}
case 0U:
{
+
+#line 171
myMiss_0(payload_5);
break;
}
default:
{
+
+#line 172
break;
}
}
+ resultBuffer_0[index_0] = payload_5.value_1;
return;
}
+