mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-21 22:16:38 +00:00
Clamp buffer offset for mesh view input
* If the calculated offset is larger than the buffer size we should be sure to clamp it.
This commit is contained in:
@@ -1528,7 +1528,13 @@ static void ConfigureMeshColumns(ICaptureContext &ctx, PopulateBufferData *bufda
|
||||
|
||||
BufferDescription *buf = ctx.GetBuffer(ib.resourceId);
|
||||
if(buf)
|
||||
bytesAvailable = buf->length - ib.byteOffset - draw->indexOffset * draw->indexByteWidth;
|
||||
{
|
||||
uint64_t offset = ib.byteOffset - draw->indexOffset * draw->indexByteWidth;
|
||||
if(offset > buf->length)
|
||||
bytesAvailable = 0;
|
||||
else
|
||||
bytesAvailable = buf->length - offset;
|
||||
}
|
||||
|
||||
// drawing more than this many indices will read off the end of the index buffer - which while
|
||||
// technically not invalid is certainly not intended, so serves as a good 'upper bound'
|
||||
|
||||
Reference in New Issue
Block a user