mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Add common shortcut to write a GPUBuffer to a storage descriptor
This commit is contained in:
@@ -379,6 +379,30 @@ void GPUBuffer::Unmap()
|
||||
ObjDisp(device)->UnmapMemory(Unwrap(device), mem);
|
||||
}
|
||||
|
||||
void GPUBuffer::WriteDescriptor(VkDescriptorSet unwrappedDescSet, uint32_t destBinding,
|
||||
uint32_t destArrayElement)
|
||||
{
|
||||
// vkUpdateDescriptorSet desc set to point to buffer
|
||||
VkDescriptorBufferInfo desc = {0};
|
||||
|
||||
FillDescriptor(desc);
|
||||
|
||||
VkWriteDescriptorSet write = {
|
||||
VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
|
||||
NULL,
|
||||
unwrappedDescSet,
|
||||
destBinding,
|
||||
destArrayElement,
|
||||
1,
|
||||
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
|
||||
NULL,
|
||||
&desc,
|
||||
NULL,
|
||||
};
|
||||
|
||||
ObjDisp(device)->UpdateDescriptorSets(Unwrap(device), 1, &write, 0, NULL);
|
||||
}
|
||||
|
||||
bool VkInitParams::IsSupportedVersion(uint64_t ver)
|
||||
{
|
||||
if(ver == CurrentVersion)
|
||||
|
||||
@@ -220,6 +220,8 @@ struct GPUBuffer
|
||||
const VkDeviceMemory &UnwrappedMemory() const { return mem; }
|
||||
|
||||
void FillDescriptor(VkDescriptorBufferInfo &desc);
|
||||
void WriteDescriptor(VkDescriptorSet unwrappedDescSet, uint32_t destBinding,
|
||||
uint32_t destArrayElement);
|
||||
|
||||
VkDeviceAddress Address() const { return addr; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user