GPU: Disable Multi-Bindings for AMD Official Drivers #110882

Merged
Jeroen Bakker merged 2 commits from Jeroen-Bakker/blender:gpu/disable-multi-bind-amd into main 2023-08-07 14:47:52 +02:00
3 changed files with 9 additions and 5 deletions
Showing only changes of commit 996f10ab2c - Show all commits

View File

@ -244,6 +244,7 @@ static void detect_workarounds()
GLContext::layered_rendering_support = false;
GLContext::native_barycentric_support = false;
GLContext::multi_bind_support = false;
GLContext::multi_bind_image_support = false;
GLContext::multi_draw_indirect_support = false;
GLContext::shader_draw_parameters_support = false;
GLContext::texture_cube_map_array_support = false;
@ -452,10 +453,10 @@ static void detect_workarounds()
GCaps.clear_viewport_workaround = true;
}
/* There is an issue in AMD official driver where we cannot use multi bind. AMD is
* aware of the issue, but hasn't released a fix. */
/* There is an issue in AMD official driver where we cannot use multi bind when using images. AMD
* is aware of the issue, but hasn't released a fix. */
if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) {
GLContext::multi_bind_support = false;
GLContext::multi_bind_image_support = false;
}
/* Metal-related Workarounds. */
@ -492,6 +493,7 @@ bool GLContext::fixed_restart_index_support = false;
bool GLContext::layered_rendering_support = false;
bool GLContext::native_barycentric_support = false;
bool GLContext::multi_bind_support = false;
bool GLContext::multi_bind_image_support = false;
bool GLContext::multi_draw_indirect_support = false;
bool GLContext::shader_draw_parameters_support = false;
bool GLContext::stencil_texturing_support = false;
@ -593,7 +595,8 @@ void GLBackend::capabilities_init()
GLContext::layered_rendering_support = epoxy_has_gl_extension("GL_AMD_vertex_shader_layer");
GLContext::native_barycentric_support = epoxy_has_gl_extension(
"GL_AMD_shader_explicit_vertex_parameter");
GLContext::multi_bind_support = epoxy_has_gl_extension("GL_ARB_multi_bind");
GLContext::multi_bind_support = GLContext::multi_bind_image_support = epoxy_has_gl_extension(
"GL_ARB_multi_bind");
GLContext::multi_draw_indirect_support = epoxy_has_gl_extension("GL_ARB_multi_draw_indirect");
GLContext::shader_draw_parameters_support = epoxy_has_gl_extension(
"GL_ARB_shader_draw_parameters");

View File

@ -59,6 +59,7 @@ class GLContext : public Context {
static bool layered_rendering_support;
static bool native_barycentric_support;
static bool multi_bind_support;
static bool multi_bind_image_support;
static bool multi_draw_indirect_support;
static bool shader_draw_parameters_support;
static bool stencil_texturing_support;

View File

@ -610,7 +610,7 @@ void GLStateManager::image_bind_apply()
int last = 32 - bitscan_reverse_uint(dirty_bind);
int count = last - first;
if (GLContext::multi_bind_support) {
if (GLContext::multi_bind_image_support) {
glBindImageTextures(first, count, images_ + first);
}
else {