-
Make all descriptors 16-byte aligned. · bd54e075Nicolas Capens authored
Some SampledImageDescriptor members are assumed to be 16-byte aligned, such as the sw::Mipmap::pitchP member accessed by sampleFloat2D(). To guarantee this while descriptor sets can contain multiple types of descriptor, all descriptors are made a multiple of 16 bytes in size. Also, each descriptor set starts with a pointer to its layout, followed by the actual descriptor content. To ensure the latter is 16-byte aligned, the layout pointer was placed in a header structure which itself is 16-byte aligned and thus includes the necessary padding. The placement of the descriptor set itself is guaranteed to be 16-byte aligned by vk::REQUIRED_MEMORY_ALIGNMENT = 16 being used for descriptor pool allocation. Bug: b/129523279 Bug: b/123244275 Change-Id: I72fb92d9ff5a8d100d05f5b9e38170ade557d434 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29970 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com>
bd54e075
×