diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-02-01 20:21:29 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-02-01 21:05:22 +0300 |
commit | 9505af72d4be79cb0c1ce1678db2e392ba74804d (patch) | |
tree | a42d6a416566db3de9abcddeb9b17965fdf8abba /source/blender/gpu/opengl/gl_backend.cc | |
parent | 9e42b9827aca935214d5cc60453b78acac53da17 (diff) |
GPUShader: Add support for gpu_BaryCoord and fallback
This adds the possibility to use the `gpu_BaryCoord[NoPersp]`
builtin to support barycentric coordinates without geometry shader.
The `BuiltinBits::LAYER` builtin needs to be manually added
to the `GPUShaderCreateInfo` in order to use this feature.
Note: This is only available for shaders using `GPUShaderCreateInfo`.
A geometry shader fallback is generated if the extension
`AMD_shader_explicit_vertex_parameter` is not available.
`NV_fragment_shader_barycentric` was not considered because it is not
present inside the `glew.h` with use and seems to only be available
with vulkan.
Diffstat (limited to 'source/blender/gpu/opengl/gl_backend.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_backend.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc index 2ced2639c02..2ee7c0503f4 100644 --- a/source/blender/gpu/opengl/gl_backend.cc +++ b/source/blender/gpu/opengl/gl_backend.cc @@ -249,6 +249,7 @@ static void detect_workarounds() GLContext::fixed_restart_index_support = false; GLContext::geometry_shader_invocations = false; GLContext::layered_rendering_support = false; + GLContext::native_barycentric_support = false; GLContext::multi_bind_support = false; GLContext::multi_draw_indirect_support = false; GLContext::shader_draw_parameters_support = false; @@ -447,6 +448,7 @@ bool GLContext::explicit_location_support = false; bool GLContext::geometry_shader_invocations = false; 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_draw_indirect_support = false; bool GLContext::shader_draw_parameters_support = false; @@ -508,6 +510,7 @@ void GLBackend::capabilities_init() GLContext::geometry_shader_invocations = GLEW_ARB_gpu_shader5; GLContext::fixed_restart_index_support = GLEW_ARB_ES3_compatibility; GLContext::layered_rendering_support = GLEW_AMD_vertex_shader_layer; + GLContext::native_barycentric_support = GLEW_AMD_shader_explicit_vertex_parameter; GLContext::multi_bind_support = GLEW_ARB_multi_bind; GLContext::multi_draw_indirect_support = GLEW_ARB_multi_draw_indirect; GLContext::shader_draw_parameters_support = GLEW_ARB_shader_draw_parameters; |