uint32_t *ve_pack_dest = &cso->vertex_elements[1];
for (int i = 0; i < count; i++) {
+ enum isl_format isl_format =
+ iris_isl_format_for_pipe_format(state[i].src_format);
+ unsigned comp[4] = { VFCOMP_STORE_SRC, VFCOMP_STORE_SRC,
+ VFCOMP_STORE_SRC, VFCOMP_STORE_SRC };
+
+ switch (isl_format_get_num_channels(isl_format)) {
+ case 0: comp[0] = VFCOMP_STORE_0;
+ case 1: comp[1] = VFCOMP_STORE_0;
+ case 2: comp[2] = VFCOMP_STORE_0;
+ case 3:
+ comp[3] = isl_format_has_int_channel(isl_format) ? VFCOMP_STORE_1_INT
+ : VFCOMP_STORE_1_FP;
+ break;
+ }
iris_pack_state(GENX(VERTEX_ELEMENT_STATE), ve_pack_dest, ve) {
ve.VertexBufferIndex = state[i].vertex_buffer_index;
ve.Valid = true;
ve.SourceElementOffset = state[i].src_offset;
- ve.SourceElementFormat =
- iris_isl_format_for_pipe_format(state[i].src_format);
+ ve.SourceElementFormat = isl_format;
+ ve.Component0Control = comp[0];
+ ve.Component1Control = comp[1];
+ ve.Component2Control = comp[2];
+ ve.Component3Control = comp[3];
}
iris_pack_command(GENX(3DSTATE_VF_INSTANCING), cso->vf_instancing[i], vi) {