summaryrefslogtreecommitdiff
path: root/tests/bugs/vk-structured-buffer-load.hlsl.glsl
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-02-24 10:01:47 -0800
committerGitHub <noreply@github.com>2023-02-24 10:01:47 -0800
commitbd6306cdaa4a49344658bd026721b6532e103d09 (patch)
treebb7f666d426e6cfc7777a3ccac0a1d628588eb39 /tests/bugs/vk-structured-buffer-load.hlsl.glsl
parente8c08e7ecb1124f115a1d1042277776193122b57 (diff)
More control flow simplifications. (#2673)
* More control flow and Phi param simplifications. * Fix. * Fix gcc error. * Fix. * More IR cleanup. * Fix bug in phi param dce + ifelse simplify. * Propagate and DCE side-effect-free functions. * Enhance CFG simplifcation to remove loops with no side effects. * Fix. * Fixes. * Fix tests. Add [__AlwaysFoldIntoUseSite] for rayPayloadLocation. * More cleanup. * Fixes. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/bugs/vk-structured-buffer-load.hlsl.glsl')
-rw-r--r--tests/bugs/vk-structured-buffer-load.hlsl.glsl27
1 files changed, 3 insertions, 24 deletions
diff --git a/tests/bugs/vk-structured-buffer-load.hlsl.glsl b/tests/bugs/vk-structured-buffer-load.hlsl.glsl
index 7f3ec40a2..1d056944a 100644
--- a/tests/bugs/vk-structured-buffer-load.hlsl.glsl
+++ b/tests/bugs/vk-structured-buffer-load.hlsl.glsl
@@ -1,15 +1,10 @@
-// vk-structured-buffer-load.hlsl.glsl
-//TEST_IGNORE_FILE:
-
#version 460
#extension GL_NV_ray_tracing : require
layout(row_major) uniform;
layout(row_major) buffer;
-
layout(std430, binding = 1) readonly buffer _S1 {
float _data[];
} gParamBlock_sbuf_0;
-
float rcp_0(float x_0)
{
float _S2 = 1.0 / x_0;
@@ -36,37 +31,21 @@ void main()
_S3.PackedHitInfoA_0.x = HitT_0;
float offsfloat_0 = ((gParamBlock_sbuf_0)._data[(0)]);
-
uint use_rcp_0 = 0U | uint(HitT_0 > 0.0);
-
if(use_rcp_0 != 0U)
{
-
- float _S5 = rcp_0(offsfloat_0);
-
- _S3.PackedHitInfoA_0.y = _S5;
-
+ _S3.PackedHitInfoA_0.y = rcp_0(offsfloat_0);
}
else
{
-
if(use_rcp_0 > 0U&&offsfloat_0 == 0.0)
{
-
- float _S6 = (inversesqrt((offsfloat_0 + 1.0)));
-
- _S3.PackedHitInfoA_0.y = _S6;
-
+ _S3.PackedHitInfoA_0.y = (inversesqrt((offsfloat_0 + 1.0)));
}
else
{
- float _S7 = (inversesqrt((offsfloat_0)));
-
- _S3.PackedHitInfoA_0.y = _S7;
-
+ _S3.PackedHitInfoA_0.y = (inversesqrt((offsfloat_0)));
}
-
}
-
return;
}