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

HLSL and GLSL barrier is not equivalent #4

Open
Duttenheim opened this issue Mar 23, 2021 · 1 comment
Open

HLSL and GLSL barrier is not equivalent #4

Duttenheim opened this issue Mar 23, 2021 · 1 comment

Comments

@Duttenheim
Copy link

Duttenheim commented Mar 23, 2021

Hi!

I just have a minor concern/question regarding the memory barriers in the HLSL and GLSL versions. In HLSL, you call GroupMemoryBarrierWithGroupSync(), but in GLSL you only call barrier(). I believe the GLSL corresponding pattern to GroupMemoryBarrierWithGroupSync() is actually a groupMemoryBarrier() + barrier(), as the first guards against memory writes and the second thread.

It's not entirely clear from the spec if a groupMemoryBarrier() blocks execution as well, or if a barrier() also blocks memory writes, but I used this https://anteru.net/blog/2016/mapping-between-HLSL-and-GLSL/ as my reference point and it solved many similar issues on different vendors before.

However be wary, there seems to be an issue with nvidia GPUs in the 20xx-30xx range with this shader when running with both barriers as suggested by the reference - resulting in a GPU hang.

@loveadguard
Copy link

你好,这个数据库貌似只是一个储存数据的地方,他们只是注册一个帐号然后上传部分数据,这个问题应该不出意外是绝对不会有人来恢复的

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

2 participants