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.
This commit is contained in:
2022-02-01 18:21:29 +01:00
parent 9e42b9827a
commit 9505af72d4
3 changed files with 89 additions and 2 deletions

View File

@@ -73,6 +73,7 @@ class GLContext : public Context {
static bool geometry_shader_invocations;
static bool fixed_restart_index_support;
static bool layered_rendering_support;
static bool native_barycentric_support;
static bool multi_bind_support;
static bool multi_draw_indirect_support;
static bool shader_draw_parameters_support;