diff options
Diffstat (limited to 'source/blender/gpu/GPU_shader.h')
-rw-r--r-- | source/blender/gpu/GPU_shader.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index d2380d27464..428c7634195 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -60,6 +60,12 @@ GPUShader *GPU_shader_create_ex( const char **tf_names, const int tf_count, const char *shader_name); +struct GPU_ShaderCreateFromArray_Params { const char **vert, **geom, **frag, **defs; }; +struct GPUShader *GPU_shader_create_from_arrays_impl( + const struct GPU_ShaderCreateFromArray_Params *params); +#define GPU_shader_create_from_arrays(...) \ + GPU_shader_create_from_arrays_impl(&(const struct GPU_ShaderCreateFromArray_Params)__VA_ARGS__) + void GPU_shader_free(GPUShader *shader); void GPU_shader_bind(GPUShader *shader); @@ -350,9 +356,15 @@ typedef enum eGPUBuiltinShader { /* Selection */ GPU_SHADER_3D_FLAT_SELECT_ID, GPU_SHADER_3D_UNIFORM_SELECT_ID, - - GPU_NUM_BUILTIN_SHADERS /* (not an actual shader) */ } eGPUBuiltinShader; +#define GPU_SHADER_BUILTIN_LEN (GPU_SHADER_3D_UNIFORM_SELECT_ID + 1) + +/** Support multiple configurations. */ +typedef enum eGPUShaderConfig { + GPU_SHADER_CFG_DEFAULT = 0, + GPU_SHADER_CFG_CLIPPED = 1, +} eGPUShaderConfig; +#define GPU_SHADER_CFG_LEN (GPU_SHADER_CFG_CLIPPED + 1) /** Keep these in sync with: * - `gpu_shader_image_interlace_frag.glsl` @@ -364,7 +376,10 @@ typedef enum eGPUInterlaceShader { GPU_SHADER_INTERLACE_CHECKER = 2, } eGPUInterlaceShader; -GPUShader *GPU_shader_get_builtin_shader(eGPUBuiltinShader shader); +GPUShader *GPU_shader_get_builtin_shader_with_config( + eGPUBuiltinShader shader, eGPUShaderConfig shader_cfg); +GPUShader *GPU_shader_get_builtin_shader( + eGPUBuiltinShader shader); void GPU_shader_get_builtin_shader_code( eGPUBuiltinShader shader, |