Mostly style changes to set dw[0] directly.
int num_viewports)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_CLIP) | (cmd_len - 2);
uint32_t dw1, dw2, dw3, *dw;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
}
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_CLIP) | (cmd_len - 2);
dw[1] = dw1;
dw[2] = dw2;
dw[3] = dw3;
const struct ilo_shader_state *fs)
{
const uint8_t cmd_len = 20;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_SF) | (cmd_len - 2);
uint32_t payload_raster[6], payload_sbe[13], *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
fs, payload_sbe, Elements(payload_sbe));
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_SF) | (cmd_len - 2);
dw[1] = payload_sbe[0];
memcpy(&dw[2], payload_raster, sizeof(payload_raster));
memcpy(&dw[8], &payload_sbe[1], sizeof(payload_sbe) - 4);
enum pipe_format zs_format)
{
const uint8_t cmd_len = 7;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_SF) | (cmd_len - 2);
const int num_samples = 1;
uint32_t payload[6], *dw;
payload, Elements(payload));
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_SF) | (cmd_len - 2);
memcpy(&dw[1], payload, sizeof(payload));
}
const struct ilo_shader_state *fs)
{
const uint8_t cmd_len = 14;
- const uint32_t dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_SBE) | (cmd_len - 2);
uint32_t payload[13], *dw;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
rasterizer, fs, payload, Elements(payload));
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_SBE) | (cmd_len - 2);
memcpy(&dw[1], payload, sizeof(payload));
}
{
const uint8_t cmd_len = 5;
uint32_t buf_dw[4], buf_enabled;
- uint32_t dw0, *dw;
+ uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
assert(num_bufs <= 4);
buf_enabled = gen6_fill_3dstate_constant(builder->dev,
bufs, sizes, num_bufs, 64, buf_dw, Elements(buf_dw));
- dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_PS) |
- buf_enabled << 12 |
- (cmd_len - 2);
-
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_PS) |
+ buf_enabled << 12 |
+ (cmd_len - 2);
memcpy(&dw[1], buf_dw, sizeof(buf_dw));
}
bool pixel_location_center)
{
const uint8_t cmd_len = (ilo_dev_gen(builder->dev) >= ILO_GEN(7)) ? 4 : 3;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_MULTISAMPLE) |
- (cmd_len - 2);
uint32_t dw1, dw2, dw3, *dw;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
- dw1 = (pixel_location_center) ?
- GEN6_MULTISAMPLE_DW1_PIXLOC_CENTER : GEN6_MULTISAMPLE_DW1_PIXLOC_UL_CORNER;
+ dw1 = (pixel_location_center) ? GEN6_MULTISAMPLE_DW1_PIXLOC_CENTER :
+ GEN6_MULTISAMPLE_DW1_PIXLOC_UL_CORNER;
switch (num_samples) {
case 0:
}
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_MULTISAMPLE) | (cmd_len - 2);
dw[1] = dw1;
dw[2] = dw2;
if (ilo_dev_gen(builder->dev) >= ILO_GEN(7))
unsigned sample_mask)
{
const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLE_MASK) |
- (cmd_len - 2);
const unsigned valid_mask = 0xf;
uint32_t *dw;
sample_mask &= valid_mask;
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLE_MASK) | (cmd_len - 2);
dw[1] = sample_mask;
}
{
const uint8_t cmd_len = 2;
const unsigned valid_mask = ((1 << num_samples) - 1) | 0x1;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLE_MASK) |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
sample_mask &= valid_mask;
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLE_MASK) | (cmd_len - 2);
dw[1] = sample_mask;
}
unsigned width, unsigned height)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_DRAWING_RECTANGLE) |
- (cmd_len - 2);
unsigned xmax = x + width - 1;
unsigned ymax = y + height - 1;
- int rect_limit;
+ unsigned rect_limit;
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_DRAWING_RECTANGLE) | (cmd_len - 2);
dw[1] = y << 16 | x;
dw[2] = ymax << 16 | xmax;
-
/*
* There is no need to set the origin. It is intended to support front
* buffer rendering.
int x_offset, int y_offset)
{
const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_POLY_STIPPLE_OFFSET) |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
+
assert(x_offset >= 0 && x_offset <= 31);
assert(y_offset >= 0 && y_offset <= 31);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_POLY_STIPPLE_OFFSET) | (cmd_len - 2);
dw[1] = x_offset << 8 | y_offset;
}
const struct pipe_poly_stipple *pattern)
{
const uint8_t cmd_len = 33;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_POLY_STIPPLE_PATTERN) |
- (cmd_len - 2);
uint32_t *dw;
int i;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
- STATIC_ASSERT(Elements(pattern->stipple) == 32);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_POLY_STIPPLE_PATTERN) | (cmd_len - 2);
dw++;
+ STATIC_ASSERT(Elements(pattern->stipple) == 32);
for (i = 0; i < 32; i++)
dw[i] = pattern->stipple[i];
}
unsigned pattern, unsigned factor)
{
const uint8_t cmd_len = 3;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_LINE_STIPPLE) |
- (cmd_len - 2);
- uint32_t *dw;
unsigned inverse;
+ uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
+
assert((pattern & 0xffff) == pattern);
assert(factor >= 1 && factor <= 256);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_LINE_STIPPLE) | (cmd_len - 2);
dw[1] = pattern;
if (ilo_dev_gen(builder->dev) >= ILO_GEN(7)) {
/* in U1.16 */
- inverse = (unsigned) (65536.0f / factor);
- dw[2] = inverse << 15 | factor;
+ inverse = 65536 / factor;
+
+ dw[2] = inverse << GEN7_LINE_STIPPLE_DW2_INVERSE_REPEAT_COUNT__SHIFT |
+ factor;
}
else {
/* in U1.13 */
- inverse = (unsigned) (8192.0f / factor);
- dw[2] = inverse << 16 | factor;
+ inverse = 8192 / factor;
+
+ dw[2] = inverse << GEN6_LINE_STIPPLE_DW2_INVERSE_REPEAT_COUNT__SHIFT |
+ factor;
}
}
gen6_3DSTATE_AA_LINE_PARAMETERS(struct ilo_builder *builder)
{
const uint8_t cmd_len = 3;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_AA_LINE_PARAMETERS) |
- (cmd_len - 2);
- uint32_t *dw;
+ const uint32_t dw[3] = {
+ GEN6_RENDER_CMD(3D, 3DSTATE_AA_LINE_PARAMETERS) | (cmd_len - 2),
+ 0 << GEN6_AA_LINE_DW1_BIAS__SHIFT | 0,
+ 0 << GEN6_AA_LINE_DW2_CAP_BIAS__SHIFT | 0,
+ };
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
- ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
- dw[1] = 0 << 16 | 0;
- dw[2] = 0 << 16 | 0;
+ ilo_builder_batch_write(builder, cmd_len, dw);
}
static inline void
gen6_3DSTATE_DEPTH_BUFFER(struct ilo_builder *builder,
const struct ilo_zs_surface *zs)
{
+ const uint32_t cmd = (ilo_dev_gen(builder->dev) >= ILO_GEN(7)) ?
+ GEN7_RENDER_CMD(3D, 3DSTATE_DEPTH_BUFFER) :
+ GEN6_RENDER_CMD(3D, 3DSTATE_DEPTH_BUFFER);
const uint8_t cmd_len = 7;
+ uint32_t *dw;
unsigned pos;
- uint32_t dw0, *dw;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
- dw0 = (ilo_dev_gen(builder->dev) >= ILO_GEN(7)) ?
- GEN7_RENDER_CMD(3D, 3DSTATE_DEPTH_BUFFER) :
- GEN6_RENDER_CMD(3D, 3DSTATE_DEPTH_BUFFER);
- dw0 |= (cmd_len - 2);
-
pos = ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = cmd | (cmd_len - 2);
dw[1] = zs->payload[0];
+ dw[3] = zs->payload[2];
+ dw[4] = zs->payload[3];
+ dw[5] = zs->payload[4];
+ dw[6] = zs->payload[5];
if (zs->bo) {
ilo_builder_batch_reloc(builder, pos + 2,
} else {
dw[2] = 0;
}
-
- dw[3] = zs->payload[2];
- dw[4] = zs->payload[3];
- dw[5] = zs->payload[4];
- dw[6] = zs->payload[5];
}
static inline void
gen6_3DSTATE_STENCIL_BUFFER(struct ilo_builder *builder,
const struct ilo_zs_surface *zs)
{
+ const uint32_t cmd = (ilo_dev_gen(builder->dev) >= ILO_GEN(7)) ?
+ GEN7_RENDER_CMD(3D, 3DSTATE_STENCIL_BUFFER) :
+ GEN6_RENDER_CMD(3D, 3DSTATE_STENCIL_BUFFER);
const uint8_t cmd_len = 3;
- uint32_t dw0, *dw;
+ uint32_t *dw;
unsigned pos;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
- dw0 = (ilo_dev_gen(builder->dev) >= ILO_GEN(7)) ?
- GEN7_RENDER_CMD(3D, 3DSTATE_STENCIL_BUFFER) :
- GEN6_RENDER_CMD(3D, 3DSTATE_STENCIL_BUFFER);
- dw0 |= (cmd_len - 2);
-
pos = ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = cmd | (cmd_len - 2);
/* see ilo_gpe_init_zs_surface() */
dw[1] = zs->payload[6];
gen6_3DSTATE_HIER_DEPTH_BUFFER(struct ilo_builder *builder,
const struct ilo_zs_surface *zs)
{
+ const uint32_t cmd = (ilo_dev_gen(builder->dev) >= ILO_GEN(7)) ?
+ GEN7_RENDER_CMD(3D, 3DSTATE_HIER_DEPTH_BUFFER) :
+ GEN6_RENDER_CMD(3D, 3DSTATE_HIER_DEPTH_BUFFER);
const uint8_t cmd_len = 3;
- uint32_t dw0, *dw;
+ uint32_t *dw;
unsigned pos;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
- dw0 = (ilo_dev_gen(builder->dev) >= ILO_GEN(7)) ?
- GEN7_RENDER_CMD(3D, 3DSTATE_HIER_DEPTH_BUFFER) :
- GEN6_RENDER_CMD(3D, 3DSTATE_HIER_DEPTH_BUFFER);
- dw0 |= (cmd_len - 2);
-
pos = ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = cmd | (cmd_len - 2);
/* see ilo_gpe_init_zs_surface() */
dw[1] = zs->payload[8];
uint32_t clear_val)
{
const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_CLEAR_PARAMS) |
- GEN6_CLEAR_PARAMS_DW0_VALID |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_CLEAR_PARAMS) |
+ GEN6_CLEAR_PARAMS_DW0_VALID |
+ (cmd_len - 2);
dw[1] = clear_val;
}
uint32_t clear_val)
{
const uint8_t cmd_len = 3;
- const uint32_t dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_CLEAR_PARAMS) |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_CLEAR_PARAMS) | (cmd_len - 2);
dw[1] = clear_val;
- dw[2] = 1;
+ dw[2] = GEN7_CLEAR_PARAMS_DW2_VALID;
}
static inline void
uint32_t cc_viewport)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_VIEWPORT_STATE_POINTERS) |
- GEN6_PTR_VP_DW0_CLIP_CHANGED |
- GEN6_PTR_VP_DW0_SF_CHANGED |
- GEN6_PTR_VP_DW0_CC_CHANGED |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_VIEWPORT_STATE_POINTERS) |
+ GEN6_PTR_VP_DW0_CLIP_CHANGED |
+ GEN6_PTR_VP_DW0_SF_CHANGED |
+ GEN6_PTR_VP_DW0_CC_CHANGED |
+ (cmd_len - 2);
dw[1] = clip_viewport;
dw[2] = sf_viewport;
dw[3] = cc_viewport;
uint32_t scissor_rect)
{
const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_SCISSOR_STATE_POINTERS) |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_SCISSOR_STATE_POINTERS) |
+ (cmd_len - 2);
dw[1] = scissor_rect;
}
uint32_t color_calc_state)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_CC_STATE_POINTERS) |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
- dw[1] = blend_state | 1;
- dw[2] = depth_stencil_state | 1;
- dw[3] = color_calc_state | 1;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_CC_STATE_POINTERS) | (cmd_len - 2);
+ dw[1] = blend_state | GEN6_PTR_CC_DW1_BLEND_CHANGED;
+ dw[2] = depth_stencil_state | GEN6_PTR_CC_DW2_ZS_CHANGED;
+ dw[3] = color_calc_state | GEN6_PTR_CC_DW3_CC_CHANGED;
}
static inline void
int vs_entry_size, int gs_entry_size)
{
const uint8_t cmd_len = 3;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_URB) | (cmd_len - 2);
const int row_size = 128; /* 1024 bits */
int vs_alloc_size, gs_alloc_size;
int vs_num_entries, gs_num_entries;
gs_num_entries = 256;
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_URB) | (cmd_len - 2);
dw[1] = (vs_alloc_size - 1) << GEN6_URB_DW1_VS_ENTRY_SIZE__SHIFT |
vs_num_entries << GEN6_URB_DW1_VS_ENTRY_COUNT__SHIFT;
dw[2] = gs_num_entries << GEN6_URB_DW2_GS_ENTRY_COUNT__SHIFT |
gen7_3dstate_push_constant_alloc(struct ilo_builder *builder,
int subop, int offset, int size)
{
- const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_TYPE_RENDER |
+ const uint32_t cmd = GEN6_RENDER_TYPE_RENDER |
GEN6_RENDER_SUBTYPE_3D |
- subop | (cmd_len - 2);
+ subop;
+ const uint8_t cmd_len = 2;
uint32_t *dw;
int end;
}
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = cmd | (cmd_len - 2);
dw[1] = offset << GEN7_PCB_ALLOC_ANY_DW1_OFFSET__SHIFT |
size;
}
int subop, int offset, int size,
int entry_size)
{
- const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_TYPE_RENDER |
+ const uint32_t cmd = GEN6_RENDER_TYPE_RENDER |
GEN6_RENDER_SUBTYPE_3D |
- subop | (cmd_len - 2);
+ subop;
+ const uint8_t cmd_len = 2;
const int row_size = 64; /* 512 bits */
int alloc_size, num_entries, min_entries, max_entries;
uint32_t *dw;
}
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = cmd | (cmd_len - 2);
dw[1] = offset << GEN7_URB_ANY_DW1_OFFSET__SHIFT |
(alloc_size - 1) << GEN7_URB_ANY_DW1_ENTRY_SIZE__SHIFT |
num_entries;
uint32_t cut_index)
{
const uint8_t cmd_len = 2;
- uint32_t dw0 = GEN75_RENDER_CMD(3D, 3DSTATE_VF) | (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7.5, 7.5);
+ ilo_builder_batch_pointer(builder, cmd_len, &dw);
+
+ dw[0] = GEN75_RENDER_CMD(3D, 3DSTATE_VF) | (cmd_len - 2);
if (enable_cut_index)
- dw0 |= GEN75_VF_DW0_CUT_INDEX_ENABLE;
+ dw[0] |= GEN75_VF_DW0_CUT_INDEX_ENABLE;
- ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
dw[1] = cut_index;
}
const struct ilo_vb_state *vb)
{
uint8_t cmd_len;
- uint32_t dw0, *dw;
- unsigned hw_idx, pos;
+ uint32_t *dw;
+ unsigned pos, hw_idx;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
return;
cmd_len = 1 + 4 * ve->vb_count;
- dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_BUFFERS) |
- (cmd_len - 2);
-
pos = ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_BUFFERS) | (cmd_len - 2);
dw++;
pos++;
+
for (hw_idx = 0; hw_idx < ve->vb_count; hw_idx++) {
const unsigned instance_divisor = ve->instance_divisors[hw_idx];
const unsigned pipe_idx = ve->vb_mapping[hw_idx];
bool prepend_generated_ids)
{
uint8_t cmd_len;
- uint32_t dw0, *dw;
+ uint32_t *dw;
unsigned i;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
&dummy);
cmd_len = 3;
- dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_ELEMENTS) |
- (cmd_len - 2);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_ELEMENTS) | (cmd_len - 2);
memcpy(&dw[1], dummy.payload, sizeof(dummy.payload));
return;
}
cmd_len = 2 * (ve->count + prepend_generated_ids) + 1;
- dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_ELEMENTS) |
- (cmd_len - 2);
-
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_VERTEX_ELEMENTS) | (cmd_len - 2);
dw++;
if (prepend_generated_ids) {
struct ilo_buffer *buf = ilo_buffer(ib->hw_resource);
uint32_t start_offset, end_offset;
int format;
+ uint32_t *dw;
unsigned pos;
- uint32_t dw0, *dw;
ILO_DEV_ASSERT(builder->dev, 6, 7.5);
end_offset -= (end_offset % ib->hw_index_size);
end_offset--;
- dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_INDEX_BUFFER) |
- format |
- (cmd_len - 2);
+ pos = ilo_builder_batch_pointer(builder, cmd_len, &dw);
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_INDEX_BUFFER) |
+ format |
+ (cmd_len - 2);
if (enable_cut_index)
- dw0 |= GEN6_IB_DW0_CUT_INDEX_ENABLE;
+ dw[0] |= GEN6_IB_DW0_CUT_INDEX_ENABLE;
- pos = ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
ilo_builder_batch_reloc(builder, pos + 1, buf->bo, start_offset, 0);
ilo_builder_batch_reloc(builder, pos + 2, buf->bo, end_offset, 0);
}
int num_samplers)
{
const uint8_t cmd_len = 7;
- const uint32_t dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_HS) | (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
assert(!hs);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_HS) | (cmd_len - 2);
dw[1] = 0;
dw[2] = 0;
dw[3] = 0;
gen7_3DSTATE_TE(struct ilo_builder *builder)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_TE) | (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_TE) | (cmd_len - 2);
dw[1] = 0;
dw[2] = 0;
dw[3] = 0;
int num_samplers)
{
const uint8_t cmd_len = 6;
- const uint32_t dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_DS) | (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
assert(!ds);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_DS) | (cmd_len - 2);
dw[1] = 0;
dw[2] = 0;
dw[3] = 0;
int verts_per_prim)
{
const uint8_t cmd_len = 7;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_GS) | (cmd_len - 2);
uint32_t dw1, dw2, dw4, dw5, dw6, *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
}
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_GS) | (cmd_len - 2);
dw[1] = dw1;
dw[2] = dw2;
dw[3] = 0;
bool load_vertex_count)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_GS_SVB_INDEX) |
- (cmd_len - 2);
- uint32_t dw1, *dw;
+ uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
assert(index >= 0 && index < 4);
- dw1 = index << GEN6_SVBI_DW1_INDEX__SHIFT;
+ ilo_builder_batch_pointer(builder, cmd_len, &dw);
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_GS_SVB_INDEX) | (cmd_len - 2);
+
+ dw[1] = index << GEN6_SVBI_DW1_INDEX__SHIFT;
if (load_vertex_count)
- dw1 |= GEN6_SVBI_DW1_LOAD_INTERNAL_VERTEX_COUNT;
+ dw[1] |= GEN6_SVBI_DW1_LOAD_INTERNAL_VERTEX_COUNT;
- ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
- dw[1] = dw1;
dw[2] = svbi;
dw[3] = max_svbi;
}
dw2 |= ((num_samplers + 3) / 4) << GEN6_THREADDISP_SAMPLER_COUNT__SHIFT;
ilo_builder_batch_pointer(builder, cmd_len, &dw);
+
dw[0] = dw0;
dw[1] = ilo_shader_get_kernel_offset(gs);
dw[2] = dw2;
(read_len - 1) << GEN7_SO_DW2_STREAM0_READ_LEN__SHIFT;
ilo_builder_batch_pointer(builder, cmd_len, &dw);
+
dw[0] = dw0;
dw[1] = dw1;
dw[2] = dw2;
const struct pipe_stream_output_info *so_info)
{
uint16_t cmd_len;
- uint32_t dw0, *dw;
int buffer_selects, num_entries, i;
uint16_t so_decls[128];
+ uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
* of cmd_len is thus uint16_t.
*/
cmd_len = 2 * 128 + 3;
- dw0 = GEN7_RENDER_CMD(3D, 3DSTATE_SO_DECL_LIST) | (cmd_len - 2);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN7_RENDER_CMD(3D, 3DSTATE_SO_DECL_LIST) | (cmd_len - 2);
dw[1] = 0 << GEN7_SO_DECL_DW1_STREAM3_BUFFER_SELECTS__SHIFT |
0 << GEN7_SO_DECL_DW1_STREAM2_BUFFER_SELECTS__SHIFT |
0 << GEN7_SO_DECL_DW1_STREAM1_BUFFER_SELECTS__SHIFT |
(cmd_len - 2);
struct ilo_buffer *buf;
int end;
- unsigned pos;
uint32_t *dw;
+ unsigned pos;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
end = (base + so_target->buffer_size) & ~3;
pos = ilo_builder_batch_pointer(builder, cmd_len, &dw);
+
dw[0] = dw0;
dw[1] = index << GEN7_SO_BUF_DW1_INDEX__SHIFT |
stride;
uint32_t ps_binding_table)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_BINDING_TABLE_POINTERS) |
- GEN6_PTR_BINDING_TABLE_DW0_VS_CHANGED |
- GEN6_PTR_BINDING_TABLE_DW0_GS_CHANGED |
- GEN6_PTR_BINDING_TABLE_DW0_PS_CHANGED |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_BINDING_TABLE_POINTERS) |
+ GEN6_PTR_BINDING_TABLE_DW0_VS_CHANGED |
+ GEN6_PTR_BINDING_TABLE_DW0_GS_CHANGED |
+ GEN6_PTR_BINDING_TABLE_DW0_PS_CHANGED |
+ (cmd_len - 2);
dw[1] = vs_binding_table;
dw[2] = gs_binding_table;
dw[3] = ps_binding_table;
uint32_t ps_sampler_state)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLER_STATE_POINTERS) |
- GEN6_PTR_SAMPLER_DW0_VS_CHANGED |
- GEN6_PTR_SAMPLER_DW0_GS_CHANGED |
- GEN6_PTR_SAMPLER_DW0_PS_CHANGED |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_SAMPLER_STATE_POINTERS) |
+ GEN6_PTR_SAMPLER_DW0_VS_CHANGED |
+ GEN6_PTR_SAMPLER_DW0_GS_CHANGED |
+ GEN6_PTR_SAMPLER_DW0_PS_CHANGED |
+ (cmd_len - 2);
dw[1] = vs_sampler_state;
dw[2] = gs_sampler_state;
dw[3] = ps_sampler_state;
gen7_3dstate_pointer(struct ilo_builder *builder,
int subop, uint32_t pointer)
{
- const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_TYPE_RENDER |
+ const uint32_t cmd = GEN6_RENDER_TYPE_RENDER |
GEN6_RENDER_SUBTYPE_3D |
- subop | (cmd_len - 2);
+ subop;
+ const uint8_t cmd_len = 2;
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 7, 7.5);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = cmd | (cmd_len - 2);
dw[1] = pointer;
}
int num_bufs)
{
const uint8_t cmd_len = 5;
- uint32_t buf_dw[4], buf_enabled;
- uint32_t dw0, *dw;
+ uint32_t buf_dw[4], buf_enabled, *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
+
assert(num_bufs <= 4);
/*
buf_enabled = gen6_fill_3dstate_constant(builder->dev,
bufs, sizes, num_bufs, 32, buf_dw, Elements(buf_dw));
- dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_VS) |
- buf_enabled << 12 |
- (cmd_len - 2);
-
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_VS) |
+ buf_enabled << 12 |
+ (cmd_len - 2);
memcpy(&dw[1], buf_dw, sizeof(buf_dw));
}
int num_bufs)
{
const uint8_t cmd_len = 5;
- uint32_t buf_dw[4], buf_enabled;
- uint32_t dw0, *dw;
+ uint32_t buf_dw[4], buf_enabled, *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
+
assert(num_bufs <= 4);
/*
buf_enabled = gen6_fill_3dstate_constant(builder->dev,
bufs, sizes, num_bufs, 64, buf_dw, Elements(buf_dw));
- dw0 = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_GS) |
- buf_enabled << 12 |
- (cmd_len - 2);
-
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(3D, 3DSTATE_CONSTANT_GS) |
+ buf_enabled << 12 |
+ (cmd_len - 2);
memcpy(&dw[1], buf_dw, sizeof(buf_dw));
}
const uint32_t *bufs, const int *sizes,
int num_bufs)
{
- const uint8_t cmd_len = 7;
- const uint32_t dw0 = GEN6_RENDER_TYPE_RENDER |
+ const uint32_t cmd = GEN6_RENDER_TYPE_RENDER |
GEN6_RENDER_SUBTYPE_3D |
- subop | (cmd_len - 2);
+ subop;
+ const uint8_t cmd_len = 7;
uint32_t payload[6], *dw;
int total_read_length, i;
assert(total_read_length <= 64);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = cmd | (cmd_len - 2);
memcpy(&dw[1], payload, sizeof(payload));
}
int urb_entry_size)
{
const uint8_t cmd_len = 8;
- const uint32_t dw0 = GEN6_RENDER_CMD(MEDIA, MEDIA_VFE_STATE) |
- (cmd_len - 2);
uint32_t dw2, dw4, *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
480; /* CURBE Allocation Size */
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(MEDIA, MEDIA_VFE_STATE) | (cmd_len - 2);
dw[1] = 0; /* scratch */
dw[2] = dw2;
dw[3] = 0; /* MBZ */
uint32_t buf, int size)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 = GEN6_RENDER_CMD(MEDIA, MEDIA_CURBE_LOAD) |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
size = align(size, 32);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(MEDIA, MEDIA_CURBE_LOAD) | (cmd_len - 2);
dw[1] = 0; /* MBZ */
dw[2] = size;
dw[3] = buf;
uint32_t offset, int num_ids)
{
const uint8_t cmd_len = 4;
- const uint32_t dw0 =
- GEN6_RENDER_CMD(MEDIA, MEDIA_INTERFACE_DESCRIPTOR_LOAD) | (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
assert(offset % 32 == 0);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(MEDIA, MEDIA_INTERFACE_DESCRIPTOR_LOAD) |
+ (cmd_len - 2);
dw[1] = 0; /* MBZ */
/* every ID has 8 DWords */
dw[2] = num_ids * 8 * 4;
int id, int byte, int thread_count)
{
const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_CMD(MEDIA, MEDIA_GATEWAY_STATE) |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(MEDIA, MEDIA_GATEWAY_STATE) | (cmd_len - 2);
dw[1] = id << 16 |
byte << 8 |
thread_count;
int barrier_mask)
{
const uint8_t cmd_len = 2;
- const uint32_t dw0 = GEN6_RENDER_CMD(MEDIA, MEDIA_STATE_FLUSH) |
- (cmd_len - 2);
uint32_t *dw;
ILO_DEV_ASSERT(builder->dev, 6, 6);
ilo_builder_batch_pointer(builder, cmd_len, &dw);
- dw[0] = dw0;
+
+ dw[0] = GEN6_RENDER_CMD(MEDIA, MEDIA_STATE_FLUSH) | (cmd_len - 2);
dw[1] = thread_count_water_mark << 16 |
barrier_mask;
}