nir/xfb: Properly align 64-bit values
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 12 Feb 2019 18:49:08 +0000 (12:49 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Thu, 21 Feb 2019 00:08:42 +0000 (00:08 +0000)
Fixes: 19064b8c "nir: Add a pass for gathering transform feedback info"
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
src/compiler/nir/nir_gather_xfb_info.c

index 176bf8990034cde068672a7ff3ac1b59ef57c967..446b7ac0495bf59ab04756a0691c7dcb2cdd79b6 100644 (file)
@@ -33,6 +33,10 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
                     unsigned *offset,
                     const struct glsl_type *type)
 {
+   /* If this type contains a 64-bit value, align to 8 bytes */
+   if (glsl_type_contains_64bit(type))
+      *offset = ALIGN_POT(*offset, 8);
+
    if (glsl_type_is_array(type) || glsl_type_is_matrix(type)) {
       unsigned length = glsl_get_length(type);
       const struct glsl_type *child_type = glsl_get_array_element(type);