case TGSI_INTERPOLATE_LINEAR: {
LLVMValueRef dadx_ptr = LLVMBuildGEP(builder, bld->dadx_ptr, &index, 1, "");
LLVMValueRef dady_ptr = LLVMBuildGEP(builder, bld->dady_ptr, &index, 1, "");
+ dadx = LLVMBuildLoad(builder, dadx_ptr, "");
+ dady = LLVMBuildLoad(builder, dady_ptr, "");
+ dadx = lp_build_broadcast_scalar(&bld->base, dadx);
+ dady = lp_build_broadcast_scalar(&bld->base, dady);
util_snprintf(name, sizeof name, "dadx_%u.%c", attrib, "xyzw"[chan]);
- dadx = LLVMBuildLoad(builder, dadx_ptr, name);
+ LLVMSetValueName(dadx, name);
util_snprintf(name, sizeof name, "dady_%u.%c", attrib, "xyzw"[chan]);
- dady = LLVMBuildLoad(builder, dady_ptr, name);
+ LLVMSetValueName(dady, name);
}
case TGSI_INTERPOLATE_CONSTANT: {
LLVMValueRef a0_ptr = LLVMBuildGEP(builder, bld->a0_ptr, &index, 1, "");
+ a0 = LLVMBuildLoad(builder, a0_ptr, "");
+ a0 = lp_build_broadcast_scalar(&bld->base, a0);
util_snprintf(name, sizeof name, "a0_%u.%c", attrib, "xyzw"[chan]);
- a0 = LLVMBuildLoad(builder, a0_ptr, name);
+ LLVMSetValueName(a0, name);
break;
}
struct quad_stage stage; /**< base class */
union tgsi_exec_channel ALIGN16_ATTRIB pos[NUM_CHANNELS];
- union tgsi_exec_channel ALIGN16_ATTRIB a0[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
- union tgsi_exec_channel ALIGN16_ATTRIB dadx[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
- union tgsi_exec_channel ALIGN16_ATTRIB dady[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
+ float ALIGN16_ATTRIB a0[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
+ float ALIGN16_ATTRIB dadx[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
+ float ALIGN16_ATTRIB dady[PIPE_MAX_SHADER_INPUTS][NUM_CHANNELS];
struct tgsi_exec_vector ALIGN16_ATTRIB outputs[PIPE_MAX_ATTRIBS];
};
for (attrib = 0; attrib < num_inputs; ++attrib) {
for (chan = 0; chan < NUM_CHANNELS; ++chan) {
- for( i = 0; i < QUAD_SIZE; ++i ) {
- qss->a0[attrib][chan].f[i] = coef[attrib].a0[chan];
- qss->dadx[attrib][chan].f[i] = coef[attrib].dadx[chan];
- qss->dady[attrib][chan].f[i] = coef[attrib].dady[chan];
- }
+ qss->a0[attrib][chan] = coef[attrib].a0[chan];
+ qss->dadx[attrib][chan] = coef[attrib].dadx[chan];
+ qss->dady[attrib][chan] = coef[attrib].dady[chan];
}
}
}
vec_type = lp_build_vec_type(type);
arg_types[0] = LLVMPointerType(vec_type, 0); /* pos */
- arg_types[1] = LLVMPointerType(vec_type, 0); /* a0 */
- arg_types[2] = LLVMPointerType(vec_type, 0); /* dadx */
- arg_types[3] = LLVMPointerType(vec_type, 0); /* dady */
+ arg_types[1] = LLVMPointerType(elem_type, 0); /* a0 */
+ arg_types[2] = LLVMPointerType(elem_type, 0); /* dadx */
+ arg_types[3] = LLVMPointerType(elem_type, 0); /* dady */
arg_types[4] = LLVMPointerType(elem_type, 0); /* consts */
arg_types[5] = LLVMPointerType(vec_type, 0); /* outputs */
arg_types[6] = LLVMPointerType(LLVMInt8Type(), 0); /* samplers */