mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 06:56:40 +00:00
Fix column major matrix transpose when reading cbuffer values. Refs #800
This commit is contained in:
@@ -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++)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user