[Mesa-dev] [PATCH 09/21] st/mesa: use common outputs written field

Timothy Arceri timothy.arceri at collabora.com
Thu Oct 20 08:46:59 UTC 2016


---
 src/mesa/state_tracker/st_atifs_to_tgsi.c   | 2 +-
 src/mesa/state_tracker/st_atom_rasterizer.c | 6 ++++--
 src/mesa/state_tracker/st_atom_shader.c     | 2 +-
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp  | 3 ++-
 src/mesa/state_tracker/st_program.c         | 6 +++---
 5 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/mesa/state_tracker/st_atifs_to_tgsi.c b/src/mesa/state_tracker/st_atifs_to_tgsi.c
index 2f2876b..aaa7a4b 100644
--- a/src/mesa/state_tracker/st_atifs_to_tgsi.c
+++ b/src/mesa/state_tracker/st_atifs_to_tgsi.c
@@ -548,7 +548,7 @@ st_init_atifs_prog(struct gl_context *ctx, struct gl_program *prog)
       {STATE_FOG_COLOR, 0, 0, 0, 0};
 
    prog->info.inputs_read = 0;
-   prog->OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR);
+   prog->info.outputs_written = BITFIELD64_BIT(FRAG_RESULT_COLOR);
    prog->SamplersUsed = 0;
    prog->Parameters = _mesa_new_parameter_list();
 
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index a97a5ac..8503041 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -195,7 +195,8 @@ static void update_raster_state( struct st_context *st )
     */
    if (vertProg) {
       if (vertProg->Id == 0) {
-         if (vertProg->OutputsWritten & BITFIELD64_BIT(VARYING_SLOT_PSIZ)) {
+         if (vertProg->info.outputs_written &
+             BITFIELD64_BIT(VARYING_SLOT_PSIZ)) {
             /* generated program which emits point size */
             raster->point_size_per_vertex = TRUE;
          }
@@ -216,7 +217,8 @@ static void update_raster_state( struct st_context *st )
             last = ctx->VertexProgram._Current;
          if (last)
             raster->point_size_per_vertex =
-               !!(last->OutputsWritten & BITFIELD64_BIT(VARYING_SLOT_PSIZ));
+               !!(last->info.outputs_written &
+                  BITFIELD64_BIT(VARYING_SLOT_PSIZ));
       }
    }
    if (!raster->point_size_per_vertex) {
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index b77000e..8c10ac9 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -190,7 +190,7 @@ update_vp( struct st_context *st )
 
    key.clamp_color = st->clamp_vert_color_in_shader &&
                      st->ctx->Light._ClampVertexColor &&
-                     (stvp->Base.OutputsWritten &
+                     (stvp->Base.info.outputs_written &
                       (VARYING_SLOT_COL0 |
                        VARYING_SLOT_COL1 |
                        VARYING_SLOT_BFC0 |
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index bd4765b..8d8df9d 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6479,7 +6479,8 @@ get_mesa_program_tgsi(struct gl_context *ctx,
                              prog->info.double_inputs_read,
                              &prog->PatchInputsRead);
    shrink_array_declarations(v->outputs, v->num_outputs,
-                             &prog->OutputsWritten, 0ULL, &prog->PatchOutputsWritten);
+                             &prog->info.outputs_written, 0ULL,
+                             &prog->PatchOutputsWritten);
    count_resources(v, prog);
 
    /* The GLSL IR won't be needed anymore. */
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 28b7bf6..b1ca0c6 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -269,7 +269,7 @@ st_translate_vertex_program(struct st_context *st,
    /* Compute mapping of vertex program outputs to slots.
     */
    for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
-      if ((stvp->Base.OutputsWritten & BITFIELD64_BIT(attr)) == 0) {
+      if ((stvp->Base.info.outputs_written & BITFIELD64_BIT(attr)) == 0) {
          stvp->result_to_output[attr] = ~0;
       }
       else {
@@ -754,7 +754,7 @@ st_translate_fragment_program(struct st_context *st,
     * Semantics and mapping for outputs
     */
    {
-      GLbitfield64 outputsWritten = stfp->Base.OutputsWritten;
+      GLbitfield64 outputsWritten = stfp->Base.info.outputs_written;
 
       /* if z is written, emit that first */
       if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
@@ -1325,7 +1325,7 @@ st_translate_program_common(struct st_context *st,
     * mapping and the semantic information for each output.
     */
    for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
-      if (prog->OutputsWritten & BITFIELD64_BIT(attr)) {
+      if (prog->info.outputs_written & BITFIELD64_BIT(attr)) {
          GLuint slot = num_outputs++;
 
          outputMapping[attr] = slot;
-- 
2.7.4



More information about the mesa-dev mailing list