Skip to content
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

Issue with RelaxedPrecision(half) on Vulkan #57

Open
aki577 opened this issue Sep 23, 2024 · 0 comments
Open

Issue with RelaxedPrecision(half) on Vulkan #57

aki577 opened this issue Sep 23, 2024 · 0 comments

Comments

@aki577
Copy link

aki577 commented Sep 23, 2024

Unity: 2021.3.17 f1
Graphic API: Vulkan
Render Pipeline: URP
To whom it may concern,
Hi all!
I am encountering a strange issue with UV flow timing in my shader. I am passing 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. Interestingly, when I change the precision from half to float, the issue is resolved. 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]] qualifier disappears and the issue is gone too. Additionally, switching to OpenGL or other APIs resolves the problem as well. Does anyone have insight into why this happens?
Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant