diff options
| author | Robert Stepinski <rob.stepinski@gmail.com> | 2019-05-01 12:33:50 -0400 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-05-01 09:33:50 -0700 |
| commit | 88a3f6476c37f3245de6d607d8055879f8892ee4 (patch) | |
| tree | a0fbe01fae015014a4b7e17305ff9d0a451d0f55 /tests | |
| parent | 4880789e3003441732cca4471091563f36531635 (diff) | |
Fix bitwise And & Or for scalar bool (#960)
* Convert bitwise Or & And to logical operations on scalar bools
* Test bitwise operations on scalar bools
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/vk-structured-buffer-load.hlsl | 2 | ||||
| -rw-r--r-- | tests/bugs/vk-structured-buffer-load.hlsl.glsl | 21 |
2 files changed, 19 insertions, 4 deletions
diff --git a/tests/bugs/vk-structured-buffer-load.hlsl b/tests/bugs/vk-structured-buffer-load.hlsl index a5f518f93..bd5d16882 100644 --- a/tests/bugs/vk-structured-buffer-load.hlsl +++ b/tests/bugs/vk-structured-buffer-load.hlsl @@ -28,6 +28,8 @@ void HitMain(inout RayHitInfoPacked RayData, BuiltInTriangleIntersectionAttribut if (use_rcp) RayData.PackedHitInfoA.y = rcp(offsfloat); + else if ((use_rcp > 0) & (offsfloat == 0.0)) + RayData.PackedHitInfoA.y = rsqrt(offsfloat + 1.0); else RayData.PackedHitInfoA.y = rsqrt(offsfloat); } diff --git a/tests/bugs/vk-structured-buffer-load.hlsl.glsl b/tests/bugs/vk-structured-buffer-load.hlsl.glsl index 206a25ef0..016e49b25 100644 --- a/tests/bugs/vk-structured-buffer-load.hlsl.glsl +++ b/tests/bugs/vk-structured-buffer-load.hlsl.glsl @@ -33,9 +33,9 @@ void main() float offsfloat_0 = ((gParamBlock_sbuf_0)._data[(int(uint(0)))]); + uint use_rcp_1 = use_rcp_0|uint(HitT_0 > 0.00000000000000000000); - - if(bool(use_rcp_0 | uint(HitT_0 > 0.00000000000000000000))) + if(bool(use_rcp_1)) { float _S4 = (1.0/((offsfloat_0))); @@ -45,9 +45,22 @@ void main() } else { - float _S5 = (inversesqrt((offsfloat_0))); - _S2.PackedHitInfoA_0.y = _S5; + if(use_rcp_1 > uint(0)&&offsfloat_0 == 0.00000000000000000000) + { + + float _S5 = (inversesqrt((offsfloat_0 + 1.00000000000000000000))); + + _S2.PackedHitInfoA_0.y = _S5; + + } + else + { + float _S6 = (inversesqrt((offsfloat_0))); + + _S2.PackedHitInfoA_0.y = _S6; + + } } |
