Mesa (master): mesa/st_tgsi_to_glsl: prepare add_constant for fp64

Dave Airlie airlied at kemper.freedesktop.org
Fri Feb 20 00:13:29 UTC 2015


Module: Mesa
Branch: master
Commit: 0178358a2d015a5fc8e3c7dfdd8ec4b1cfc64ea1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0178358a2d015a5fc8e3c7dfdd8ec4b1cfc64ea1

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Feb 17 09:44:50 2015 +1000

mesa/st_tgsi_to_glsl: prepare add_constant for fp64

This just moves stuff around a little to make the next patch
cleaner.

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |   41 ++++++++++++++--------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 3a95f27..56502fb 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -903,29 +903,30 @@ glsl_to_tgsi_visitor::add_constant(gl_register_file file,
    if (file == PROGRAM_CONSTANT) {
       return _mesa_add_typed_unnamed_constant(this->prog->Parameters, values,
                                               size, datatype, swizzle_out);
-   } else {
-      int index = 0;
-      immediate_storage *entry;
-      assert(file == PROGRAM_IMMEDIATE);
+   }
 
-      /* Search immediate storage to see if we already have an identical
-       * immediate that we can use instead of adding a duplicate entry.
-       */
-      foreach_in_list(immediate_storage, entry, &this->immediates) {
-         if (entry->size == size &&
-             entry->type == datatype &&
-             !memcmp(entry->values, values, size * sizeof(gl_constant_value))) {
-             return index;
-         }
-         index++;
-      }
+   assert(file == PROGRAM_IMMEDIATE);
 
-      /* Add this immediate to the list. */
-      entry = new(mem_ctx) immediate_storage(values, size, datatype);
-      this->immediates.push_tail(entry);
-      this->num_immediates++;
-      return index;
+   int index = 0;
+   immediate_storage *entry;
+
+   /* Search immediate storage to see if we already have an identical
+    * immediate that we can use instead of adding a duplicate entry.
+    */
+   foreach_in_list(immediate_storage, entry, &this->immediates) {
+      if (entry->size == size &&
+          entry->type == datatype &&
+          !memcmp(entry->values, values, size * sizeof(gl_constant_value))) {
+         return index;
+      }
+      index++;
    }
+
+   /* Add this immediate to the list. */
+   entry = new(mem_ctx) immediate_storage(values, size, datatype);
+   this->immediates.push_tail(entry);
+   this->num_immediates++;
+   return index;
 }
 
 st_src_reg




More information about the mesa-commit mailing list