-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fragment shader not writing to depth buffer correctly #314
Comments
I need to go back to the drawing board. The first instructions in BB0_4 is an OR, but I treated it like an AND. |
What will happen if change the sample function from texture to textureLod? |
After looking at it more, I believe the implicit lod is required for to see the problem. The However, after the code related to the first Does this sound right? |
After looking at it further, I believe that the "SI Whole Quad Mode" is not complete. Non uniform control flow will cause a work group that is in whole quad mode to no longer be in whole quad mode because part of a quad could go one way and the rest another. However, there is no instruction to put it back into whole quad mode. I can take a look at it next week if nobody is looking at it yet. Here is another example:
|
Here is the code that llpc generates for the new example
|
The "SI Whole Quad Mode" implementation currently only supports Vulkan's model of implicit derivatives. The behaviour of these is only defined for uniform control flow. From SPIRV 1.5 spec.:
I haven't stared hard at the shader here, but I suspect this limitation might be what you are running into. |
If this is the case, then you probably need to be using the |
Thanks for the explanation. That sound exactly like what is going on. This was an hlsl shader being compiled for Vulkan instead of directx. I now think this should be fixed in DXC. It should generate the new instruction instead of an OpKill. Also the pass you are looking at writing might be better in spirv-tools. It could be used by anybody instead of being specific to AMD hardware. I'll see if it will be needed on our side. |
I have noticed a shader that does not write to the depth buffer correctly. It seems like two OpKills with a load of an image are needed. I find it very odd that the load of the image makes a difference.
I will attached a reduced version of the spir-v, and the gcn that was generated. In the gcn, there is a sample trace through the code that shows the problem. Please let me know if I have misunderstood any of the instructions. I'm still learning gcn.
The text was updated successfully, but these errors were encountered: