diff options
| author | Yong He <yonghe@outlook.com> | 2023-02-24 10:01:47 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-24 10:01:47 -0800 |
| commit | bd6306cdaa4a49344658bd026721b6532e103d09 (patch) | |
| tree | bb7f666d426e6cfc7777a3ccac0a1d628588eb39 /tests/bugs | |
| parent | e8c08e7ecb1124f115a1d1042277776193122b57 (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')
| -rw-r--r-- | tests/bugs/sample-grad-clamp-lod.slang.glsl | 6 | ||||
| -rw-r--r-- | tests/bugs/vk-structured-buffer-load.hlsl.glsl | 27 |
2 files changed, 6 insertions, 27 deletions
diff --git a/tests/bugs/sample-grad-clamp-lod.slang.glsl b/tests/bugs/sample-grad-clamp-lod.slang.glsl index b91fb8668..a49983599 100644 --- a/tests/bugs/sample-grad-clamp-lod.slang.glsl +++ b/tests/bugs/sample-grad-clamp-lod.slang.glsl @@ -20,10 +20,10 @@ rayPayloadInEXT ShadowRay_0 _S1; void main() { - vec4 val_0 = (textureGradOffsetClampARB(sampler2DArray(t2D_0,samplerState_0), (vec3(_S1.hitDistance_0 * 0.20000000000000001110, _S1.hitDistance_0 * 0.29999999999999998890, 0.20000000000000001110)), (vec2(float(0), float(0))), (vec2(float(0), float(0))), (ivec2(0)), (0.50000000000000000000))); + const vec2 _S2 = vec2(0.0, 0.0); - float _S2 = dot(val_0, val_0); + vec4 val_0 = (textureGradOffsetClampARB(sampler2DArray(t2D_0,samplerState_0), (vec3(_S1.hitDistance_0 * 0.20000000298023223877, _S1.hitDistance_0 * 0.30000001192092895508, 0.20000000298023223877)), (_S2), (_S2), (ivec2(0)), (0.5))); - _S1.hitDistance_0 = _S2; + _S1.hitDistance_0 = dot(val_0, val_0); return; } 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; } |
