google / amber

Amber is a multi-API shader test framework
Apache License 2.0
193 stars 65 forks source link

Add descriptor buffer offset and range #945

Closed ilkkasaa closed 3 years ago

ilkkasaa commented 3 years ago

We can already set the buffer offset for vertex buffer bindings using OFFSET argument in VERTEX_DATA command.

Same should be possible for uniform buffers. This could be implemented by adding DESCRIPTOR_OFFSET and DESCRIPTOR_RANGE argument to the BIND {BUFFER | BUFFER_ARRAY} command. Note that the OFFSET keyword is already used to set dynamic offset(s) for dynamic buffers, so we need to use DESCRIPTOR_ prefix.

These new arguments are used to set the members offset and range of Vulkan struct VkDescriptorBufferInfo.

The current implementation doesn't allow binding the same buffer into different array elements within one BIND BUFFER_ARRAY command. This should be allowed too.