X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi965%2Fbrw_clip_util.c;h=d2ac1235e46fa6a3f88288a699093013b54480b5;hb=fa2deb3ddc8dc9e3eedf7f3dc1d2d2945a95f79b;hp=a730664f9b3bcd623a51d5c5b21e19e817f433d4;hpb=431a51b9af32980ae8a544d129bf567287887376;p=mesa.git diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c index a730664f9b3..d2ac1235e46 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_util.c +++ b/src/mesa/drivers/dri/i965/brw_clip_util.c @@ -33,7 +33,7 @@ #include "main/glheader.h" #include "main/macros.h" #include "main/enums.h" -#include "shader/program.h" +#include "program/program.h" #include "intel_batchbuffer.h" @@ -134,7 +134,6 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, GLboolean force_edgeflag) { struct brw_compile *p = &c->func; - struct intel_context *intel = &p->brw->intel; struct brw_reg tmp = get_tmp(c); GLuint i; @@ -149,12 +148,9 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, /* Iterate over each attribute (could be done in pairs?) */ for (i = 0; i < c->nr_attrs; i++) { - GLuint delta = i*16 + 32; + GLuint delta = c->offset[c->idx_to_attr[i]]; - if (intel->gen == 5) - delta = i * 16 + 32 * 3; - - if (delta == c->offset[VERT_RESULT_EDGE]) { + if (c->idx_to_attr[i] == VERT_RESULT_EDGE) { if (force_edgeflag) brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(1)); else @@ -183,10 +179,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, } if (i & 1) { - GLuint delta = i*16 + 32; - - if (intel->gen == 5) - delta = i * 16 + 32 * 3; + GLuint delta = c->offset[c->idx_to_attr[c->nr_attrs - 1]] + ATTR_SIZE; brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(0)); } @@ -199,11 +192,6 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c, brw_clip_project_vertex(c, dest_ptr ); } - - - -#define MAX_MRF 16 - void brw_clip_emit_vue(struct brw_clip_compile *c, struct brw_indirect vert, GLboolean allocate, @@ -211,27 +199,14 @@ void brw_clip_emit_vue(struct brw_clip_compile *c, GLuint header) { struct brw_compile *p = &c->func; - GLuint start = c->last_mrf; brw_clip_ff_sync(c); assert(!(allocate && eot)); - - /* Cycle through mrf regs - probably futile as we have to wait for - * the allocation response anyway. Also, the order this function - * is invoked doesn't correspond to the order the instructions will - * be executed, so it won't have any effect in many cases. - */ -#if 0 - if (start + c->nr_regs + 1 >= MAX_MRF) - start = 0; - c->last_mrf = start + c->nr_regs + 1; -#endif - /* Copy the vertex from vertn into m1..mN+1: */ - brw_copy_from_indirect(p, brw_message_reg(start+1), vert, c->nr_regs); + brw_copy_from_indirect(p, brw_message_reg(1), vert, c->nr_regs); /* Overwrite PrimType and PrimStart in the message header, for * each vertex in turn: @@ -247,7 +222,7 @@ void brw_clip_emit_vue(struct brw_clip_compile *c, */ brw_urb_WRITE(p, allocate ? c->reg.R0 : retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), - start, + 0, c->reg.R0, allocate, 1, /* used */