From 78ea82315c07b3ebba19667e172571bb491e036f Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 2 May 2017 16:32:25 +0100 Subject: [PATCH] Add a super extra hack on the vendor checks to avoid checking on intel * It seems like even running the simple check to see if we need our workarounds can completely break intel's driver and lead to infinite hangs later. So instead we just assume these hacks are always on for intel drivers. --- renderdoc/driver/gl/gl_common.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index 62570bbb1..f5b04f3c8 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -448,6 +448,11 @@ void CheckExtensions(const GLHookSet &gl) void DoVendorChecks(const GLHookSet &gl, GLPlatform &platform, GLWindowingData context) { + const char *vendor = ""; + + if(gl.glGetString) + vendor = (const char *)gl.glGetString(eGL_VENDOR); + ////////////////////////////////////////////////////////// // version/driver/vendor specific hacks and checks go here // doing these in a central place means they're all documented and @@ -507,10 +512,20 @@ void DoVendorChecks(const GLHookSet &gl, GLPlatform &platform, GLWindowingData c } } - // AMD throws an error if we try to copy the mips that are smaller than 4x4, - if(gl.glGetError && gl.glGenTextures && gl.glBindTexture && gl.glCopyImageSubData && - gl.glTexStorage2D && gl.glTexSubImage2D && gl.glTexParameteri && gl.glDeleteTextures && - HasExt[ARB_copy_image] && HasExt[ARB_texture_storage] && !IsGLES) + // AMD throws an error if we try to copy the mips that are smaller than 4x4. + // + // Intel seems to completely break everything if we even run this check, so we just + // skip this check and assume the hack is enabled. + + if(!strcmp(vendor, "Intel") || !strcmp(vendor, "intel") || !strcmp(vendor, "INTEL")) + { + RDCWARN("Using super hack-on-a-hack to avoid glCopyImageSubData tests on intel."); + VendorCheck[VendorCheck_AMD_copy_compressed_tinymips] = true; + VendorCheck[VendorCheck_AMD_copy_compressed_cubemaps] = true; + } + else if(gl.glGetError && gl.glGenTextures && gl.glBindTexture && gl.glCopyImageSubData && + gl.glTexStorage2D && gl.glTexSubImage2D && gl.glTexParameteri && gl.glDeleteTextures && + HasExt[ARB_copy_image] && HasExt[ARB_texture_storage] && !IsGLES) { GLuint texs[2]; gl.glGenTextures(2, texs);