diff options
author | Jason Ekstrand <[email protected]> | 2015-10-15 13:45:53 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-10-15 13:45:53 -0700 |
commit | bed7d1e03cfb03148e65566d299430063e90a47a (patch) | |
tree | a38a362f4c269c7f9add85530bed6e154a90ea02 /src/vulkan/anv_device.c | |
parent | 6dc4cad994ca03b71f99b79856d8d8ff5cf3ed83 (diff) |
anv: Add support for BufferInfo in descriptor sets
Diffstat (limited to 'src/vulkan/anv_device.c')
-rw-r--r-- | src/vulkan/anv_device.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index 98c1b2334e6..cc9ead86e73 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -1698,13 +1698,28 @@ void anv_UpdateDescriptorSets( case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: for (uint32_t j = 0; j < write->count; j++) { - ANV_FROM_HANDLE(anv_buffer_view, bview, - write->pDescriptors[j].bufferView); - - set->descriptors[write->destBinding + j] = (struct anv_descriptor) { - .type = ANV_DESCRIPTOR_TYPE_BUFFER_VIEW, - .buffer_view = bview, - }; + if (write->pDescriptors[j].bufferView.handle) { + ANV_FROM_HANDLE(anv_buffer_view, bview, + write->pDescriptors[j].bufferView); + + set->descriptors[write->destBinding + j] = + (struct anv_descriptor) { + .type = ANV_DESCRIPTOR_TYPE_BUFFER_VIEW, + .buffer_view = bview, + }; + } else { + ANV_FROM_HANDLE(anv_buffer, buffer, + write->pDescriptors[j].bufferInfo.buffer); + assert(buffer); + + set->descriptors[write->destBinding + j] = + (struct anv_descriptor) { + .type = ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET, + .buffer = buffer, + .offset = write->pDescriptors[j].bufferInfo.offset, + .range = write->pDescriptors[j].bufferInfo.range, + }; + } } default: |