summaryrefslogtreecommitdiff
path: root/tests/hlsl-intrinsic
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-01-23 06:59:25 -0800
committerGitHub <noreply@github.com>2023-01-23 06:59:25 -0800
commit46a4d98baa1d43b33717b4377aefeeaf46b9c2ff (patch)
treec89f3a1c416330f859887d00f896b18bcc7488a5 /tests/hlsl-intrinsic
parent263ca18ea516cfce43fda703c0a411aaf1938e42 (diff)
Full address insts elimination for backward autodiff. (#2604)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/hlsl-intrinsic')
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang.1.expected27
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang.1.expected33
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang.1.expected15
-rw-r--r--tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang.1.expected15
4 files changed, 47 insertions, 43 deletions
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang.1.expected b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang.1.expected
index 8fc391feb..15221b921 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang.1.expected
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-make-hit.slang.1.expected
@@ -57,15 +57,16 @@ uint calcValue_0(hitObjectNV hit_0)
uint hitKind_0 = (hitObjectGetHitKindNV((hit_0)));
uint r_1 = 0U + hitKind_0 + instanceIndex_0 + instanceID_0 + geometryIndex_0 + primitiveIndex_0;
RayDesc_0 ray_1 = HitObject_GetRayDesc_0(hit_0);
- uint r_2 = r_1 + uint(ray_1.TMin_0 > 0.00000000000000000000) + uint(ray_1.TMax_0 < ray_1.TMin_0);
+ float _S6 = ray_1.TMin_0;
+ uint r_2 = r_1 + uint(_S6 > 0.00000000000000000000) + uint(ray_1.TMax_0 < _S6);
SomeValues_0 objSomeValues_0 = HitObject_GetAttributes_0(hit_0);
r_0 = r_2 + uint(objSomeValues_0.a_0);
}
else
{
- bool _S6 = (hitObjectIsMissNV((hit_0)));
+ bool _S7 = (hitObjectIsMissNV((hit_0)));
uint r_3;
- if(_S6)
+ if(_S7)
{
r_3 = 1U;
}
@@ -78,29 +79,29 @@ uint calcValue_0(hitObjectNV hit_0)
return r_0;
}
-layout(std430, binding = 1) buffer _S7 {
+layout(std430, binding = 1) buffer _S8 {
uint _data[];
} outputBuffer_0;
void main()
{
- uvec3 _S8 = ((gl_LaunchIDEXT));
- ivec2 launchID_0 = ivec2(_S8.xy);
- uvec3 _S9 = ((gl_LaunchSizeEXT));
+ uvec3 _S9 = ((gl_LaunchIDEXT));
+ ivec2 launchID_0 = ivec2(_S9.xy);
+ uvec3 _S10 = ((gl_LaunchSizeEXT));
int idx_0 = launchID_0.x;
RayDesc_0 ray_2;
ray_2.Origin_0 = vec3(float(idx_0), 0.00000000000000000000, 0.00000000000000000000);
ray_2.TMin_0 = 0.00999999977648258209;
ray_2.Direction_0 = vec3(0.00000000000000000000, 1.00000000000000000000, 0.00000000000000000000);
ray_2.TMax_0 = 10000.00000000000000000000;
- RayDesc_0 _S10 = ray_2;
+ RayDesc_0 _S11 = ray_2;
hitObjectNV hitObj_0;
- hitObjectRecordHitWithIndexNV(hitObj_0, scene_0, int(uint(idx_0)), int(uint(idx_0 * 2)), int(uint(idx_0 * 3)), 0U, 0U, _S10.Origin_0, _S10.TMin_0, _S10.Direction_0, _S10.TMax_0, (0));
+ hitObjectRecordHitWithIndexNV(hitObj_0, scene_0, int(uint(idx_0)), int(uint(idx_0 * 2)), int(uint(idx_0 * 3)), 0U, 0U, _S11.Origin_0, _S11.TMin_0, _S11.Direction_0, _S11.TMax_0, (0));
uint r_4 = calcValue_0(hitObj_0);
- RayDesc_0 _S11 = ray_2;
+ RayDesc_0 _S12 = ray_2;
hitObjectNV hitObj_1;
- hitObjectRecordHitNV(hitObj_1, scene_0, int(uint(idx_0)), int(uint(idx_0 * 3)), int(uint(idx_0 * 2)), 0U, 0U, 4U, _S11.Origin_0, _S11.TMin_0, _S11.Direction_0, _S11.TMax_0, (0));
- uint _S12 = calcValue_0(hitObj_1);
- uint r_5 = r_4 + _S12;
+ hitObjectRecordHitNV(hitObj_1, scene_0, int(uint(idx_0)), int(uint(idx_0 * 3)), int(uint(idx_0 * 2)), 0U, 0U, 4U, _S12.Origin_0, _S12.TMin_0, _S12.Direction_0, _S12.TMax_0, (0));
+ uint _S13 = calcValue_0(hitObj_1);
+ uint r_5 = r_4 + _S13;
((outputBuffer_0)._data[(uint(idx_0))]) = r_5;
return;
}
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang.1.expected b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang.1.expected
index 90223115b..f250c1c92 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang.1.expected
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-reorder-thread.slang.1.expected
@@ -79,36 +79,37 @@ void main()
ivec2 launchID_0 = ivec2(_S3.xy);
uvec3 _S4 = ((gl_LaunchSizeEXT));
int idx_0 = launchID_0.x;
- SomeValues_0 someValues_0 = { idx_0, float(idx_0) * 2.00000000000000000000 };
+ float _S5 = float(idx_0);
+ SomeValues_0 someValues_0 = { idx_0, _S5 * 2.00000000000000000000 };
RayDesc_0 ray_0;
- ray_0.Origin_0 = vec3(float(idx_0), 0.00000000000000000000, 0.00000000000000000000);
+ ray_0.Origin_0 = vec3(_S5, 0.00000000000000000000, 0.00000000000000000000);
ray_0.TMin_0 = 0.00999999977648258209;
ray_0.Direction_0 = vec3(0.00000000000000000000, 1.00000000000000000000, 0.00000000000000000000);
ray_0.TMax_0 = 10000.00000000000000000000;
- RayDesc_0 _S5 = ray_0;
+ RayDesc_0 _S6 = ray_0;
p_0 = someValues_0;
hitObjectNV hitObj_0;
- hitObjectTraceRayNV(hitObj_0, scene_0, 20U, 255U, 0U, 4U, 0U, _S5.Origin_0, _S5.TMin_0, _S5.Direction_0, _S5.TMax_0, (0));
+ hitObjectTraceRayNV(hitObj_0, scene_0, 20U, 255U, 0U, 4U, 0U, _S6.Origin_0, _S6.TMin_0, _S6.Direction_0, _S6.TMax_0, (0));
uint r_1 = calcValue_0(hitObj_0);
reorderThreadNV(hitObj_0);
SomeValues_0 otherValues_0;
- SomeValues_0 _S6 = { idx_0 * -1, float(idx_0) * 4.00000000000000000000 };
- otherValues_0 = _S6;
+ SomeValues_0 _S7 = { idx_0 * -1, _S5 * 4.00000000000000000000 };
+ otherValues_0 = _S7;
HitObject_Invoke_0(scene_0, hitObj_0, otherValues_0);
- uint _S7 = calcValue_0(hitObj_0);
- uint r_2 = r_1 + _S7;
+ uint _S8 = calcValue_0(hitObj_0);
+ uint r_2 = r_1 + _S8;
reorderThreadNV(hitObj_0, uint(idx_0 & 3), 2U);
- SomeValues_0 _S8 = { idx_0 * -2, float(idx_0) * 8.00000000000000000000 };
- otherValues_0 = _S8;
+ SomeValues_0 _S9 = { idx_0 * -2, _S5 * 8.00000000000000000000 };
+ otherValues_0 = _S9;
HitObject_Invoke_0(scene_0, hitObj_0, otherValues_0);
- uint _S9 = calcValue_0(hitObj_0);
- uint r_3 = r_2 + _S9;
+ uint _S10 = calcValue_0(hitObj_0);
+ uint r_3 = r_2 + _S10;
reorderThreadNV(uint(idx_0 & 1), 1U);
- SomeValues_0 _S10 = { idx_0 * -4, float(idx_0) * 16.00000000000000000000 };
- otherValues_0 = _S10;
+ SomeValues_0 _S11 = { idx_0 * -4, _S5 * 16.00000000000000000000 };
+ otherValues_0 = _S11;
HitObject_Invoke_0(scene_0, hitObj_0, otherValues_0);
- uint _S11 = calcValue_0(hitObj_0);
- uint r_4 = r_3 + _S11;
+ uint _S12 = calcValue_0(hitObj_0);
+ uint r_4 = r_3 + _S12;
((outputBuffer_0)._data[(uint(idx_0))]) = r_4;
return;
}
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang.1.expected b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang.1.expected
index a86dc6aa7..f6f6f132d 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang.1.expected
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-motion-ray.slang.1.expected
@@ -70,19 +70,20 @@ void main()
int idx_0 = launchID_0.x;
int _S5 = idx_0 / 4;
float currentTime_0 = float(_S5);
- SomeValues_0 someValues_0 = { idx_0, float(idx_0) * 2.00000000000000000000 };
+ float _S6 = float(idx_0);
+ SomeValues_0 someValues_0 = { idx_0, _S6 * 2.00000000000000000000 };
RayDesc_0 ray_0;
- ray_0.Origin_0 = vec3(float(idx_0), 0.00000000000000000000, 0.00000000000000000000);
+ ray_0.Origin_0 = vec3(_S6, 0.00000000000000000000, 0.00000000000000000000);
ray_0.TMin_0 = 0.00999999977648258209;
ray_0.Direction_0 = vec3(0.00000000000000000000, 1.00000000000000000000, 0.00000000000000000000);
ray_0.TMax_0 = 10000.00000000000000000000;
- RayDesc_0 _S6 = ray_0;
+ RayDesc_0 _S7 = ray_0;
p_0 = someValues_0;
hitObjectNV hitObj_0;
- hitObjectTraceRayMotionNV(hitObj_0, scene_0, 20U, 255U, 0U, 4U, 0U, _S6.Origin_0, _S6.TMin_0, _S6.Direction_0, _S6.TMax_0, currentTime_0, (0));
- uint _S7 = uint(idx_0);
- uint _S8 = calcValue_0(hitObj_0);
- ((outputBuffer_0)._data[(_S7)]) = _S8;
+ hitObjectTraceRayMotionNV(hitObj_0, scene_0, 20U, 255U, 0U, 4U, 0U, _S7.Origin_0, _S7.TMin_0, _S7.Direction_0, _S7.TMax_0, currentTime_0, (0));
+ uint _S8 = uint(idx_0);
+ uint _S9 = calcValue_0(hitObj_0);
+ ((outputBuffer_0)._data[(_S8)]) = _S9;
return;
}
diff --git a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang.1.expected b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang.1.expected
index 38ddbf233..16099b5e2 100644
--- a/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang.1.expected
+++ b/tests/hlsl-intrinsic/shader-execution-reordering/hit-object-trace-ray.slang.1.expected
@@ -67,19 +67,20 @@ void main()
ivec2 launchID_0 = ivec2(_S3.xy);
uvec3 _S4 = ((gl_LaunchSizeEXT));
int idx_0 = launchID_0.x;
- SomeValues_0 someValues_0 = { idx_0, float(idx_0) * 2.00000000000000000000 };
+ float _S5 = float(idx_0);
+ SomeValues_0 someValues_0 = { idx_0, _S5 * 2.00000000000000000000 };
RayDesc_0 ray_0;
- ray_0.Origin_0 = vec3(float(idx_0), 0.00000000000000000000, 0.00000000000000000000);
+ ray_0.Origin_0 = vec3(_S5, 0.00000000000000000000, 0.00000000000000000000);
ray_0.TMin_0 = 0.00999999977648258209;
ray_0.Direction_0 = vec3(0.00000000000000000000, 1.00000000000000000000, 0.00000000000000000000);
ray_0.TMax_0 = 10000.00000000000000000000;
- RayDesc_0 _S5 = ray_0;
+ RayDesc_0 _S6 = ray_0;
p_0 = someValues_0;
hitObjectNV hitObj_0;
- hitObjectTraceRayNV(hitObj_0, scene_0, 20U, 255U, 0U, 4U, 0U, _S5.Origin_0, _S5.TMin_0, _S5.Direction_0, _S5.TMax_0, (0));
- uint _S6 = uint(idx_0);
- uint _S7 = calcValue_0(hitObj_0);
- ((outputBuffer_0)._data[(_S6)]) = _S7;
+ hitObjectTraceRayNV(hitObj_0, scene_0, 20U, 255U, 0U, 4U, 0U, _S6.Origin_0, _S6.TMin_0, _S6.Direction_0, _S6.TMax_0, (0));
+ uint _S7 = uint(idx_0);
+ uint _S8 = calcValue_0(hitObj_0);
+ ((outputBuffer_0)._data[(_S7)]) = _S8;
return;
}