-
Notifications
You must be signed in to change notification settings - Fork 793
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 to SPIRV descriptor set #4
Comments
Assuming that I understand your question correctly: Shader resource binding is already implemented. Here's how it works: Step 1 - Descriptor set layoutFor each shader, a list of resource slots that are used by the shader is stored. So if a vertex shader uses constant buffer Let's assume you render your scene with a vertex shader which uses constant buffer
Again, this binding mapping is stored. The descriptor set layout will be used to create a pipeline layout, there are no additional descriptor set layouts. Step 2 - Descriptor set allocationThere is a descriptor set allocator tied to the command buffer, which automatically creates descriptor pools when needed. The descriptor pools don't really care about the pipeline layout, they just have a fixed number of descriptors of each type, and are created in a way that descriptor sets cannot be freed individually. Each time a draw call is executed, if a new resource has been bound or if the shader pipeline itself has changed, a new descriptor set is created and immediately updated with Now in reality, there's another level of indirection because all D3D stuff goes through an intermediate layer first (which does all the heavy lifting), but the explanation is still valid since a pixel shader's src/dxvk/dxvk_descriptor.cpp |
Thanks for the answer, thus means you have only one unique descriptor set, my question was about multiple descriptor set introduced in vulkan but one set works as well. Thanks |
Hi,
Excellent work tho, how do you plan to map the hlsl register into vulkan descriptor set?
Or you plan to have one unique descriptor set for shader?
The text was updated successfully, but these errors were encountered: