From bc5afeeef4dd52e1b331923011e3a96d55ae36e5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 8 Aug 2015 14:56:45 -0700 Subject: [PATCH] Call GetSizedFormat everywhere * In future should maybe warn for 1D/2D/3D variants that are only from storage calls, where it's invalid. * It's needed for multisampled since we pipe TexImage* through these common functions, which can use unzied internalFormats. --- .../driver/gl/wrappers/gl_texture_funcs.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp index 7690228c3..e7bcb1c50 100644 --- a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp @@ -3012,7 +3012,9 @@ void WrappedOpenGL::Common_glTextureStorage2DEXT(ResourceId texId, GLenum target // proxy formats are used for querying texture capabilities, don't serialise these if(IsProxyTarget(target) || internalformat == 0) return; - + + internalformat = GetSizedFormat(m_Real, target, internalformat); + if(m_State >= WRITING) { GLResourceRecord *record = GetResourceManager()->GetResourceRecord(texId); @@ -3105,7 +3107,9 @@ void WrappedOpenGL::Common_glTextureStorage3DEXT(ResourceId texId, GLenum target // proxy formats are used for querying texture capabilities, don't serialise these if(IsProxyTarget(target) || internalformat == 0) return; - + + internalformat = GetSizedFormat(m_Real, target, internalformat); + if(m_State >= WRITING) { GLResourceRecord *record = GetResourceManager()->GetResourceRecord(texId); @@ -3199,7 +3203,9 @@ void WrappedOpenGL::Common_glTextureStorage2DMultisampleEXT(ResourceId texId, GL // proxy formats are used for querying texture capabilities, don't serialise these if(IsProxyTarget(target) || internalformat == 0) return; - + + internalformat = GetSizedFormat(m_Real, target, internalformat); + if(m_State >= WRITING) { GLResourceRecord *record = GetResourceManager()->GetResourceRecord(texId); @@ -3308,7 +3314,9 @@ void WrappedOpenGL::Common_glTextureStorage3DMultisampleEXT(ResourceId texId, GL // proxy formats are used for querying texture capabilities, don't serialise these if(IsProxyTarget(target) || internalformat == 0) return; - + + internalformat = GetSizedFormat(m_Real, target, internalformat); + if(m_State >= WRITING) { GLResourceRecord *record = GetResourceManager()->GetResourceRecord(texId);