mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-28 18:31:40 +00:00
Detect when a zero-sized buffer is bound and skip GL draws
This commit is contained in:
@@ -245,6 +245,24 @@ bool WrappedOpenGL::Check_SafeDraw(bool indexed)
|
||||
|
||||
ret = false;
|
||||
}
|
||||
|
||||
GLint size = 0;
|
||||
GL.glGetNamedBufferParameterivEXT(vb, eGL_BUFFER_SIZE, &size);
|
||||
|
||||
if(size == 0)
|
||||
{
|
||||
ResourceId id = GetResourceManager()->GetID(BufferRes(GetCtx(), vb));
|
||||
AddDebugMessage(
|
||||
MessageCategory::Undefined, MessageSeverity::High, MessageSource::IncorrectAPIUse,
|
||||
StringFormat::Fmt("Vertex buffer %s bound to attribute %d: %s (buffer slot %d) at "
|
||||
"draw is 0-sized!\n"
|
||||
"Has this buffer been initialised?",
|
||||
ToStr(GetResourceManager()->GetOriginalID(id)).c_str(), attrib,
|
||||
shaderDetails.reflection.inputSignature[reflIndex].varName.c_str(),
|
||||
bufIdx));
|
||||
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user