glsl: remove temp variable to make code easier to read
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 13 Nov 2015 00:28:20 +0000 (11:28 +1100)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Tue, 17 Nov 2015 20:30:07 +0000 (07:30 +1100)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/glsl/ast_to_hir.cpp

index d2b97d2848f622452f8754a1a3330e63445edc36..9856f16323b12368e29894fc9f7ce45cc0128798 100644 (file)
@@ -6245,20 +6245,17 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
             /* For readonly and writeonly qualifiers the field definition,
              * if set, overwrites the layout qualifier.
              */
-            bool read_only = layout->flags.q.read_only;
-            bool write_only = layout->flags.q.write_only;
-
             if (qual->flags.q.read_only) {
-               read_only = true;
-               write_only = false;
+               fields[i].image_read_only = true;
+               fields[i].image_write_only = false;
             } else if (qual->flags.q.write_only) {
-               read_only = false;
-               write_only = true;
+               fields[i].image_read_only = false;
+               fields[i].image_write_only = true;
+            } else {
+               fields[i].image_read_only = layout->flags.q.read_only;
+               fields[i].image_write_only = layout->flags.q.write_only;
             }
 
-            fields[i].image_read_only = read_only;
-            fields[i].image_write_only = write_only;
-
             /* For other qualifiers, we set the flag if either the layout
              * qualifier or the field qualifier are set
              */