Configurable ViewDependentState and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER LightData #1166
robertosfield
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have merged with VSG master support for configuring the types and layout of ViewDependetState using a new shaderSet member that users can set. The shaderSet defaults to builtin PBR ShaderSet if applications don't explictly set the ViewDependentState::shaderSet. As the PBR and Phong ShaderSet's both use the same layout for the lightData etc. this means even with this default Phong ShaderSet or custom ShaderSet that use this same layout will work fine.
The changes to the VSG that add this capability are: #1164.
What prompted this added flexibility was the need to test whether the lightData is based passed as a VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or VK_DESCRIPTOR_TYPE_STORAGE_BUFFER. Originally when I created the VSG's Cascaded Shadow Maps support in ViewDependentState I opted for VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER. Later I changed it VK_DESCRIPTOR_TYPE_STORAGE_BUFFER to avoid the need for explicitly declaring the size of the lightData in the shader. However, in testing shadows @AnyOldName3 and myself found a regression in performance which I confirmed for certain hardware/driver combinations, being able to easily toggle between the type types using this new flexible help confirm this performance delta.
Getting good performance out of the box is the aim of VSG project so I have decided to change the default type of the lightData back to VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, this required changing the ShaderSet and the associated shaders, it's not a major change which can be seen from the PR that merges these change into vsgExamples master: https://github.com/vsg-dev/vsgExamples/pull/306/files
I also updated the VSG's built-in ShaderSets: #1165
Beta Was this translation helpful? Give feedback.
All reactions