Fix column major matrix transpose when reading cbuffer values. Refs #800

This commit is contained in:
baldurk
2018-02-19 17:41:37 +00:00
parent 6cf67f9e4f
commit 52de64de26
2 changed files with 6 additions and 6 deletions
@@ -536,7 +536,7 @@ struct SPVTypeData
}
else if(type == eMatrix)
{
name = StringFormat::Fmt("%s%ux%u", baseType->GetName().c_str(), vectorSize, matrixSize);
name = StringFormat::Fmt("%s%ux%u", baseType->GetName().c_str(), matrixSize, vectorSize);
}
else if(type == ePointer)
{
@@ -3512,7 +3512,7 @@ void MakeConstantBlockVariable(ShaderConstant &outConst, SPVTypeData *type, cons
else
RDCERR("Unexpected base type of constant variable %u", type->baseType->type);
outConst.type.descriptor.rowMajorStorage = false;
outConst.type.descriptor.rowMajorStorage = (type->type == SPVTypeData::eVector);
for(size_t d = 0; d < decorations.size(); d++)
{
+4 -4
View File
@@ -1489,12 +1489,12 @@ void VulkanReplay::FillCBufferVariables(rdcarray<ShaderConstant> invars,
{
uint32_t tmp[16] = {0};
for(uint32_t r = 0; r < rows; r++)
for(uint32_t c = 0; c < cols; c++)
{
size_t srcoffs = 4 * elemByteSize * r;
size_t dstoffs = cols * elemByteSize * r;
size_t srcoffs = 4 * elemByteSize * c;
size_t dstoffs = rows * elemByteSize * c;
memcpy((byte *)(tmp) + dstoffs, d + srcoffs,
RDCMIN(data.size() - dataOffset + srcoffs, elemByteSize * cols));
RDCMIN(data.size() - dataOffset + srcoffs, elemByteSize * rows));
}
// transpose