glsl: track which program inputs are doubles
authorDave Airlie <airlied@redhat.com>
Wed, 8 Apr 2015 04:38:19 +0000 (14:38 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 8 May 2015 00:21:01 +0000 (10:21 +1000)
instead of doing the attempts at dual slot handling here,
let the backend do it.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/glsl/ir_set_program_inouts.cpp
src/mesa/main/mtypes.h

index e877a201957f0530f53b4eb26c280490e075d857..b968a1efd3ed569451c506512a48488d7b20ba21 100644 (file)
@@ -105,13 +105,10 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len,
       int idx = var->data.location + var->data.index + offset + i;
       GLbitfield64 bitfield = BITFIELD64_BIT(idx);
 
-      /* dvec3 and dvec4 take up 2 slots */
-      if (dual_slot) {
-         idx += i;
-         bitfield |= bitfield << 1;
-      }
       if (var->data.mode == ir_var_shader_in) {
-        prog->InputsRead |= bitfield;
+         prog->InputsRead |= bitfield;
+         if (dual_slot)
+            prog->DoubleInputsRead |= bitfield;
          if (is_fragment_shader) {
             gl_fragment_program *fprog = (gl_fragment_program *) prog;
             fprog->InterpQualifier[idx] =
@@ -120,13 +117,6 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len,
                fprog->IsCentroid |= bitfield;
             if (var->data.sample)
                fprog->IsSample |= bitfield;
-
-            /* Set the InterpQualifier of the next slot to the same as the
-             * current one, since dvec3 and dvec4 spans 2 slots.
-             */
-            if (dual_slot)
-               fprog->InterpQualifier[idx + 1] =
-                  (glsl_interp_qualifier) var->data.interpolation;
          }
       } else if (var->data.mode == ir_var_system_value) {
          prog->SystemValuesRead |= bitfield;
index 1c5bb165794a069adae1e5efda867e7816877d69..ad772e56f31e9225b762d537054106ec4459be58 100644 (file)
@@ -2090,6 +2090,7 @@ struct gl_program
    struct nir_shader *nir;
 
    GLbitfield64 InputsRead;     /**< Bitmask of which input regs are read */
+   GLbitfield64 DoubleInputsRead;     /**< Bitmask of which input regs are read  and are doubles */
    GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */
    GLbitfield SystemValuesRead;   /**< Bitmask of SYSTEM_VALUE_x inputs used */
    GLbitfield InputFlags[MAX_PROGRAM_INPUTS];   /**< PROG_PARAM_BIT_x flags */