mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Struct array stride is only 16-aligned for cbuffers in D3D. Closes #2441
This commit is contained in:
@@ -59,7 +59,11 @@ static ShaderConstantType MakeShaderConstantType(bool cbufferPacking, DXBC::CBuf
|
||||
{
|
||||
uint32_t stride = type.descriptor.bytesize / RDCMAX(1U, type.descriptor.elements);
|
||||
RDCASSERTMSG("Stride is too large for uint16_t", stride <= 0xffff);
|
||||
ret.descriptor.arrayByteStride = AlignUp16(RDCMIN(stride, 0xffffu) & 0xffff);
|
||||
|
||||
ret.descriptor.arrayByteStride = RDCMIN(stride, 0xffffu) & 0xffff;
|
||||
// in D3D only cbuffers have 16-byte aligned structs
|
||||
if(cbufferPacking)
|
||||
ret.descriptor.arrayByteStride = AlignUp16(ret.descriptor.arrayByteStride);
|
||||
|
||||
ret.descriptor.rows = ret.descriptor.columns = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user