glsl: fix partial marking for fp64 types.
authorDave Airlie <airlied@redhat.com>
Mon, 12 Oct 2015 03:55:00 +0000 (13:55 +1000)
committerDave Airlie <airlied@redhat.com>
Sat, 19 Dec 2015 01:42:26 +0000 (11:42 +1000)
This doubles the element width for the types that are greater
than 2 elements wide.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/glsl/ir_set_program_inouts.cpp

index c9b8a38384ff924c6841253b669e73b256b12390..a2dea67c6a99f8cb3f380eac39b7a256c0d64111 100644 (file)
@@ -301,6 +301,13 @@ ir_set_program_inouts_visitor::try_mark_partial_variable(ir_variable *var,
       return false;
    }
 
+   /* double element width for double types that takes two slots */
+   if (this->shader_stage != MESA_SHADER_VERTEX ||
+       var->data.mode != ir_var_shader_in) {
+      if (type->without_array()->is_dual_slot_double())
+        elem_width *= 2;
+   }
+
    mark(this->prog, var, index_as_constant->value.u[0] * elem_width,
         elem_width, this->shader_stage);
    return true;