: retype(brw_null_reg(), BRW_REGISTER_TYPE_UD),
0,
c->reg.header,
- allocate,
- 1, /* used */
+ allocate ? BRW_URB_WRITE_ALLOCATE_COMPLETE
+ : BRW_URB_WRITE_EOT_COMPLETE,
c->nr_regs + 1, /* msg length */
allocate ? 1 : 0, /* response length */
- allocate ? 0 : 1, /* eot */
- 1, /* writes_complete */
0, /* urb offset */
BRW_URB_SWIZZLE_NONE);
}
}
-/**
- * De-allocate the URB entry that was previously allocated to this thread
- * (without writing any vertex data to it), and terminate the thread. This is
- * used to implement RASTERIZER_DISCARD functionality.
- */
-static void brw_gs_terminate(struct brw_gs_compile *c)
-{
- struct brw_compile *p = &c->func;
- brw_urb_WRITE(p,
- retype(brw_null_reg(), BRW_REGISTER_TYPE_UD), /* dest */
- 0, /* msg_reg_nr */
- c->reg.header, /* src0 */
- false, /* allocate */
- false, /* used */
- 1, /* msg_length */
- 0, /* response_length */
- true, /* eot */
- true, /* writes_complete */
- 0, /* offset */
- BRW_URB_SWIZZLE_NONE);
-}
-
/**
* Send an FF_SYNC message to ensure that all previously spawned GS threads
* have finished sending primitives down the pipeline, and to allocate a URB
- * entry for the first output vertex. Only needed when intel->needs_ff_sync
- * is true.
+ * entry for the first output vertex. Only needed on Ironlake+.
*
* This function modifies c->reg.header: in DWORD 1, it stores num_prim (which
* is needed by the FF_SYNC message), and in DWORD 0, it stores the handle to
void brw_gs_quads( struct brw_gs_compile *c, struct brw_gs_prog_key *key )
{
- struct intel_context *intel = &c->func.brw->intel;
+ struct brw_context *brw = c->func.brw;
brw_gs_alloc_regs(c, 4, false);
brw_gs_initialize_header(c);
/* Use polygons for correct edgeflag behaviour. Note that vertex 3
* is the PV for quads, but vertex 0 for polygons:
*/
- if (intel->needs_ff_sync)
+ if (brw->gen == 5)
brw_gs_ff_sync(c, 1);
brw_gs_overwrite_header_dw2(
c, ((_3DPRIM_POLYGON << URB_WRITE_PRIM_TYPE_SHIFT)
void brw_gs_quad_strip( struct brw_gs_compile *c, struct brw_gs_prog_key *key )
{
- struct intel_context *intel = &c->func.brw->intel;
+ struct brw_context *brw = c->func.brw;
brw_gs_alloc_regs(c, 4, false);
brw_gs_initialize_header(c);
- if (intel->needs_ff_sync)
+ if (brw->gen == 5)
brw_gs_ff_sync(c, 1);
brw_gs_overwrite_header_dw2(
c, ((_3DPRIM_POLYGON << URB_WRITE_PRIM_TYPE_SHIFT)
void brw_gs_lines( struct brw_gs_compile *c )
{
- struct intel_context *intel = &c->func.brw->intel;
+ struct brw_context *brw = c->func.brw;
brw_gs_alloc_regs(c, 2, false);
brw_gs_initialize_header(c);
- if (intel->needs_ff_sync)
+ if (brw->gen == 5)
brw_gs_ff_sync(c, 1);
brw_gs_overwrite_header_dw2(
c, ((_3DPRIM_LINESTRIP << URB_WRITE_PRIM_TYPE_SHIFT)
brw_gs_ff_sync(c, 1);
- /* If RASTERIZER_DISCARD is enabled, we have nothing further to do, so
- * release the URB that was just allocated, and terminate the thread.
- */
- if (key->rasterizer_discard) {
- brw_gs_terminate(c);
- return;
- }
-
brw_gs_overwrite_header_dw2_from_r0(c);
switch (num_verts) {
case 1: