mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-24 23:46:41 +00:00
Fix mapping for arrays with float4 stride but partial last element
* The size won't quite be a multiple of the stride when the last element isn't a multiple of a float4
This commit is contained in:
@@ -1253,7 +1253,8 @@ SPDBChunk::SPDBChunk(void *chunk)
|
||||
{
|
||||
// number of rows is the number of vectors in the matrix's total byte size (each vector is
|
||||
// a row)
|
||||
mapping.var.rows = uint8_t(varTypeByteSize / vartype->matArrayStride);
|
||||
mapping.var.rows =
|
||||
uint8_t((varTypeByteSize + vartype->matArrayStride - 1) / vartype->matArrayStride);
|
||||
|
||||
// unless this is a column major matrix, in which case each vector is a column so swap the
|
||||
// rows/columns (the number of ROWS is the vector size, when each vector is a column)
|
||||
@@ -1293,7 +1294,7 @@ SPDBChunk::SPDBChunk(void *chunk)
|
||||
|
||||
// if this is an array, the index is just the array index. However if we're mapping the
|
||||
// whole array, don't add the index as the mapping will do that for us
|
||||
if(varLen < mapping.var.elements * vartype->matArrayStride)
|
||||
if(varLen < varTypeByteSize)
|
||||
{
|
||||
mapping.var.name += StringFormat::Fmt("[%u]", idx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user