Workaround for nvidia buggy implementation of glClearNamedFramebufferfi

This commit is contained in:
baldurk
2015-02-25 13:54:17 +00:00
parent cf24cb4ff5
commit 8d54bbec32
3 changed files with 17 additions and 0 deletions
+9
View File
@@ -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)
+1
View File
@@ -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];
@@ -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