[Mesa-dev] [PATCH 04/10] mesa: Check isES before calling validate_io

Ian Romanick idr at freedesktop.org
Fri May 20 07:25:59 UTC 2016


From: Ian Romanick <ian.d.romanick at intel.com>

There's going to be a second validate_io function, and checking the same
thing twice is silly.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/main/shader_query.cpp | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 9e18a1c..a120cb4 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -1372,7 +1372,7 @@ _mesa_get_program_resourceiv(struct gl_shader_program *shProg,
 
 static bool
 validate_io(const struct gl_shader *producer,
-            const struct gl_shader *consumer, bool isES)
+            const struct gl_shader *consumer)
 {
    assert(producer && consumer);
    unsigned inputs = 0, outputs = 0;
@@ -1416,10 +1416,6 @@ validate_io(const struct gl_shader *producer,
     * packing makes this challenging.
     */
 
-   /* Currently no matching done for desktop. */
-   if (!isES)
-      return true;
-
    /* For each output in a, find input in b and do any required checks. */
    foreach_in_list(ir_instruction, out, producer->ir) {
       ir_variable *out_var = out->as_variable();
@@ -1501,10 +1497,12 @@ _mesa_validate_pipeline_io(struct gl_pipeline_object *pipeline)
          if (shProg[idx]->_LinkedShaders[idx]->Stage == MESA_SHADER_COMPUTE)
             break;
 
-         if (!validate_io(shProg[prev]->_LinkedShaders[prev],
-                          shProg[idx]->_LinkedShaders[idx],
-                          shProg[prev]->IsES || shProg[idx]->IsES))
-            return false;
+         if (shProg[prev]->IsES || shProg[idx]->IsES) {
+            if (!validate_io(shProg[prev]->_LinkedShaders[prev],
+                             shProg[idx]->_LinkedShaders[idx]))
+               return false;
+         }
+
          prev = idx;
       }
    }
-- 
2.5.5



More information about the mesa-dev mailing list