Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.0
-
None
Description
Using ShaderEffect with a shader that has an ivec2 uniform, passing Qt.point() seems to pass the wrong value, with no warning/error.
It works properly with a vec2 uniform.
The attached project has a fragment shader conditionally compiled with an ivec2 uniform, or a vec2 uniform. The QML then passes in a Qt.point(1, 1) property for the uniform. The shader draws red if the uniform x is >=100.0, blue if >=1.0 else green.
It correcly draws blue when using vec2, and draws red when using ivec2.
Possibly it is passing the floating point binary representation of 1.0 as an integer into the uniform (which I think would be 1065353216). Yeah, confirmed this - if I change the test to >=1065353216 it still draws red, but >=1065353217 now draws blue.