Fix calculation of array stride on structs in D3D

# Conflicts:
#	util/test/tests/GL/GL_CBuffer_Zoo.py
This commit is contained in:
baldurk
2020-05-13 18:07:26 +01:00
parent 15fa728ab9
commit 78335f7d00
9 changed files with 162 additions and 22 deletions
@@ -66,7 +66,7 @@ static ShaderVariableType MakeShaderVariableType(DXBC::CBufferVariableType type)
{
uint32_t stride = type.descriptor.bytesize / RDCMAX(1U, type.descriptor.elements);
RDCASSERTMSG("Stride is too large for uint16_t", stride <= 0xffff);
ret.descriptor.arrayByteStride = RDCMIN(stride, 0xffffu) & 0xffff;
ret.descriptor.arrayByteStride = AlignUp16(RDCMIN(stride, 0xffffu) & 0xffff);
ret.descriptor.rows = ret.descriptor.columns = 0;
}