[gtk/wip/chergert/glproto: 400/493] use fv and iv variants when setting uniforms
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 400/493] use fv and iv variants when setting uniforms
- Date: Fri, 19 Feb 2021 02:25:18 +0000 (UTC)
commit 13df9e47914f7075a86effb974b95aa2259e80ce
Author: Christian Hergert <chergert redhat com>
Date: Thu Feb 4 17:28:04 2021 -0800
use fv and iv variants when setting uniforms
otherwise we waste time filling registers for the function call. instead
just let the callee deal with that once.
gsk/next/gskglcommandqueue.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index 24b04be921..73fe739fe7 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -649,15 +649,15 @@ apply_uniform (gconstpointer dataptr,
break;
case GSK_GL_UNIFORM_FORMAT_2F:
- glUniform2f (location, data->fval[0], data->fval[1]);
+ glUniform2fv (location, 1, &data->fval[0]);
break;
case GSK_GL_UNIFORM_FORMAT_3F:
- glUniform3f (location, data->fval[0], data->fval[1], data->fval[2]);
+ glUniform3fv (location, 1, &data->fval[0]);
break;
case GSK_GL_UNIFORM_FORMAT_4F:
- glUniform4f (location, data->fval[0], data->fval[1], data->fval[2], data->fval[3]);
+ glUniform4fv (location, 1, &data->fval[0]);
break;
case GSK_GL_UNIFORM_FORMAT_1FV:
@@ -682,15 +682,15 @@ apply_uniform (gconstpointer dataptr,
break;
case GSK_GL_UNIFORM_FORMAT_2I:
- glUniform2i (location, data->ival[0], data->ival[1]);
+ glUniform2iv (location, 1, &data->ival[0]);
break;
case GSK_GL_UNIFORM_FORMAT_3I:
- glUniform3i (location, data->ival[0], data->ival[1], data->ival[2]);
+ glUniform3iv (location, 1, &data->ival[0]);
break;
case GSK_GL_UNIFORM_FORMAT_4I:
- glUniform4i (location, data->ival[0], data->ival[1], data->ival[2], data->ival[3]);
+ glUniform4iv (location, 1, &data->ival[0]);
break;
case GSK_GL_UNIFORM_FORMAT_1UI:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]