-
Notifications
You must be signed in to change notification settings - Fork 169
Vulkan push constant support, based on #728 #729
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
base: inline_constants
Are you sure you want to change the base?
Vulkan push constant support, based on #728 #729
Conversation
…URCE_FLAG_INLINE_CONSTANTS flag (DiligentGraphics#672)
…hen remapping resources (DiligentGraphics#672)
That was me manipulating Following changes were applied:
|
|
Why does |
cuz it depends on : some odd shenanigans need to done to our CMakeLists.txt to access SPIRV-Tools's private headers |
…O_HLSL defined or not
…ts), cuz we no longer filter out push constants when creating layout.
Following changes were applied:
|
|
Looks like everything works now - this is really nice. 👍 Thanks for working on this! Only the size of this PR got out of hands - merging change this big is very difficult. |
|
#733 is merged - this is very good, thank you. The next step is to add SPIRV patching to convert uniform block to push constants. |
| VIRTUAL void METHOD(SetPushConstants)(THIS_ | ||
| const void* pData, | ||
| Uint32 Offset, | ||
| Uint32 Size) PURE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is not needed. If the app wants to use Vulkan directly, it can request command buffer with GetVkCommandBuffer and then set push constants or do anything it needs.
cd07435 to
5434a10
Compare
03287fc to
e256723
Compare
HLSL prefix:
[[vk::push_constant]]GLSL counterpart prefix:
layout(push_constant)Note that I added a new flag
PIPELINE_RESOURCE_FLAG_VULKAN_PUSH_CONSTANTto indicate that a inline constant is a "vulkan push constant".I don't find a way to avoid explicitly specifying because it is not possible to determine whether a inline constant is a vulkan push constant or not in
PipelineResourceSignaturecreation (SPIRV is not available there).As for legacy ResourceLayout, it's okay to have
SHADER_VARIABLE_FLAG_INLINE_CONSTANTSwithout explicitly specifying vulkan stuffs for vulkan push constant, the flagPIPELINE_RESOURCE_FLAG_VULKAN_PUSH_CONSTANTwill be automatically added to signature inInitDefaultSignatureAlso added a new API
SetPushConstantstoIDeviceContextVkto expose the underlying APIvkCmdPushConstantsdirectly to user.Tested with #724, working fine so far, with either
USE_STATIC_INLINE_CONSTANTSon / off,USE_VULKAN_PUSH_CONSTANTon / off,USE_PRS_TESTon / off.overall doc: https://github.com/hzqst/DiligentCore/blob/vk_push_constants/doc/SetInlineConstants.md#vulkan-backend-implementation
TODO: the APITest on linux shows that InlineConstantTest image diffs from reference, further investigation needed. maybe issue with multiple dynamic-buffer-emulated inline constant?fixed