glsl/nir: Fix handling of 64-bit values in uniform storage
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 6 Jun 2019 15:46:25 +0000 (10:46 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 19 Jun 2019 21:05:54 +0000 (21:05 +0000)
Reviewed-by: Karol Herbst <kherbst@redhat.com>
src/compiler/glsl/gl_nir_link_uniform_initializers.c

index 36441b4bbe7858fe26a89cb7e05987fae3b9baf5..59ebdbd12e898d275cf466d04dc8f9924f7f42ea 100644 (file)
@@ -118,6 +118,7 @@ copy_constant_to_storage(union gl_constant_value *storage,
    const enum glsl_base_type base_type = glsl_get_base_type(type);
    const unsigned n_columns = glsl_get_matrix_columns(type);
    const unsigned n_rows = glsl_get_vector_elements(type);
+   unsigned dmul = glsl_base_type_is_64bit(base_type) ? 2 : 1;
    int i = 0;
 
    for (unsigned int column = 0; column < n_columns; column++) {
@@ -164,7 +165,7 @@ copy_constant_to_storage(union gl_constant_value *storage,
             assert(!"Should not get here.");
             break;
          }
-         i++;
+         i += dmul;
       }
    }
 }