while (vs_inputs) {
GLuint index = ffsll(vs_inputs) - 1;
struct brw_vertex_element *input = &brw->vb.inputs[index];
-
+ input->is_dual_slot = brw->gen >= 8 &&
+ (vs_prog_data->double_inputs_read & BITFIELD64_BIT(index)) != 0;
vs_inputs &= ~BITFIELD64_BIT(index);
brw->vb.enabled[brw->vb.nr_enabled++] = input;
}
uint64_t outputs_written =
brw_vs_outputs_written(brw, key, vp->program.info.outputs_written);
prog_data.inputs_read = vp->program.info.inputs_read;
+ prog_data.double_inputs_read = vp->program.info.double_inputs_read;
if (key->copy_edgeflag) {
prog_data.inputs_read |= VERT_BIT_EDGEFLAG;
case 0: comp0 = BRW_VE1_COMPONENT_STORE_0;
case 1: comp1 = BRW_VE1_COMPONENT_STORE_0;
case 2: comp2 = BRW_VE1_COMPONENT_STORE_0;
- case 3: comp3 = input->glarray->Integer ? BRW_VE1_COMPONENT_STORE_1_INT
- : BRW_VE1_COMPONENT_STORE_1_FLT;
+ case 3:
+ if (input->glarray->Doubles) {
+ comp3 = BRW_VE1_COMPONENT_STORE_0;
+ } else if (input->glarray->Integer) {
+ comp3 = BRW_VE1_COMPONENT_STORE_1_INT;
+ } else {
+ comp3 = BRW_VE1_COMPONENT_STORE_1_FLT;
+ }
+
break;
}
* to be specified as VFCOMP_STORE_0 in order to output a 256-bit vertex
* element."
*/
- if (input->glarray->Doubles) {
- switch (input->glarray->Size) {
- case 0:
- case 1:
- case 2:
- /* Use 128-bits instead of 256-bits to write double and dvec2
- * vertex elements.
- */
- comp2 = BRW_VE1_COMPONENT_NOSTORE;
- comp3 = BRW_VE1_COMPONENT_NOSTORE;
- break;
- case 3:
- /* Pad the output using VFCOMP_STORE_0 as suggested
- * by the BDW PRM.
- */
- comp3 = BRW_VE1_COMPONENT_STORE_0;
- break;
- }
+ if (input->glarray->Doubles && !input->is_dual_slot) {
+ /* Store vertex elements which correspond to double and dvec2 vertex
+ * shader inputs as 128-bit vertex elements, instead of 256-bits.
+ */
+ comp2 = BRW_VE1_COMPONENT_NOSTORE;
+ comp3 = BRW_VE1_COMPONENT_NOSTORE;
}
OUT_BATCH((input->buffer << GEN6_VE0_INDEX_SHIFT) |