From 570266702c22c36fdd3997d572ff3e26e9517878 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 8 Nov 2021 12:49:07 +0000 Subject: [PATCH] Enable qualcomm driver bug workaround for all cubemaps * It seems like the problem isn't related to mips, but to 64x64 dimension faces (or smaller). Since it's hard to figure out exactly what the bug is and this might break in other scenarios maybe with other texture formats, we fall back to enabling the workaround across all cubemaps. This is unfortunate but the only way to be reliable. --- renderdoc/driver/gl/gl_common.cpp | 2 +- renderdoc/driver/gl/gl_common.h | 2 +- renderdoc/driver/gl/wrappers/gl_emulated.cpp | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index e220fb130..4da2ad8b8 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -804,7 +804,7 @@ void DoVendorChecks(GLPlatform &platform, GLWindowingData context) } RDCWARN("Enabling Qualcomm driver hack to avoid reading cubemap mip faces directly", ver); - VendorCheck[VendorCheck_Qualcomm_emulate_cube_reads_mip1] = true; + VendorCheck[VendorCheck_Qualcomm_emulate_cube_reads] = true; } if(IsGLES) diff --git a/renderdoc/driver/gl/gl_common.h b/renderdoc/driver/gl/gl_common.h index 6a599494a..973e95ea1 100644 --- a/renderdoc/driver/gl/gl_common.h +++ b/renderdoc/driver/gl/gl_common.h @@ -868,7 +868,7 @@ enum VendorCheckEnum VendorCheck_AMD_copy_compressed_cubemaps, VendorCheck_AMD_vertex_array_elem_buffer_query, VendorCheck_Qualcomm_avoid_glCopyImageSubData, - VendorCheck_Qualcomm_emulate_cube_reads_mip1, + VendorCheck_Qualcomm_emulate_cube_reads, VendorCheck_Count, }; extern bool VendorCheck[VendorCheck_Count]; diff --git a/renderdoc/driver/gl/wrappers/gl_emulated.cpp b/renderdoc/driver/gl/wrappers/gl_emulated.cpp index 7afc57a66..c269caaeb 100644 --- a/renderdoc/driver/gl/wrappers/gl_emulated.cpp +++ b/renderdoc/driver/gl/wrappers/gl_emulated.cpp @@ -2705,9 +2705,11 @@ void APIENTRY _glGetTexImage(GLenum target, GLint level, const GLenum format, co depthFormat = true; } - // Qualcomm drivers seem to barf if we try to read from cubemap faces after X+ for mips. - // X+ works on any mip, and all faces work on the first mip. - if(VendorCheck[VendorCheck_Qualcomm_emulate_cube_reads_mip1] && level > 0) + // Qualcomm drivers seem to barf if we try to read from cubemap faces above X+ for mips 64x64 or + // smaller. In testing X+ works on any mip, and all faces work on larger mips, but since the + // driver seems completely unreliable in this area we enable the workaround blanket for all + // cubemap reads as different formats may break in different ways. + if(VendorCheck[VendorCheck_Qualcomm_emulate_cube_reads]) { switch(target) {