diff options
author | Jason Ekstrand <[email protected]> | 2017-03-04 10:07:56 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-03-13 07:57:03 -0700 |
commit | d36b46381754607f954c2cb6ee3843a84d6ca991 (patch) | |
tree | 9ae17769a993afad484ad9d5ad8e52f6c36349dd /src/intel/vulkan/anv_private.h | |
parent | f805593b129729e516dea30245612b6a49b8505a (diff) |
anv: Add a helper for working with VK_WHOLE_SIZE for buffers
Reviewed-by: Plamena Manolova <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 38554166570..5fb0c264f6f 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1082,6 +1082,18 @@ struct anv_buffer { VkDeviceSize offset; }; +static inline uint64_t +anv_buffer_get_range(struct anv_buffer *buffer, uint64_t offset, uint64_t range) +{ + assert(offset <= buffer->size); + if (range == VK_WHOLE_SIZE) { + return buffer->size - offset; + } else { + assert(range <= buffer->size); + return range; + } +} + enum anv_cmd_dirty_bits { ANV_CMD_DIRTY_DYNAMIC_VIEWPORT = 1 << 0, /* VK_DYNAMIC_STATE_VIEWPORT */ ANV_CMD_DIRTY_DYNAMIC_SCISSOR = 1 << 1, /* VK_DYNAMIC_STATE_SCISSOR */ |