[gtk/wip/chergert/glproto: 255/526] add some missing uniform setters/types
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 255/526] add some missing uniform setters/types
- Date: Tue, 16 Feb 2021 01:14:31 +0000 (UTC)
commit 954ababa116162973952056482a6d0411f5321b7
Author: Christian Hergert <chergert redhat com>
Date: Wed Jan 13 23:11:35 2021 -0800
add some missing uniform setters/types
gsk/next/gskglcommandqueueprivate.h | 23 +++++++++++++++++++++--
gsk/next/gskgluniformstate.c | 27 +++++++++++++++++++++++++++
gsk/next/gskgluniformstateprivate.h | 6 ++++++
3 files changed, 54 insertions(+), 2 deletions(-)
---
diff --git a/gsk/next/gskglcommandqueueprivate.h b/gsk/next/gskglcommandqueueprivate.h
index 274b93343f..beaef7478f 100644
--- a/gsk/next/gskglcommandqueueprivate.h
+++ b/gsk/next/gskglcommandqueueprivate.h
@@ -154,6 +154,15 @@ void gsk_gl_command_queue_end_draw (GskGLCommandQueue
GskGLDrawVertex *gsk_gl_command_queue_add_vertices (GskGLCommandQueue *self,
const GskGLDrawVertex
vertices[GSK_GL_N_VERTICES]);
+static inline void
+gsk_gl_command_queue_set_uniform1ui (GskGLCommandQueue *self,
+ guint program,
+ guint location,
+ int value0)
+{
+ gsk_gl_uniform_state_set1ui (self->uniforms, program, location, value0);
+}
+
static inline void
gsk_gl_command_queue_set_uniform1i (GskGLCommandQueue *self,
guint program,
@@ -238,6 +247,16 @@ gsk_gl_command_queue_set_uniform4f (GskGLCommandQueue *self,
gsk_gl_uniform_state_set4f (self->uniforms, program, location, value0, value1, value2, value3);
}
+static inline void
+gsk_gl_command_queue_set_uniform1fv (GskGLCommandQueue *self,
+ guint program,
+ guint location,
+ gsize count,
+ const float *value)
+{
+ gsk_gl_uniform_state_set1fv (self->uniforms, program, location, count, value);
+}
+
static inline void
gsk_gl_command_queue_set_uniform2fv (GskGLCommandQueue *self,
guint program,
@@ -249,13 +268,13 @@ gsk_gl_command_queue_set_uniform2fv (GskGLCommandQueue *self,
}
static inline void
-gsk_gl_command_queue_set_uniform1fv (GskGLCommandQueue *self,
+gsk_gl_command_queue_set_uniform3fv (GskGLCommandQueue *self,
guint program,
guint location,
gsize count,
const float *value)
{
- gsk_gl_uniform_state_set1fv (self->uniforms, program, location, count, value);
+ gsk_gl_uniform_state_set3fv (self->uniforms, program, location, count, value);
}
static inline void
diff --git a/gsk/next/gskgluniformstate.c b/gsk/next/gskgluniformstate.c
index 77ed5cf33b..d470d53e7f 100644
--- a/gsk/next/gskgluniformstate.c
+++ b/gsk/next/gskgluniformstate.c
@@ -36,6 +36,8 @@ typedef struct { int v0; int v1; } Uniform2i;
typedef struct { int v0; int v1; int v2; } Uniform3i;
typedef struct { int v0; int v1; int v2; int v3; } Uniform4i;
+typedef struct { guint v0; } Uniform1ui;
+
static guint8 uniform_sizes[] = {
0,
@@ -54,6 +56,8 @@ static guint8 uniform_sizes[] = {
sizeof (Uniform3i),
sizeof (Uniform4i),
+ sizeof (Uniform1ui),
+
sizeof (guint),
sizeof (graphene_matrix_t),
@@ -349,6 +353,29 @@ gsk_gl_uniform_state_set4f (GskGLUniformState *state,
}
}
+void
+gsk_gl_uniform_state_set1ui (GskGLUniformState *state,
+ guint program,
+ guint location,
+ guint value0)
+{
+ Uniform1ui *u;
+ GskGLUniformInfo *info;
+
+ g_assert (state != NULL);
+ g_assert (program > 0);
+
+ if ((u = get_uniform (state, program, GSK_GL_UNIFORM_FORMAT_1UI, 1, location, &info)))
+ {
+ if (u->v0 != value0)
+ {
+ REPLACE_UNIFORM (info, u, GSK_GL_UNIFORM_FORMAT_1UI, 1);
+ u->v0 = value0;
+ program_changed (state, info, program);
+ }
+ }
+}
+
void
gsk_gl_uniform_state_set1i (GskGLUniformState *state,
guint program,
diff --git a/gsk/next/gskgluniformstateprivate.h b/gsk/next/gskgluniformstateprivate.h
index 2f68357b70..63bfd84f5f 100644
--- a/gsk/next/gskgluniformstateprivate.h
+++ b/gsk/next/gskgluniformstateprivate.h
@@ -75,6 +75,8 @@ typedef enum _GskGLUniformKind
GSK_GL_UNIFORM_FORMAT_3I,
GSK_GL_UNIFORM_FORMAT_4I,
+ GSK_GL_UNIFORM_FORMAT_1UI,
+
GSK_GL_UNIFORM_FORMAT_TEXTURE,
GSK_GL_UNIFORM_FORMAT_MATRIX,
@@ -130,6 +132,10 @@ void gsk_gl_uniform_state_set4fv (GskGLUniformState
guint location,
guint count,
const float *value);
+void gsk_gl_uniform_state_set1ui (GskGLUniformState *state,
+ guint program,
+ guint location,
+ guint value0);
void gsk_gl_uniform_state_set1i (GskGLUniformState *state,
guint program,
guint location,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]