mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Handle glGetIntermalformativ being missing
* Fixes a reported crash. * This function was only core in 4.2 so it's perfectly valid for it to be missing - if so then we just skip using it to determine the size of a format and default to 8-bit colour or 32-bit depth/stencil formats.
This commit is contained in:
@@ -390,8 +390,17 @@ GLenum GetSizedFormat(const GLHookSet &gl, GLenum target, GLenum internalFormat)
|
||||
}
|
||||
|
||||
GLint red, depth;
|
||||
gl.glGetInternalformativ(target, internalFormat, eGL_INTERNALFORMAT_RED_SIZE, sizeof(GLint), &red);
|
||||
gl.glGetInternalformativ(target, internalFormat, eGL_INTERNALFORMAT_DEPTH_SIZE, sizeof(GLint), &depth);
|
||||
if(gl.glGetInternalformativ)
|
||||
{
|
||||
gl.glGetInternalformativ(target, internalFormat, eGL_INTERNALFORMAT_RED_SIZE, sizeof(GLint), &red);
|
||||
gl.glGetInternalformativ(target, internalFormat, eGL_INTERNALFORMAT_DEPTH_SIZE, sizeof(GLint), &depth);
|
||||
}
|
||||
else
|
||||
{
|
||||
// without the query function, just default to sensible defaults
|
||||
red = 8;
|
||||
depth = 32;
|
||||
}
|
||||
|
||||
switch(internalFormat)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user