Unity: 2021.3.17 f1
Graphic API: Vulkan
Render Pipeline: URP
Hi all!
I am encountering a strange issue with UV flow timing in my shader. I pass a custom half precision value (e.g., _Scale) to control the flow speed. My shader code looks like this: half4 color = SAMPLE_TEXTURE_2D(_Tex, _sampler_Tex, frac(_Time.y(or _Time.x * 20) * _Scale));
On certain devices, including some phones and PCs, the flow speed gradually slows down in 1 ~ 5 minutes. Interestingly, when I change the custom value precision from half to float, the issue is resolved. Additionally, switching to OpenGL or other APIs resolves the problem as well.
As I check the disassembled SPIR-V codes via RenderDoc, the only difference between correct and wrong shader is the code: float2 _388 = CompositeConstruct({_387, _387}) : [[RelaxedPrecision]];
When using float precision, the [[RelaxedPrecision]] decoration disappears and the issue is gone too. Does anyone have insight into why this happens?
Cheers.