ac: pass the unmodified number of components to load gs inputs
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 1 Mar 2018 04:37:25 +0000 (15:37 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 6 Mar 2018 00:44:06 +0000 (11:44 +1100)
Currently both users of this would overflow an array when the
input was a dual slot double as they expected the number of
components to be a max of 4.

Since we pass the type we can just let the functions handle
doubles in a way they choose.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index d2df2837c8ac1b281366720985f8e1c8602d1083..1fe09de4848e67506818692cabb8e8120fb53e06 100644 (file)
@@ -3136,8 +3136,8 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx,
 
                        return ctx->abi->load_inputs(ctx->abi, instr->variables[0]->var->data.location,
                                                     instr->variables[0]->var->data.driver_location,
-                                                    instr->variables[0]->var->data.location_frac, ve,
-                                                    vertex_index, const_index, type);
+                                                    instr->variables[0]->var->data.location_frac,
+                                                    instr->num_components, vertex_index, const_index, type);
                }
 
                for (unsigned chan = comp; chan < ve + comp; chan++) {