i965: Move SOL PSIZ hacks from draw time to link time.

We can just update the gl_transform_feedback_info fields at link time
to make the VUE header fields have the right location and component.
Then we don't need to handle them specially at draw time, which is
expensive.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
This commit is contained in:
Kenneth Graunke
2017-02-28 12:29:43 -08:00
parent 3d37cf99c8
commit 65f5f3c85c
3 changed files with 41 additions and 34 deletions

View File

@@ -687,18 +687,7 @@ gen6_gs_visitor::xfb_program(unsigned vertex, unsigned num_verts)
emit(MOV(dst_reg(this->vertex_output_offset), brw_imm_d(offset)));
memcpy(data.reladdr, &this->vertex_output_offset, sizeof(src_reg));
data.type = output_reg[varying][0].type;
/* PSIZ, LAYER and VIEWPORT are packed in different channels of the
* same slot, so make sure we write the appropriate channel
*/
if (varying == VARYING_SLOT_PSIZ)
data.swizzle = BRW_SWIZZLE_WWWW;
else if (varying == VARYING_SLOT_LAYER)
data.swizzle = BRW_SWIZZLE_YYYY;
else if (varying == VARYING_SLOT_VIEWPORT)
data.swizzle = BRW_SWIZZLE_ZZZZ;
else
data.swizzle = gs_prog_data->transform_feedback_swizzles[binding];
data.swizzle = gs_prog_data->transform_feedback_swizzles[binding];
/* Write data */
inst = emit(GS_OPCODE_SVB_WRITE, mrf_reg, data, sol_temp);