anv: Add a helper for working with VK_WHOLE_SIZE for buffers

Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
This commit is contained in:
Jason Ekstrand
2017-03-04 10:07:56 -08:00
parent f805593b12
commit d36b463817
4 changed files with 28 additions and 11 deletions

View File

@@ -672,10 +672,9 @@ anv_descriptor_set_write_buffer(struct anv_descriptor_set *set,
/* For buffers with dynamic offsets, we use the full possible range in the
* surface state and do the actual range-checking in the shader.
*/
if (bind_layout->dynamic_offset_index >= 0 || range == VK_WHOLE_SIZE)
bview->range = buffer->size - offset;
else
bview->range = range;
if (bind_layout->dynamic_offset_index >= 0)
range = VK_WHOLE_SIZE;
bview->range = anv_buffer_get_range(buffer, offset, range);
/* If we're writing descriptors through a push command, we need to allocate
* the surface state from the command buffer. Otherwise it will be