Module: Mesa
Branch: main
Commit: 5f2f75aa671eee2f0973945c7beba2a1380f4d7f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f2f75aa671eee2f0973945c7beba2a1380f4d7f

Author: Corentin Noël <corentin.n...@collabora.com>
Date:   Mon Nov  6 12:39:24 2023 +0100

mesa/ffvs: Use gl_state_index16 in helpers directly

register_state_var will have to convert everything to gl_state_index16 and the
values given to it are already either gl_state_index or any short integer which
are covered by the gl_state_index16 type.

Signed-off-by: Corentin Noël <corentin.n...@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-l...@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26067>

---

 src/mesa/main/ffvertex_prog.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index bfa6e898528..76f58b8cdb5 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -296,10 +296,10 @@ struct tnl_program {
 
 static nir_variable *
 register_state_var(struct tnl_program *p,
-                   gl_state_index s0,
-                   gl_state_index s1,
-                   gl_state_index s2,
-                   gl_state_index s3,
+                   gl_state_index16 s0,
+                   gl_state_index16 s1,
+                   gl_state_index16 s2,
+                   gl_state_index16 s3,
                    const struct glsl_type *type)
 {
    gl_state_index16 tokens[STATE_LENGTH];
@@ -319,10 +319,10 @@ register_state_var(struct tnl_program *p,
 
 static nir_def *
 load_state_var(struct tnl_program *p,
-               gl_state_index s0,
-               gl_state_index s1,
-               gl_state_index s2,
-               gl_state_index s3,
+               gl_state_index16 s0,
+               gl_state_index16 s1,
+               gl_state_index16 s2,
+               gl_state_index16 s3,
                const struct glsl_type *type)
 {
    nir_variable *var = register_state_var(p, s0, s1, s2, s3, type);
@@ -331,10 +331,10 @@ load_state_var(struct tnl_program *p,
 
 static nir_def *
 load_state_vec4(struct tnl_program *p,
-                gl_state_index s0,
-                gl_state_index s1,
-                gl_state_index s2,
-                gl_state_index s3)
+                gl_state_index16 s0,
+                gl_state_index16 s1,
+                gl_state_index16 s2,
+                gl_state_index16 s3)
 {
    return load_state_var(p, s0, s1, s2, s3, glsl_vec4_type());
 }

Reply via email to