mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Set Primitive ID to ~0u in error case
This commit is contained in:
committed by
Baldur Karlsson
parent
578c963bb2
commit
fd12fdb84b
@@ -1243,7 +1243,7 @@ void QueryPrimitiveIdPerFragment(WrappedOpenGL *driver, GLReplay *replay,
|
||||
|
||||
// we expect this value to be overwritten by the primitive id shader. if not
|
||||
// it will cause an assertion that all color values are the same to fail
|
||||
driver->glClearColor(0.0f, 0.17f, 0.2f, 0.49f);
|
||||
driver->glClearColor(0.84f, 0.17f, 0.2f, 0.49f);
|
||||
driver->glClear(eGL_COLOR_BUFFER_BIT);
|
||||
|
||||
driver->glGetIntegerv(eGL_CURRENT_PROGRAM, ¤tProgram);
|
||||
@@ -1278,15 +1278,23 @@ void QueryPrimitiveIdPerFragment(WrappedOpenGL *driver, GLReplay *replay,
|
||||
eGL_NEAREST);
|
||||
CopyMSSample(driver, resources, copyFramebuffer, sampleIndex, 0, 0, primitiveIds);
|
||||
}
|
||||
RDCASSERT(primitiveIds[0] == primitiveIds[1] && primitiveIds[0] == primitiveIds[2] &&
|
||||
primitiveIds[0] == primitiveIds[3]);
|
||||
if(usingFloatForPrimitiveId)
|
||||
|
||||
if(primitiveIds[0] == primitiveIds[1] && primitiveIds[0] == primitiveIds[2] &&
|
||||
primitiveIds[0] == primitiveIds[3])
|
||||
{
|
||||
historyIndex->primitiveID = int(primitiveIds[0]);
|
||||
if(usingFloatForPrimitiveId)
|
||||
{
|
||||
historyIndex->primitiveID = int(primitiveIds[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
historyIndex->primitiveID = *(int *)primitiveIds;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
historyIndex->primitiveID = *(int *)primitiveIds;
|
||||
historyIndex->primitiveID = ~0u;
|
||||
RDCERR("Primitive ID was not written correctly");
|
||||
}
|
||||
|
||||
++historyIndex;
|
||||
|
||||
Reference in New Issue
Block a user