diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index 98217fd3a..64d823b36 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -297,6 +297,15 @@ void DoVendorChecks(const GLHookSet &gl, GLWindowingData context) // don't have a test for this, just have to enable it all the time, for now. VendorCheck[VendorCheck_NV_avoid_D32S8_copy] = true; + + // On 32-bit calling this function could actually lead to crashes (issues with + // esp being saved across the call), so since the work-around is low-cost of just + // emulating that function we just always enable it. + // + // NOTE: Vendor Checks are initialised after the function pointers will be set up + // so we have to do this unconditionally, this value isn't checked anywhere. + // Search for where this is applied in gl_emulated.cpp + VendorCheck[VendorCheck_NV_ClearNamedFramebufferfiBugs] = true; } size_t BufferIdx(GLenum buf) diff --git a/renderdoc/driver/gl/gl_common.h b/renderdoc/driver/gl/gl_common.h index e1be96883..c44d24061 100644 --- a/renderdoc/driver/gl/gl_common.h +++ b/renderdoc/driver/gl/gl_common.h @@ -121,6 +121,7 @@ enum VendorCheckEnum VendorCheck_AMD_polygon_mode_query, VendorCheck_AMD_copy_compressed_tinymips, VendorCheck_AMD_pipeline_compute_query, + VendorCheck_NV_ClearNamedFramebufferfiBugs, 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 43ab8291d..be57e3140 100644 --- a/renderdoc/driver/gl/wrappers/gl_emulated.cpp +++ b/renderdoc/driver/gl/wrappers/gl_emulated.cpp @@ -138,6 +138,13 @@ void EmulateUnsupportedFunctions(GLHookSet *hooks) EMULATE_UNSUPPORTED(glBlitNamedFramebuffer) EMULATE_UNSUPPORTED(glVertexArrayElementBuffer); EMULATE_UNSUPPORTED(glVertexArrayVertexBuffers) + + // workaround for nvidia bug, which complains that GL_DEPTH_STENCIL is an invalid draw buffer. + // also some issues with 32-bit implementation of this entry point. + // + // NOTE: Vendor Checks aren't initialised by this point, so we have to do this unconditionally + // We include it just for searching: VendorCheck[VendorCheck_NV_ClearNamedFramebufferfiBugs] + hooks->glClearNamedFramebufferfi = &_glClearNamedFramebufferfi; } }; // namespace glEmulate