[Mesa-dev] [PATCH 12/21] glsl: set outputs written directly in shader_info

Timothy Arceri timothy.arceri at collabora.com
Thu Oct 20 08:47:02 UTC 2016


---
 src/compiler/glsl/ir_set_program_inouts.cpp | 12 ++++++------
 src/compiler/shader_info.c                  |  1 -
 src/mesa/main/mtypes.h                      |  1 -
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/compiler/glsl/ir_set_program_inouts.cpp b/src/compiler/glsl/ir_set_program_inouts.cpp
index d693b66..9a33d56 100644
--- a/src/compiler/glsl/ir_set_program_inouts.cpp
+++ b/src/compiler/glsl/ir_set_program_inouts.cpp
@@ -24,13 +24,13 @@
 /**
  * \file ir_set_program_inouts.cpp
  *
- * Sets the inputs_read and OutputsWritten of Mesa programs.
+ * Sets the inputs_read and outputs_written of Mesa programs.
  *
  * Mesa programs (gl_program, not gl_shader_program) have a set of
  * flags indicating which varyings are read and written.  Computing
  * which are actually read from some sort of backend code can be
  * tricky when variable array indexing involved.  So this pass
- * provides support for setting inputs_read and OutputsWritten right
+ * provides support for setting inputs_read and outputs_written right
  * from the GLSL IR.
  */
 
@@ -83,10 +83,10 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len,
 {
    /* As of GLSL 1.20, varyings can only be floats, floating-point
     * vectors or matrices, or arrays of them.  For Mesa programs using
-    * inputs_read/OutputsWritten, everything but matrices uses one
+    * inputs_read/outputs_written, everything but matrices uses one
     * slot, while matrices use a slot per column.  Presumably
     * something doing a more clever packing would use something other
-    * than inputs_read/OutputsWritten.
+    * than inputs_read/outputs_written.
     */
 
    for (int i = 0; i < len; i++) {
@@ -130,7 +130,7 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len,
          if (is_patch_generic) {
             prog->PatchOutputsWritten |= bitfield;
          } else if (!var->data.read_only) {
-            prog->OutputsWritten |= bitfield;
+            prog->info.outputs_written |= bitfield;
             if (var->data.index > 0)
                prog->SecondaryOutputsWritten |= bitfield;
          }
@@ -427,7 +427,7 @@ do_set_program_inouts(exec_list *instructions, struct gl_program *prog,
    ir_set_program_inouts_visitor v(prog, shader_stage);
 
    prog->info.inputs_read = 0;
-   prog->OutputsWritten = 0;
+   prog->info.outputs_written = 0;
    prog->SecondaryOutputsWritten = 0;
    prog->OutputsRead = 0;
    prog->PatchInputsRead = 0;
diff --git a/src/compiler/shader_info.c b/src/compiler/shader_info.c
index df1abdd..355bee0 100644
--- a/src/compiler/shader_info.c
+++ b/src/compiler/shader_info.c
@@ -30,7 +30,6 @@ copy_shader_info(const struct gl_shader_program *shader_prog,
 {
    shader_info *info = &sh->Program->info;
 
-   info->outputs_written = sh->Program->OutputsWritten;
    info->outputs_read = sh->Program->OutputsRead;
    info->patch_inputs_read = sh->Program->PatchInputsRead;
    info->patch_outputs_written = sh->Program->PatchOutputsWritten;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9535e1f..bdbd128 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1922,7 +1922,6 @@ struct gl_program
 
    struct shader_info info;
 
-   GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */
    GLbitfield64 SecondaryOutputsWritten; /**< Subset of OutputsWritten outputs written with non-zero index. */
    GLbitfield64 OutputsRead; /**< Bitmask of which output regs are read */
    GLbitfield PatchInputsRead;  /**< VAR[0..31] usage for patch inputs (user-defined only) */
-- 
2.7.4



More information about the mesa-dev mailing list