Skip to content

[vulkan] Add a buffer index offset to support crops at arbitrary alignments #8944

@derek-gerstmann

Description

@derek-gerstmann

Currently, the way device crops are handled in the vulkan runtime assumes that the offset provided is aligned. However, this may not be the case if the minStorageBufferOffsetAlignment is larger than the size of the scalar value representing a channel.

To avoid alignment constraints and support arbitrary crops, we can add an index offset parameter in CodeGen_Vulkan which is passed for all storage buffers and used for all read/write calls.

In the runtime, the shader binding interface will need to provide this index offset to the UBO parameter buffer for all storage buffers.

Finally, for buffer_copy, the byte offsets for src & dst will need to be modified to take the index offset into account. Fortunately, it appears there isn't an alignment restriction on vkCmdBufferCopy so only the offsets will need to get adjusted.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions