static int upload_line_stipple(struct brw_context *brw) { const struct brw_line_stipple *bls = &brw->curr.rast->bls; if (bls->header.opcode) { BRW_CACHED_BATCH_STRUCT(brw, bls); } return 0; }
static void upload_blend_constant_color(struct brw_context *brw) { struct brw_blend_constant_color bcc; memset(&bcc, 0, sizeof(bcc)); bcc.header.opcode = CMD_BLEND_CONSTANT_COLOR; bcc.header.length = sizeof(bcc)/4-2; bcc.blend_constant_color[0] = brw->attribs.Color->BlendColor[0]; bcc.blend_constant_color[1] = brw->attribs.Color->BlendColor[1]; bcc.blend_constant_color[2] = brw->attribs.Color->BlendColor[2]; bcc.blend_constant_color[3] = brw->attribs.Color->BlendColor[3]; BRW_CACHED_BATCH_STRUCT(brw, &bcc); }
/********************************************************************** * AA Line parameters */ static void upload_aa_line_parameters(struct brw_context *brw) { struct brw_aa_line_parameters balp; if (!(BRW_IS_GM45(brw) || BRW_IS_G4X(brw))) return; /* use legacy aa line coverage computation */ memset(&balp, 0, sizeof(balp)); balp.header.opcode = CMD_AA_LINE_PARAMETERS; balp.header.length = sizeof(balp) / 4 - 2; BRW_CACHED_BATCH_STRUCT(brw, &balp); }
static void upload_polygon_stipple_offset(struct brw_context *brw) { __DRIdrawablePrivate *dPriv = brw->intel.driDrawable; struct brw_polygon_stipple_offset bpso; memset(&bpso, 0, sizeof(bpso)); bpso.header.opcode = CMD_POLY_STIPPLE_OFFSET; bpso.header.length = sizeof(bpso)/4-2; bpso.bits0.x_offset = (32 - (dPriv->x & 31)) & 31; bpso.bits0.y_offset = (32 - ((dPriv->y + dPriv->h) & 31)) & 31; BRW_CACHED_BATCH_STRUCT(brw, &bpso); }
static void upload_polygon_stipple(struct brw_context *brw) { struct brw_polygon_stipple bps; GLuint i; memset(&bps, 0, sizeof(bps)); bps.header.opcode = CMD_POLY_STIPPLE_PATTERN; bps.header.length = sizeof(bps)/4-2; for (i = 0; i < 32; i++) bps.stipple[i] = brw->attribs.PolygonStipple[31 - i]; /* invert */ BRW_CACHED_BATCH_STRUCT(brw, &bps); }
/* Define the number of curbes within CS's urb allocation. Multiple * urb entries -> multiple curbes. These will be used by * fixed-function hardware in a double-buffering scheme to avoid a * pipeline stall each time the contents of the curbe is changed. */ void brw_upload_constant_buffer_state(struct brw_context *brw) { struct brw_constant_buffer_state cbs; memset(&cbs, 0, sizeof(cbs)); /* It appears that this is the state packet for the CS unit, ie. the * urb entries detailed here are housed in the CS range from the * URB_FENCE command. */ cbs.header.opcode = CMD_CONST_BUFFER_STATE; cbs.header.length = sizeof(cbs)/4 - 2; /* BRW_NEW_URB_FENCE */ cbs.bits0.nr_urb_entries = brw->urb.nr_cs_entries; cbs.bits0.urb_entry_size = brw->urb.csize - 1; assert(brw->urb.nr_cs_entries); BRW_CACHED_BATCH_STRUCT(brw, &cbs); }
static void upload_binding_table_pointers(struct brw_context *brw) { struct brw_binding_table_pointers btp; memset(&btp, 0, sizeof(btp)); /* The binding table has been emitted to the SS pool already, so we * know what its offset is. When the batch buffer is fired, the * binding table and surface structs will get fixed up to point to * where the textures actually landed, but that won't change the * value of the offsets here: */ btp.header.opcode = CMD_BINDING_TABLE_PTRS; btp.header.length = sizeof(btp)/4 - 2; btp.vs = 0; btp.gs = 0; btp.clp = 0; btp.sf = 0; btp.wm = brw->wm.bind_ss_offset; BRW_CACHED_BATCH_STRUCT(brw, &btp); }
static void upload_line_stipple(struct brw_context *brw) { struct brw_line_stipple bls; GLfloat tmp; GLint tmpi; memset(&bls, 0, sizeof(bls)); bls.header.opcode = CMD_LINE_STIPPLE_PATTERN; bls.header.length = sizeof(bls)/4 - 2; bls.bits0.pattern = brw->attribs.Line->StipplePattern; bls.bits1.repeat_count = brw->attribs.Line->StippleFactor; tmp = 1.0 / (GLfloat) brw->attribs.Line->StippleFactor; tmpi = tmp * (1<<13); bls.bits1.inverse_repeat_count = tmpi; BRW_CACHED_BATCH_STRUCT(brw, &bls); }
static int upload_blend_constant_color(struct brw_context *brw) { BRW_CACHED_BATCH_STRUCT(brw, &brw->curr.bcc); return 0; }
static int upload_polygon_stipple(struct brw_context *brw) { BRW_CACHED_BATCH_STRUCT(brw, &brw->curr.bps); return 0; }