[Mesa-dev] [PATCH 02/13] vbo: Use _VPMode instead of get_vp_mode().

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Thu Feb 15 19:55:14 UTC 2018


From: Mathias Fröhlich <mathias.froehlich at web.de>

At those places where we used get_vp_mode() use
gl_vertex_program_state::_VPMode instead.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
 src/mesa/vbo/vbo_exec.c       |  4 ++--
 src/mesa/vbo/vbo_exec_array.c | 11 ++++++-----
 src/mesa/vbo/vbo_exec_draw.c  |  5 +++--
 src/mesa/vbo/vbo_save_draw.c  |  5 +++--
 4 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index fc06979dcb..372d0237aa 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -34,7 +34,7 @@
 
 const GLubyte
 _vbo_attribute_alias_map[VP_MODE_MAX][VERT_ATTRIB_MAX] = {
-   /* VP_FF: */
+   /* VP_MODE_FF: */
    {
       VBO_ATTRIB_POS,                 /* VERT_ATTRIB_POS */
       VBO_ATTRIB_NORMAL,              /* VERT_ATTRIB_NORMAL */
@@ -70,7 +70,7 @@ _vbo_attribute_alias_map[VP_MODE_MAX][VERT_ATTRIB_MAX] = {
       VBO_ATTRIB_MAT_BACK_INDEXES     /* VERT_ATTRIB_GENERIC15 */
    },
 
-   /* VP_SHADER: */
+   /* VP_MODE_SHADER: */
    {
       VBO_ATTRIB_POS,                 /* VERT_ATTRIB_POS */
       VBO_ATTRIB_NORMAL,              /* VERT_ATTRIB_NORMAL */
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 25abe09559..0c3c9017b1 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -338,10 +338,11 @@ recalculate_input_bindings(struct gl_context *ctx)
    /* May shuffle the position and generic0 bits around */
    GLbitfield vp_inputs = _mesa_get_vao_vp_inputs(vao);
 
-   const enum vp_mode program_mode = get_vp_mode(ctx);
-   const GLubyte *const map = _vbo_attribute_alias_map[program_mode];
-   switch (program_mode) {
-   case VP_FF:
+   const gl_vertex_processing_mode processing_mode
+      = ctx->VertexProgram._VPMode;
+   const GLubyte * const map = _vbo_attribute_alias_map[processing_mode];
+   switch (processing_mode) {
+   case VP_MODE_FF:
       /* When no vertex program is active (or the vertex program is generated
        * from fixed-function state).  We put the material values into the
        * generic slots.  Since the vao has no material arrays, mute these
@@ -352,7 +353,7 @@ recalculate_input_bindings(struct gl_context *ctx)
 
       break;
 
-   case VP_SHADER:
+   case VP_MODE_SHADER:
       /* There are no shaders in OpenGL ES 1.x, so this code path should be
        * impossible to reach.  The meta code is careful to not use shaders in
        * ES1.
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index b0cc394642..4421496072 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -178,8 +178,9 @@ vbo_exec_bind_arrays(struct gl_context *ctx)
    GLuint attr;
    GLbitfield varying_inputs = 0x0;
 
-   const enum vp_mode program_mode = get_vp_mode(exec->ctx);
-   const GLubyte * const map = _vbo_attribute_alias_map[program_mode];
+   const gl_vertex_processing_mode processing_mode
+      = ctx->VertexProgram._VPMode;
+   const GLubyte * const map = _vbo_attribute_alias_map[processing_mode];
 
    /* Grab VERT_ATTRIB_{POS,GENERIC0} from VBO_ATTRIB_POS */
    const gl_attribute_map_mode mode = ATTRIBUTE_MAP_MODE_POSITION;
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 96a9bab029..8c58fecf40 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -142,8 +142,9 @@ bind_vertex_list(struct gl_context *ctx,
    GLuint attr;
    GLbitfield varying_inputs = 0x0;
 
-   const enum vp_mode program_mode = get_vp_mode(ctx);
-   const GLubyte * const map = _vbo_attribute_alias_map[program_mode];
+   const gl_vertex_processing_mode processing_mode
+      = ctx->VertexProgram._VPMode;
+   const GLubyte * const map = _vbo_attribute_alias_map[processing_mode];
 
    /* Grab VERT_ATTRIB_{POS,GENERIC0} from VBO_ATTRIB_POS */
    const gl_attribute_map_mode mode = ATTRIBUTE_MAP_MODE_POSITION;
-- 
2.14.3



More information about the mesa-dev mailing list