diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-23 16:59:02 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-23 16:59:02 -0700 |
| commit | 50e7d9797d9bf4b98a056d5df128c24dde6e78bd (patch) | |
| tree | 3e6e4491b1b6512280adff1d69a93ccaf50f6bb3 /tests/bugs/vk-structured-buffer-load.hlsl.glsl | |
| parent | 85f005888cadeb4b1d957b57a86cbad6cc9ea313 (diff) | |
Fix optimization pass not converging. (#2725)
* Fix optimization pass not converging.
* Fix.
* Fix tests.
---------
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.glsl | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/bugs/vk-structured-buffer-load.hlsl.glsl b/tests/bugs/vk-structured-buffer-load.hlsl.glsl index 1d056944a..0184e6ed5 100644 --- a/tests/bugs/vk-structured-buffer-load.hlsl.glsl +++ b/tests/bugs/vk-structured-buffer-load.hlsl.glsl @@ -7,8 +7,7 @@ layout(std430, binding = 1) readonly buffer _S1 { } gParamBlock_sbuf_0; float rcp_0(float x_0) { - float _S2 = 1.0 / x_0; - return _S2; + return 1.0 / x_0; } struct RayHitInfoPacked_0 @@ -16,35 +15,35 @@ struct RayHitInfoPacked_0 vec4 PackedHitInfoA_0; }; -rayPayloadInNV RayHitInfoPacked_0 _S3; +rayPayloadInNV RayHitInfoPacked_0 _S2; struct BuiltInTriangleIntersectionAttributes_0 { vec2 barycentrics_0; }; -hitAttributeNV BuiltInTriangleIntersectionAttributes_0 _S4; +hitAttributeNV BuiltInTriangleIntersectionAttributes_0 _S3; void main() { float HitT_0 = ((gl_RayTmaxNV)); - _S3.PackedHitInfoA_0.x = HitT_0; + _S2.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) { - _S3.PackedHitInfoA_0.y = rcp_0(offsfloat_0); + _S2.PackedHitInfoA_0.y = rcp_0(offsfloat_0); } else { if(use_rcp_0 > 0U&&offsfloat_0 == 0.0) { - _S3.PackedHitInfoA_0.y = (inversesqrt((offsfloat_0 + 1.0))); + _S2.PackedHitInfoA_0.y = (inversesqrt((offsfloat_0 + 1.0))); } else { - _S3.PackedHitInfoA_0.y = (inversesqrt((offsfloat_0))); + _S2.PackedHitInfoA_0.y = (inversesqrt((offsfloat_0))); } } return; |
