Check for proxy texture targets and don't serialise those calls

This commit is contained in:
baldurk
2014-11-08 17:30:58 +00:00
parent d50b74694d
commit 47e5874aa4
3 changed files with 120 additions and 0 deletions
+20
View File
@@ -412,3 +412,23 @@ GLenum TextureBinding(GLenum target)
RDCERR("Unexpected target %x", target);
return eGL_NONE;
}
bool IsProxyTarget(GLenum target)
{
switch(target)
{
case eGL_PROXY_TEXTURE_1D:
case eGL_PROXY_TEXTURE_1D_ARRAY:
case eGL_PROXY_TEXTURE_2D:
case eGL_PROXY_TEXTURE_2D_ARRAY:
case eGL_PROXY_TEXTURE_2D_MULTISAMPLE:
case eGL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:
case eGL_PROXY_TEXTURE_RECTANGLE:
case eGL_PROXY_TEXTURE_3D:
case eGL_PROXY_TEXTURE_CUBE_MAP:
case eGL_PROXY_TEXTURE_CUBE_MAP_ARRAY:
return true;
}
return false;
}
+1
View File
@@ -38,6 +38,7 @@ bool IsUIntFormat(GLenum internalFormat);
bool IsSIntFormat(GLenum internalFormat);
GLenum TextureBinding(GLenum target);
bool IsProxyTarget(GLenum target);
enum GLNamespace
{
@@ -912,6 +912,9 @@ void WrappedOpenGL::glTextureImage1DEXT(GLuint texture, GLenum target, GLint lev
{
m_Real.glTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget((GLenum)internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -945,6 +948,9 @@ void WrappedOpenGL::glTextureImage1DEXT(GLuint texture, GLenum target, GLint lev
void WrappedOpenGL::glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
m_Real.glTexImage1D(target, level, internalformat, width, border, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget((GLenum)internalformat)) return;
if(m_State >= WRITING)
{
@@ -1022,6 +1028,9 @@ void WrappedOpenGL::glTextureImage2DEXT(GLuint texture, GLenum target, GLint lev
{
m_Real.glTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget((GLenum)internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1056,6 +1065,9 @@ void WrappedOpenGL::glTexImage2D(GLenum target, GLint level, GLint internalforma
{
m_Real.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget((GLenum)internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1133,6 +1145,9 @@ void WrappedOpenGL::glTextureImage3DEXT(GLuint texture, GLenum target, GLint lev
{
m_Real.glTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget((GLenum)internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1167,6 +1182,9 @@ void WrappedOpenGL::glTexImage3D(GLenum target, GLint level, GLint internalforma
{
m_Real.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget((GLenum)internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1223,6 +1241,9 @@ void WrappedOpenGL::glCompressedTextureImage1DEXT(GLuint texture, GLenum target,
{
m_Real.glCompressedTextureImage1DEXT(texture, target, level, internalformat, width, border, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1257,6 +1278,9 @@ void WrappedOpenGL::glCompressedTexImage1D(GLenum target, GLint level, GLenum in
{
m_Real.glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1314,6 +1338,9 @@ void WrappedOpenGL::glCompressedTextureImage2DEXT(GLuint texture, GLenum target,
{
m_Real.glCompressedTextureImage2DEXT(texture, target, level, internalformat, width, height, border, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1348,6 +1375,9 @@ void WrappedOpenGL::glCompressedTexImage2D(GLenum target, GLint level, GLenum in
{
m_Real.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1406,6 +1436,9 @@ void WrappedOpenGL::glCompressedTextureImage3DEXT(GLuint texture, GLenum target,
{
m_Real.glCompressedTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1440,6 +1473,9 @@ void WrappedOpenGL::glCompressedTexImage3D(GLenum target, GLint level, GLenum in
{
m_Real.glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1501,6 +1537,9 @@ void WrappedOpenGL::glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei
{
m_Real.glTextureStorage1DEXT(texture, target, levels, internalformat, width);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1532,6 +1571,9 @@ void WrappedOpenGL::glTexStorage1D(GLenum target, GLsizei levels, GLenum interna
{
m_Real.glTexStorage1D(target, levels, internalformat, width);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1590,6 +1632,9 @@ void WrappedOpenGL::glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei
{
m_Real.glTextureStorage2DEXT(texture, target, levels, internalformat, width, height);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1621,6 +1666,9 @@ void WrappedOpenGL::glTexStorage2D(GLenum target, GLsizei levels, GLenum interna
{
m_Real.glTexStorage2D(target, levels, internalformat, width, height);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1680,6 +1728,9 @@ void WrappedOpenGL::glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei
{
m_Real.glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1711,6 +1762,9 @@ void WrappedOpenGL::glTexStorage3D(GLenum target, GLsizei levels, GLenum interna
{
m_Real.glTexStorage3D(target, levels, internalformat, width, height, depth);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1770,6 +1824,9 @@ void WrappedOpenGL::glTextureStorage2DMultisampleEXT(GLuint texture, GLenum targ
{
m_Real.glTextureStorage2DMultisampleEXT(texture, target, samples, internalformat, width, height, fixedsamplelocations);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1801,6 +1858,9 @@ void WrappedOpenGL::glTexStorage2DMultisample(GLenum target, GLsizei samples, GL
{
m_Real.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1835,6 +1895,9 @@ void WrappedOpenGL::glTexImage2DMultisample(GLenum target, GLsizei samples, GLen
{
m_Real.glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1905,6 +1968,9 @@ void WrappedOpenGL::glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint
{
m_Real.glTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1924,6 +1990,9 @@ void WrappedOpenGL::glTexSubImage1D(GLenum target, GLint level, GLint xoffset, G
{
m_Real.glTexSubImage1D(target, level, xoffset, width, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -1979,6 +2048,9 @@ void WrappedOpenGL::glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint
{
m_Real.glTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -1998,6 +2070,9 @@ void WrappedOpenGL::glTexSubImage2D(GLenum target, GLint level, GLint xoffset, G
{
m_Real.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -2055,6 +2130,9 @@ void WrappedOpenGL::glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint
{
m_Real.glTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -2074,6 +2152,9 @@ void WrappedOpenGL::glTexSubImage3D(GLenum target, GLint level, GLint xoffset, G
{
m_Real.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -2116,6 +2197,9 @@ void WrappedOpenGL::glCompressedTextureSubImage1DEXT(GLuint texture, GLenum targ
{
m_Real.glCompressedTextureSubImage1DEXT(texture, target, level, xoffset, width, format, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -2135,6 +2219,9 @@ void WrappedOpenGL::glCompressedTexSubImage1D(GLenum target, GLint level, GLint
{
m_Real.glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -2179,6 +2266,9 @@ void WrappedOpenGL::glCompressedTextureSubImage2DEXT(GLuint texture, GLenum targ
{
m_Real.glCompressedTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -2198,6 +2288,9 @@ void WrappedOpenGL::glCompressedTexSubImage2D(GLenum target, GLint level, GLint
{
m_Real.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
@@ -2244,6 +2337,9 @@ void WrappedOpenGL::glCompressedTextureSubImage3DEXT(GLuint texture, GLenum targ
{
m_Real.glCompressedTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -2263,6 +2359,9 @@ void WrappedOpenGL::glCompressedTexSubImage3D(GLenum target, GLint level, GLint
{
m_Real.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(format)) return;
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];