-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan CTS has failed tests dEQP-VK.glsl.conversions.*to_bvec* at version 4d286aa of SLANG #6466
Comments
I think 19867ff is likely the offending commit. |
My guess is that PR accidentally deleted conversion operator to convert between bool and float vectors. We should try compile the glsl in the test and see what is happening. |
This is the IR emitted before this change:
And after:
I'm also attaching the GLSL shader, SPIR-V and the complete IR. |
The two code here is equivalent. Why do we need to care the IR and SPIRV, if the result from running the code is the same? |
They are not equivalent. To get a better context, please refer to the archived IR and SPIR-V. |
I looked at the SPIRV and IR. Why is it not equivalent? |
In what situation will the invariant |
Aha, I see what you mean. I thought I had posted the same files. I guess the issue is at the SPIR-V site: The good:
The bad:
|
The original one (the good):
The bad one:
According to the GLSL specification, when converting from floating-point values to boolean values, the conversion should be done by comparing the float value with 0.0. A float is converted to true if it's non-zero, and false if it's zero. When converting from float or double to bool, the result is false if the float or double operand is 0.0 or 0.0f, respectively, and true otherwise. Float-to-int conversion truncates the fractional part
This violates the GLSL specification and would cause incorrect behavior in shaders that rely on proper boolean conversion semantics. I'm still doing more SLANG debugging on this. |
OK, we need to fix our implementation in peephole-optimize pass when lowering BuiltinCast. |
#6497 is a potential fix for this. I am doing this in a hurry to get this into the next VulkanSDK release. |
Thank you for the fix, @csyonghe!!! |
Failed at 4d286aa
Last passed version of slag 187ec44
2025-02-26T07:12:11.3535770Z Test case 'dEQP-VK.glsl.conversions.scalar_to_vector.float_to_bvec2_vertex'..
2025-02-26T07:12:11.5171085Z Fail (Got invalid pixels at sub-case 4)
2025-02-26T07:12:11.5173612Z Test case 'dEQP-VK.glsl.conversions.scalar_to_vector.float_to_bvec2_fragment'..
2025-02-26T07:12:11.6532456Z Fail (Got invalid pixels at sub-case 4)
2025-02-26T07:12:11.6533868Z Test case 'dEQP-VK.glsl.conversions.scalar_to_vector.float_to_bvec3_vertex'..
2025-02-26T07:12:11.7388516Z Fail (Got invalid pixels at sub-case 4)
2025-02-26T07:12:11.7390024Z Test case 'dEQP-VK.glsl.conversions.scalar_to_vector.float_to_bvec3_fragment'..
2025-02-26T07:12:11.8731731Z Fail (Got invalid pixels at sub-case 4)
2025-02-26T07:12:11.8733192Z Test case 'dEQP-VK.glsl.conversions.scalar_to_vector.float_to_bvec4_vertex'..
2025-02-26T07:12:12.0239929Z Fail (Got invalid pixels at sub-case 4)
2025-02-26T07:12:12.0241373Z Test case 'dEQP-VK.glsl.conversions.scalar_to_vector.float_to_bvec4_fragment'..
2025-02-26T07:12:12.1600926Z Fail (Got invalid pixels at sub-case 4)
2025-02-26T07:12:21.4928009Z Test case 'dEQP-VK.glsl.conversions.vector_to_vector.vec4_to_bvec4_vertex'..
2025-02-26T07:12:21.5714246Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:21.5715672Z Test case 'dEQP-VK.glsl.conversions.vector_to_vector.vec4_to_bvec4_fragment'..
2025-02-26T07:12:21.6984701Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:21.6986141Z Test case 'dEQP-VK.glsl.conversions.vector_to_vector.vec4_to_bvec3_vertex'..
2025-02-26T07:12:21.7757189Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:21.7759001Z Test case 'dEQP-VK.glsl.conversions.vector_to_vector.vec4_to_bvec3_fragment'..
2025-02-26T07:12:21.9090453Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:21.9091915Z Test case 'dEQP-VK.glsl.conversions.vector_to_vector.vec4_to_bvec2_vertex'..
2025-02-26T07:12:21.9863370Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:21.9864773Z Test case 'dEQP-VK.glsl.conversions.vector_to_vector.vec4_to_bvec2_fragment'..
2025-02-26T07:12:22.1222691Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:37.0049381Z Test case 'dEQP-VK.glsl.conversions.vector_to_vector.vec2_to_bvec2_vertex'..
2025-02-26T07:12:37.0823086Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:37.0824651Z Test case 'dEQP-VK.glsl.conversions.vector_to_vector.vec2_to_bvec2_fragment'..
2025-02-26T07:12:37.2095768Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:40.1072880Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec2_vec2_to_bvec4_vertex'..
2025-02-26T07:12:40.1625681Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:40.1627787Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec2_vec2_to_bvec4_fragment'..
2025-02-26T07:12:40.2898441Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:44.5315078Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec2_ivec2_to_bvec4_vertex'..
2025-02-26T07:12:44.5845151Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:44.5846593Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec2_ivec2_to_bvec4_fragment'..
2025-02-26T07:12:44.6896144Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:45.0443722Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec2_bvec2_to_bvec4_vertex'..
2025-02-26T07:12:45.0980805Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:45.0983251Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec2_bvec2_to_bvec4_fragment'..
2025-02-26T07:12:45.2005462Z Fail (Got invalid pixels at sub-case 0)
2025-02-26T07:12:46.1564666Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec3_float_to_bvec4_vertex'..
2025-02-26T07:12:46.2330363Z Fail (Got invalid pixels at sub-case 1)
2025-02-26T07:12:46.2332211Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec3_float_to_bvec4_fragment'..
2025-02-26T07:12:46.3589818Z Fail (Got invalid pixels at sub-case 1)
2025-02-26T07:12:54.0154945Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec2_bool_to_bvec3_vertex'..
2025-02-26T07:12:54.0689288Z Fail (Got invalid pixels at sub-case 1)
2025-02-26T07:12:54.0690749Z Test case 'dEQP-VK.glsl.conversions.vector_combine.vec2_bool_to_bvec3_fragment'..
2025-02-26T07:12:54.1942932Z Fail (Got invalid pixels at sub-case 1)
The text was updated successfully, but these errors were encountered: