mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 12:18:08 +02:00
gl-renderer: define fragment shader compile_const
Compile time constants play an important role in keeping the shader programs fast. Introduce an informal annotation to mark compile time constants to make the shader code easier to reason with. This will make much more sense once functions with compile time constant parameters are added. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
734c2278f9
commit
37fe6fde49
1 changed files with 5 additions and 2 deletions
|
|
@ -27,6 +27,9 @@
|
|||
|
||||
/* GLSL version 1.00 ES, defined in gl-shaders.c */
|
||||
|
||||
/* For annotating shader compile-time constant arguments */
|
||||
#define compile_const const
|
||||
|
||||
/*
|
||||
* Enumeration of shader variants, must match enum gl_shader_texture_variant.
|
||||
*/
|
||||
|
|
@ -49,8 +52,8 @@ precision mediump float;
|
|||
* These undeclared identifiers will be #defined by a runtime generated code
|
||||
* snippet.
|
||||
*/
|
||||
const int c_variant = DEF_VARIANT;
|
||||
const bool c_green_tint = DEF_GREEN_TINT;
|
||||
compile_const int c_variant = DEF_VARIANT;
|
||||
compile_const bool c_green_tint = DEF_GREEN_TINT;
|
||||
|
||||
vec4
|
||||
yuva2rgba(vec4 yuva)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue