[Mesa-dev] [PATCH 03/17] st/mesa: remove st_context::vertex_result_to_slot

Marek Olšák maraeo at gmail.com
Mon May 1 12:52:52 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/mesa/state_tracker/st_atom_shader.c  | 2 --
 src/mesa/state_tracker/st_cb_feedback.c  | 4 ++--
 src/mesa/state_tracker/st_cb_rasterpos.c | 3 ++-
 src/mesa/state_tracker/st_context.h      | 3 ---
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index 0a72d14..091cbe0 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -172,22 +172,20 @@ st_update_vp( struct st_context *st )
                        VARYING_SLOT_COL1 |
                        VARYING_SLOT_BFC0 |
                        VARYING_SLOT_BFC1));
 
    st->vp_variant = st_get_vp_variant(st, stvp, &key);
 
    st_reference_vertprog(st, &st->vp, stvp);
 
    cso_set_vertex_shader_handle(st->cso_context, 
                                 st->vp_variant->driver_shader);
-
-   st->vertex_result_to_slot = stvp->result_to_output;
 }
 
 
 void
 st_update_gp( struct st_context *st )
 {
    struct st_geometry_program *stgp;
 
    if (!st->ctx->GeometryProgram._Current) {
       cso_set_geometry_shader_handle(st->cso_context, NULL);
diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c
index 7f383eb..2ca2def 100644
--- a/src/mesa/state_tracker/st_cb_feedback.c
+++ b/src/mesa/state_tracker/st_cb_feedback.c
@@ -92,27 +92,27 @@ feedback_vertex(struct gl_context *ctx, const struct draw_context *draw,
    else
       win[1] = v->data[0][1];
    win[2] = v->data[0][2];
    win[3] = 1.0F / v->data[0][3];
 
    /* XXX
     * When we compute vertex layout, save info about position of the
     * color and texcoord attribs to use here.
     */
 
-   slot = st->vertex_result_to_slot[VARYING_SLOT_COL0];
+   slot = st->vp->result_to_output[VARYING_SLOT_COL0];
    if (slot != ~0U)
       color = v->data[slot];
    else
       color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
 
-   slot = st->vertex_result_to_slot[VARYING_SLOT_TEX0];
+   slot = st->vp->result_to_output[VARYING_SLOT_TEX0];
    if (slot != ~0U)
       texcoord = v->data[slot];
    else
       texcoord = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
 
    _mesa_feedback_vertex(ctx, win, color, texcoord);
 }
 
 
 static void
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index c55b624..e266296 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -37,20 +37,21 @@
 
 
 #include "main/imports.h"
 #include "main/macros.h"
 #include "main/feedback.h"
 #include "main/rastpos.h"
 
 #include "st_context.h"
 #include "st_atom.h"
 #include "st_draw.h"
+#include "st_program.h"
 #include "st_cb_rasterpos.h"
 #include "draw/draw_context.h"
 #include "draw/draw_pipe.h"
 #include "vbo/vbo.h"
 
 
 /**
  * Our special drawing pipeline stage (replaces rasterization).
  */
 struct rastpos_stage
@@ -127,21 +128,21 @@ update_attrib(struct gl_context *ctx, const ubyte *outputMapping,
 /**
  * Normally, this function would render a GL_POINT.
  */
 static void
 rastpos_point(struct draw_stage *stage, struct prim_header *prim)
 {
    struct rastpos_stage *rs = rastpos_stage(stage);
    struct gl_context *ctx = rs->ctx;
    struct st_context *st = st_context(ctx);
    const GLfloat height = (GLfloat) ctx->DrawBuffer->Height;
-   const ubyte *outputMapping = st->vertex_result_to_slot;
+   const ubyte *outputMapping = st->vp->result_to_output;
    const GLfloat *pos;
    GLuint i;
 
    /* if we get here, we didn't get clipped */
    ctx->Current.RasterPosValid = GL_TRUE;
 
    /* update raster pos */
    pos = prim->v[0]->data[0];
    ctx->Current.RasterPos[0] = pos[0];
    if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP)
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index d02c6f8..f1b38fc 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -163,23 +163,20 @@ struct st_context
 
    /* If true, further analysis of states is required to know if something
     * has changed. Used mainly for shaders.
     */
    bool gfx_shaders_may_be_dirty;
    bool compute_shader_may_be_dirty;
 
    GLboolean vertdata_edgeflags;
    GLboolean edgeflag_culls_prims;
 
-   /** Mapping from VARYING_SLOT_x to post-transformed vertex slot */
-   const ubyte *vertex_result_to_slot;
-
    struct st_vertex_program *vp;    /**< Currently bound vertex program */
    struct st_fragment_program *fp;  /**< Currently bound fragment program */
    struct st_geometry_program *gp;  /**< Currently bound geometry program */
    struct st_tessctrl_program *tcp; /**< Currently bound tess control program */
    struct st_tesseval_program *tep; /**< Currently bound tess eval program */
    struct st_compute_program *cp;   /**< Currently bound compute program */
 
    struct st_vp_variant *vp_variant;
    struct st_fp_variant *fp_variant;
    struct st_basic_variant *gp_variant;
-- 
2.7.4



More information about the mesa-dev mailing list