Fix proxy target checks, make sure real function is called

* If the target is a proxy target or the internal format is invalid, make
  sure we still call the real GL function, but don't do anything ourselves.
This commit is contained in:
baldurk committed 2014-12-11 22:22:33 +00:00
1 parent 95e3f01686
commit c8e29488ef
1 file changed
+70 -70
@@ -1867,13 +1867,13 @@ bool WrappedOpenGL::Serialise_glTextureImage1DEXT(GLuint texture, GLenum target,
void WrappedOpenGL::glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -1913,13 +1913,13 @@ 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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glTexImage1D(target, level, internalformat, width, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -1962,13 +1962,13 @@ void WrappedOpenGL::glTexImage1D(GLenum target, GLint level, GLint internalforma
void WrappedOpenGL::glMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
m_Real.glMultiTexImage1DEXT(texunit, 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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2065,13 +2065,13 @@ bool WrappedOpenGL::Serialise_glTextureImage2DEXT(GLuint texture, GLenum target,
void WrappedOpenGL::glTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2114,13 +2114,13 @@ void WrappedOpenGL::glTextureImage2DEXT(GLuint texture, GLenum target, GLint lev
void WrappedOpenGL::glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2163,13 +2163,13 @@ void WrappedOpenGL::glTexImage2D(GLenum target, GLint level, GLint internalforma
void WrappedOpenGL::glMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
m_Real.glMultiTexImage2DEXT(texunit, 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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2267,13 +2267,13 @@ bool WrappedOpenGL::Serialise_glTextureImage3DEXT(GLuint texture, GLenum target,
void WrappedOpenGL::glTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2316,13 +2316,13 @@ void WrappedOpenGL::glTextureImage3DEXT(GLuint texture, GLenum target, GLint lev
void WrappedOpenGL::glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2365,13 +2365,13 @@ void WrappedOpenGL::glTexImage3D(GLenum target, GLint level, GLint internalforma
void WrappedOpenGL::glMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
{
m_Real.glMultiTexImage3DEXT(texunit, 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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, (GLenum)internalformat);
m_Real.glMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2470,13 +2470,13 @@ bool WrappedOpenGL::Serialise_glCompressedTextureImage1DEXT(GLuint texture, GLen
void WrappedOpenGL::glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedTextureImage1DEXT(texture, target, level, internalformat, width, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2519,13 +2519,13 @@ void WrappedOpenGL::glCompressedTextureImage1DEXT(GLuint texture, GLenum target,
void WrappedOpenGL::glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2568,13 +2568,13 @@ void WrappedOpenGL::glCompressedTexImage1D(GLenum target, GLint level, GLenum in
void WrappedOpenGL::glCompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *pixels)
{
m_Real.glCompressedMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, imageSize, pixels);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2674,13 +2674,13 @@ bool WrappedOpenGL::Serialise_glCompressedTextureImage2DEXT(GLuint texture, GLen
void WrappedOpenGL::glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedTextureImage2DEXT(texture, target, level, internalformat, width, height, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2723,13 +2723,13 @@ void WrappedOpenGL::glCompressedTextureImage2DEXT(GLuint texture, GLenum target,
void WrappedOpenGL::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2772,13 +2772,13 @@ void WrappedOpenGL::glCompressedTexImage2D(GLenum target, GLint level, GLenum in
void WrappedOpenGL::glCompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * pixels)
{
m_Real.glCompressedMultiTexImage2DEXT(texunit, 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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2877,13 +2877,13 @@ bool WrappedOpenGL::Serialise_glCompressedTextureImage3DEXT(GLuint texture, GLen
void WrappedOpenGL::glCompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2926,13 +2926,13 @@ void WrappedOpenGL::glCompressedTextureImage3DEXT(GLuint texture, GLenum target,
void WrappedOpenGL::glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * pixels)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -2975,13 +2975,13 @@ void WrappedOpenGL::glCompressedTexImage3D(GLenum target, GLint level, GLenum in
void WrappedOpenGL::glCompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * pixels)
{
m_Real.glCompressedMultiTexImage3DEXT(texunit, 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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glCompressedMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, imageSize, pixels);
bool fromunpackbuf = false;
{
GLint unpackbuf = 0;
@@ -3053,13 +3053,13 @@ bool WrappedOpenGL::Serialise_glTextureStorage1DEXT(GLuint texture, GLenum targe
void WrappedOpenGL::glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glTextureStorage1DEXT(texture, target, levels, internalformat, width);
if(m_State >= WRITING)
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
@@ -3091,7 +3091,7 @@ 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(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3152,7 +3152,7 @@ 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(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3185,7 +3185,7 @@ 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(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3247,7 +3247,7 @@ 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(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3280,7 +3280,7 @@ 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(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3343,7 +3343,7 @@ 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(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3377,7 +3377,7 @@ 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(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3411,13 +3411,13 @@ void WrappedOpenGL::glTexStorage2DMultisample(GLenum target, GLsizei samples, GL
void WrappedOpenGL::glTexImage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
{
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(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);
m_Real.glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
if(m_State >= WRITING)
{
GLResourceRecord *record = GetCtxData().GetActiveTexRecord();
@@ -3483,7 +3483,7 @@ void WrappedOpenGL::glTextureStorage3DMultisampleEXT(GLuint texture, GLenum targ
m_Real.glTextureStorage3DMultisampleEXT(texture, target, samples, internalformat, width, height, depth, fixedsamplelocations);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3517,7 +3517,7 @@ void WrappedOpenGL::glTexStorage3DMultisample(GLenum target, GLsizei samples, GL
m_Real.glTexStorage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations);
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(IsProxyTarget(target) || internalformat == 0) return;
if(m_State >= WRITING)
{
@@ -3552,7 +3552,7 @@ void WrappedOpenGL::glTexStorage3DMultisample(GLenum target, GLsizei samples, GL
void WrappedOpenGL::glTexImage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
{
// proxy formats are used for querying texture capabilities, don't serialise these
if(IsProxyTarget(internalformat)) return;
if(IsProxyTarget(target) || internalformat == 0) return;
internalformat = GetSizedFormat(m_Real, target, internalformat);