-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
[Vulkan] Setting a ClearValue that includes ClearColorValue and ClearDepthStencilValue has weird effects #2360
Comments
This is correct. More info: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkRenderPassBeginInfo.html |
That makes a lot of sense and I probably should have read the spec more carefully. :) The fact that Silk technically does not behave according to spec (values are ignored vs. their presence breaks the intended behavior) is probably acceptable in this case and more of a known idiosyncrasy than something to waste effort on... |
It's a union so writes to Color will overwrite values in DepthStencil - equivalent C code behaves the same way. The spec wording is interesting here. |
One small addendum I just noticed: The code from above (minus the depth/stencil info) does create a black clear on Windows as expected. However, the same code seems to create a transparent clear instead on MacOS. Probably something related to MoltenVK and also probably wrong usage somewhere on my part again but I figured I mention it in case somebody else stumbles upon this topic. :) (if I figure out where the difference comes from, I'll update here) |
Ok, I’m closing this though as Silk.NET seems to be doing everything right here. Feel free to reopen if there is a C vs C# discrepancy though. |
I'm not sure if this is an actual issue or I am using the structs wrong.
What I am doing is the following, which should lead to a black clear:
However, the clear is red and the only way to get it to actually be whatever color is specified in the ClearColorValue is to remove the depth/stencil part. Looking into the Silk structs, I noticed the field offsets do seem odd, as in: They are both 0, so it might end up in arbitrary order when copied?
Again, not sure if this is actually an issue or the ClearValue is supposed to only be used with an either/or approach.
The text was updated successfully, but these errors were encountered: