From c0c3565714643e177955308910771663fbd9d1f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 31 Jan 2024 17:17:38 +0100 Subject: [PATCH] GL: Remove geometry shader invocations workaround # Conflicts: # source/blender/gpu/opengl/gl_backend.cc # Conflicts: # source/blender/gpu/opengl/gl_shader.cc Pull Request: https://projects.blender.org/blender/blender/pulls/116600 --- source/blender/gpu/opengl/gl_backend.cc | 3 --- source/blender/gpu/opengl/gl_context.hh | 1 - source/blender/gpu/opengl/gl_shader.cc | 9 --------- 3 files changed, 13 deletions(-) diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc index c354305fac0..8cad6fdbe06 100644 --- a/source/blender/gpu/opengl/gl_backend.cc +++ b/source/blender/gpu/opengl/gl_backend.cc @@ -318,7 +318,6 @@ static void detect_workarounds() /* Do not alter OpenGL 4.3 features. * These code paths should be removed. */ GLContext::debug_layer_support = false; - GLContext::geometry_shader_invocations = false; #endif return; @@ -481,7 +480,6 @@ bool GLContext::debug_layer_support = false; bool GLContext::direct_state_access_support = false; bool GLContext::explicit_location_support = false; bool GLContext::framebuffer_fetch_support = false; -bool GLContext::geometry_shader_invocations = false; bool GLContext::layered_rendering_support = false; bool GLContext::native_barycentric_support = false; bool GLContext::multi_bind_support = false; @@ -567,7 +565,6 @@ void GLBackend::capabilities_init() epoxy_has_gl_extension("GL_ARB_debug_output"); GLContext::direct_state_access_support = epoxy_has_gl_extension("GL_ARB_direct_state_access"); GLContext::explicit_location_support = epoxy_gl_version() >= 43; - GLContext::geometry_shader_invocations = epoxy_has_gl_extension("GL_ARB_gpu_shader5"); GLContext::framebuffer_fetch_support = epoxy_has_gl_extension("GL_EXT_shader_framebuffer_fetch"); GLContext::texture_barrier_support = epoxy_has_gl_extension("GL_ARB_texture_barrier"); GLContext::layered_rendering_support = epoxy_has_gl_extension( diff --git a/source/blender/gpu/opengl/gl_context.hh b/source/blender/gpu/opengl/gl_context.hh index c394b49d904..b3873758bcc 100644 --- a/source/blender/gpu/opengl/gl_context.hh +++ b/source/blender/gpu/opengl/gl_context.hh @@ -51,7 +51,6 @@ class GLContext : public Context { static bool debug_layer_support; static bool direct_state_access_support; static bool explicit_location_support; - static bool geometry_shader_invocations; static bool framebuffer_fetch_support; static bool layered_rendering_support; static bool native_barycentric_support; diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 467645474e4..311ba01443e 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -895,11 +895,6 @@ std::string GLShader::geometry_layout_declare(const ShaderCreateInfo &info) cons int max_verts = info.geometry_layout_.max_vertices; int invocations = info.geometry_layout_.invocations; - if (GLContext::geometry_shader_invocations == false && invocations != -1) { - max_verts *= invocations; - invocations = -1; - } - std::stringstream ss; ss << "\n/* Geometry Layout. */\n"; ss << "layout(" << to_string(info.geometry_layout_.primitive_in); @@ -1080,10 +1075,6 @@ static const char *glsl_patch_default_get() ss << "#define GPU_ARB_shader_draw_parameters\n"; ss << "#define gpu_BaseInstance gl_BaseInstanceARB\n"; } - if (GLContext::geometry_shader_invocations) { - ss << "#extension GL_ARB_gpu_shader5 : enable\n"; - ss << "#define GPU_ARB_gpu_shader5\n"; - } if (epoxy_has_gl_extension("GL_ARB_conservative_depth")) { ss << "#extension GL_ARB_conservative_depth : enable\n"; }