summaryrefslogtreecommitdiff
path: root/gsk/gskenums.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-09-18 17:46:57 +0200
committerAlexander Larsson <alexl@redhat.com>2020-09-29 09:51:16 +0200
commit7ea755e206c36960db05f0e0660c6f5f20b692c6 (patch)
tree56a83de7a5cd4f40d8f4ab539f4b3211015a4f12 /gsk/gskenums.h
parent6e9b58b6f081f3cf1cba697adada8cd3bc2438d5 (diff)
downloadgtk+-7ea755e206c36960db05f0e0660c6f5f20b692c6.tar.gz
Add GskGLShaderNode and GskGLShader
A GskGLShader is an abstraction of a GLSL fragment shader that can produce pixel values given inputs: * N (currently max 4) textures * Current arguments for the shader uniform Uniform types are: float,(u)int,bool,vec234) There is also a builder for the uniform arguments which are passed around as immutable GBytes in the built form. A GskGLShaderNode is a render node that renders a GskGLShader inside a specified rectangular bounds. It renders its child nodes as textures and passes those as texture arguments to the shader. You also pass it a uniform arguments object.
Diffstat (limited to 'gsk/gskenums.h')
-rw-r--r--gsk/gskenums.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/gsk/gskenums.h b/gsk/gskenums.h
index 24aafec502..0cd0c284fc 100644
--- a/gsk/gskenums.h
+++ b/gsk/gskenums.h
@@ -48,6 +48,7 @@
* @GSK_TEXT_NODE: A node containing a glyph string
* @GSK_BLUR_NODE: A node that applies a blur
* @GSK_DEBUG_NODE: Debug information that does not affect the rendering
+ * @GSK_GL_SHADER_NODE: A node that uses OpenGL fragment shaders to render
* The type of a node determines what the node is rendering.
*/
@@ -75,7 +76,8 @@ typedef enum {
GSK_CROSS_FADE_NODE,
GSK_TEXT_NODE,
GSK_BLUR_NODE,
- GSK_DEBUG_NODE
+ GSK_DEBUG_NODE,
+ GSK_GL_SHADER_NODE
} GskRenderNodeType;
/**
@@ -218,4 +220,32 @@ typedef enum
GSK_TRANSFORM_CATEGORY_IDENTITY
} GskTransformCategory;
+/**
+ * GskGLUniformType:
+ * @GSK_GL_UNIFORM_TYPE_NONE: No type, used for uninitialized or unspecified values.
+ * @GSK_GL_UNIFORM_TYPE_FLOAT: A float uniform
+ * @GSK_GL_UNIFORM_TYPE_INT: A GLSL int / gint32 uniform
+ * @GSK_GL_UNIFORM_TYPE_UINT: A GLSL uint / guint32 uniform
+ * @GSK_GL_UNIFORM_TYPE_BOOL: A GLSL bool / gboolean uniform
+ * @GSK_GL_UNIFORM_TYPE_VEC2: A GLSL vec2 / graphene_vec2_t uniform
+ * @GSK_GL_UNIFORM_TYPE_VEC3: A GLSL vec3 / graphene_vec3_t uniform
+ * @GSK_GL_UNIFORM_TYPE_VEC4: A GLSL vec4 / graphene_vec4_t uniform
+ *
+ * This defines the types of the uniforms that #GskGLShaders
+ * declare. It defines both what the type is called in the GLSL shader
+ * code, and what the corresponding C type is on the Gtk side.
+ */
+typedef enum
+{
+ GSK_GL_UNIFORM_TYPE_NONE,
+ GSK_GL_UNIFORM_TYPE_FLOAT,
+ GSK_GL_UNIFORM_TYPE_INT,
+ GSK_GL_UNIFORM_TYPE_UINT,
+ GSK_GL_UNIFORM_TYPE_BOOL,
+ GSK_GL_UNIFORM_TYPE_VEC2,
+ GSK_GL_UNIFORM_TYPE_VEC3,
+ GSK_GL_UNIFORM_TYPE_VEC4,
+} GskGLUniformType;
+
+
#endif /* __GSK_TYPES_H__ */