gpuav: Use push constant inside shader#12461
Open
Open
Conversation
Collaborator
|
CI Vulkan-ValidationLayers build queued with queue ID 5287. |
Collaborator
|
CI Vulkan-ValidationLayers build # 23620 running. |
Collaborator
|
CI Vulkan-ValidationLayers build # 23620 failed. |
arno-lunarg
approved these changes
Jun 16, 2026
|
|
||
| // will generate [OpCompositeConstruct, OpBitcast, OpConvertUToPtr] which should be fine as a compromise keeping the push_data in a uint array | ||
| uint64_t indirect_address = packUint2x32(uvec2(gpuav.push_data[push_offset], gpuav.push_data[push_offset + 1])); | ||
| uint64_t indirect_address = packUint2x32(uvec2(indirect_address_hi, indirect_address_low)); |
Contributor
There was a problem hiding this comment.
According to https://registry.khronos.org/OpenGL/extensions/ARB/ARB_gpu_shader_int64.txt
it should be uvec2(low, high), it is reversed here. But then it should have exploded somehow?
Contributor
There was a problem hiding this comment.
Ah yes looking at:
const uint32_t indirect_address_hi = GetInternalPushData(block, inst_it, push_offset);
const uint32_t indirect_address_low = GetInternalPushData(block, inst_it, push_offset + 1);high and low are inverted
| } | ||
|
|
||
| // Just currently always make a new one | ||
| const Type& TypeManager::GetTypeUntypedPointer(spv::StorageClass storage_class) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So this saves us from currently copying the entire push data/constant range EVERY draw/dispatch to a SSBO buffer... instead since we are in the shader, I just read the actual push constant data!
When the user has a
layout(push_constant)already, we can't create our own block and instead use Untyped pointers to do type punning... only issue (which will probably fail CI) is that you hit this VU in self validation
which I think is a bit non-sense so raised https://gitlab.khronos.org/vulkan/vulkan/-/issues/4869 to figure out what is "actually" allowed or not