summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <[email protected]>2013-08-05 15:57:31 -0600
committerChia-I Wu <[email protected]>2013-08-08 11:39:21 +0800
commitc2c5366ff2f7e2741650079cc5af69166df16811 (patch)
treeb2cd963258935430925421a0152bda354d05f381 /src/gallium
parent4bc9daf923194c3f31fe7b0f7f5f76ea87dee132 (diff)
ilo: Call GPE emit functions directly.
Eliminate pipeline and GPE function vectors and have the pipeline functions call the GPE emit functions directly.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline.h98
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c181
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h5
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline_gen7.c217
-rw-r--r--src/gallium/drivers/ilo/ilo_gpe_gen6.c58
-rw-r--r--src/gallium/drivers/ilo/ilo_gpe_gen6.h398
-rw-r--r--src/gallium/drivers/ilo/ilo_gpe_gen7.c87
-rw-r--r--src/gallium/drivers/ilo/ilo_gpe_gen7.h345
8 files changed, 141 insertions, 1248 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline.h b/src/gallium/drivers/ilo/ilo_3d_pipeline.h
index f26fa83c2dc..ae4c7598f39 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline.h
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline.h
@@ -84,104 +84,6 @@ struct ilo_3d_pipeline {
struct intel_bo *bo, int index);
/**
- * all GPE functions of all GENs
- */
-#define GEN6_EMIT(name) ilo_gpe_gen6_ ## name gen6_ ## name
- GEN6_EMIT(STATE_BASE_ADDRESS);
- GEN6_EMIT(STATE_SIP);
- GEN6_EMIT(PIPELINE_SELECT);
- GEN6_EMIT(3DSTATE_BINDING_TABLE_POINTERS);
- GEN6_EMIT(3DSTATE_SAMPLER_STATE_POINTERS);
- GEN6_EMIT(3DSTATE_URB);
- GEN6_EMIT(3DSTATE_VERTEX_BUFFERS);
- GEN6_EMIT(3DSTATE_VERTEX_ELEMENTS);
- GEN6_EMIT(3DSTATE_INDEX_BUFFER);
- GEN6_EMIT(3DSTATE_VF_STATISTICS);
- GEN6_EMIT(3DSTATE_VIEWPORT_STATE_POINTERS);
- GEN6_EMIT(3DSTATE_CC_STATE_POINTERS);
- GEN6_EMIT(3DSTATE_SCISSOR_STATE_POINTERS);
- GEN6_EMIT(3DSTATE_VS);
- GEN6_EMIT(3DSTATE_GS);
- GEN6_EMIT(3DSTATE_CLIP);
- GEN6_EMIT(3DSTATE_SF);
- GEN6_EMIT(3DSTATE_WM);
- GEN6_EMIT(3DSTATE_CONSTANT_VS);
- GEN6_EMIT(3DSTATE_CONSTANT_GS);
- GEN6_EMIT(3DSTATE_CONSTANT_PS);
- GEN6_EMIT(3DSTATE_SAMPLE_MASK);
- GEN6_EMIT(3DSTATE_DRAWING_RECTANGLE);
- GEN6_EMIT(3DSTATE_DEPTH_BUFFER);
- GEN6_EMIT(3DSTATE_POLY_STIPPLE_OFFSET);
- GEN6_EMIT(3DSTATE_POLY_STIPPLE_PATTERN);
- GEN6_EMIT(3DSTATE_LINE_STIPPLE);
- GEN6_EMIT(3DSTATE_AA_LINE_PARAMETERS);
- GEN6_EMIT(3DSTATE_GS_SVB_INDEX);
- GEN6_EMIT(3DSTATE_MULTISAMPLE);
- GEN6_EMIT(3DSTATE_STENCIL_BUFFER);
- GEN6_EMIT(3DSTATE_HIER_DEPTH_BUFFER);
- GEN6_EMIT(3DSTATE_CLEAR_PARAMS);
- GEN6_EMIT(PIPE_CONTROL);
- GEN6_EMIT(3DPRIMITIVE);
- GEN6_EMIT(INTERFACE_DESCRIPTOR_DATA);
- GEN6_EMIT(SF_VIEWPORT);
- GEN6_EMIT(CLIP_VIEWPORT);
- GEN6_EMIT(CC_VIEWPORT);
- GEN6_EMIT(COLOR_CALC_STATE);
- GEN6_EMIT(BLEND_STATE);
- GEN6_EMIT(DEPTH_STENCIL_STATE);
- GEN6_EMIT(SCISSOR_RECT);
- GEN6_EMIT(BINDING_TABLE_STATE);
- GEN6_EMIT(SURFACE_STATE);
- GEN6_EMIT(so_SURFACE_STATE);
- GEN6_EMIT(SAMPLER_STATE);
- GEN6_EMIT(SAMPLER_BORDER_COLOR_STATE);
- GEN6_EMIT(push_constant_buffer);
-#undef GEN6_EMIT
-
-#define GEN7_EMIT(name) ilo_gpe_gen7_ ## name gen7_ ## name
- GEN7_EMIT(3DSTATE_DEPTH_BUFFER);
- GEN7_EMIT(3DSTATE_CC_STATE_POINTERS);
- GEN7_EMIT(3DSTATE_GS);
- GEN7_EMIT(3DSTATE_SF);
- GEN7_EMIT(3DSTATE_WM);
- GEN7_EMIT(3DSTATE_SAMPLE_MASK);
- GEN7_EMIT(3DSTATE_CONSTANT_HS);
- GEN7_EMIT(3DSTATE_CONSTANT_DS);
- GEN7_EMIT(3DSTATE_HS);
- GEN7_EMIT(3DSTATE_TE);
- GEN7_EMIT(3DSTATE_DS);
- GEN7_EMIT(3DSTATE_STREAMOUT);
- GEN7_EMIT(3DSTATE_SBE);
- GEN7_EMIT(3DSTATE_PS);
- GEN7_EMIT(3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP);
- GEN7_EMIT(3DSTATE_VIEWPORT_STATE_POINTERS_CC);
- GEN7_EMIT(3DSTATE_BLEND_STATE_POINTERS);
- GEN7_EMIT(3DSTATE_DEPTH_STENCIL_STATE_POINTERS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_VS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_HS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_DS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_GS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_PS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_VS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_HS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_DS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_GS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_PS);
- GEN7_EMIT(3DSTATE_URB_VS);
- GEN7_EMIT(3DSTATE_URB_HS);
- GEN7_EMIT(3DSTATE_URB_DS);
- GEN7_EMIT(3DSTATE_URB_GS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_VS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_HS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_DS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_GS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_PS);
- GEN7_EMIT(3DSTATE_SO_DECL_LIST);
- GEN7_EMIT(3DSTATE_SO_BUFFER);
- GEN7_EMIT(SF_CLIP_VIEWPORT);
-#undef GEN7_EMIT
-
- /**
* HW states.
*/
struct ilo_3d_pipeline_state {
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
index a441fca85d0..880e10b9688 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
@@ -64,7 +64,7 @@ gen6_wa_pipe_control_post_sync(struct ilo_3d_pipeline *p,
*
* The workaround below necessitates this workaround.
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_CS_STALL |
PIPE_CONTROL_STALL_AT_SCOREBOARD,
NULL, 0, false, p->cp);
@@ -83,7 +83,7 @@ gen6_wa_pipe_control_post_sync(struct ilo_3d_pipeline *p,
* "Before a PIPE_CONTROL with Write Cache Flush Enable =1, a
* PIPE_CONTROL with any non-zero post-sync-op is required."
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_WRITE_IMMEDIATE,
p->workaround_bo, 0, false, p->cp);
}
@@ -103,7 +103,7 @@ gen6_wa_pipe_control_wm_multisample_flush(struct ilo_3d_pipeline *p)
* requires driver to send a PIPE_CONTROL with a CS stall along with a
* Depth Flush prior to this command."
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_CACHE_FLUSH |
PIPE_CONTROL_CS_STALL,
0, 0, false, p->cp);
@@ -121,15 +121,15 @@ gen6_wa_pipe_control_wm_depth_flush(struct ilo_3d_pipeline *p)
* to emit a sequence of PIPE_CONTROLs prior to emitting depth related
* commands.
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_STALL,
NULL, 0, false, p->cp);
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_CACHE_FLUSH,
NULL, 0, false, p->cp);
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_STALL,
NULL, 0, false, p->cp);
}
@@ -150,7 +150,7 @@ gen6_wa_pipe_control_wm_max_threads_stall(struct ilo_3d_pipeline *p)
* field set (DW1 Bit 1), must be issued prior to any change to the
* value in this field (Maximum Number of Threads in 3DSTATE_WM)"
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_STALL_AT_SCOREBOARD,
NULL, 0, false, p->cp);
@@ -168,7 +168,7 @@ gen6_wa_pipe_control_vs_const_flush(struct ilo_3d_pipeline *p)
* PIPE_CONTROL after 3DSTATE_CONSTANT_VS so that the command is kept being
* buffered by VS FF, to the point that the FF dies.
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_STALL |
PIPE_CONTROL_INSTRUCTION_FLUSH |
PIPE_CONTROL_STATE_CACHE_INVALIDATE,
@@ -187,7 +187,7 @@ gen6_pipeline_common_select(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_PIPELINE_SELECT(p->dev, 0x0, p->cp);
+ gen6_emit_PIPELINE_SELECT(p->dev, 0x0, p->cp);
}
}
@@ -201,7 +201,7 @@ gen6_pipeline_common_sip(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_STATE_SIP(p->dev, 0, p->cp);
+ gen6_emit_STATE_SIP(p->dev, 0, p->cp);
}
}
@@ -216,7 +216,7 @@ gen6_pipeline_common_base_address(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_STATE_BASE_ADDRESS(p->dev,
+ gen6_emit_STATE_BASE_ADDRESS(p->dev,
NULL, p->cp->bo, p->cp->bo, NULL, ilo->hw3d->kernel.bo,
0, 0, 0, 0, p->cp);
@@ -312,7 +312,7 @@ gen6_pipeline_common_urb(struct ilo_3d_pipeline *p,
gs_total_size = 0;
}
- p->gen6_3DSTATE_URB(p->dev, vs_total_size, gs_total_size,
+ gen6_emit_3DSTATE_URB(p->dev, vs_total_size, gs_total_size,
vs_entry_size, gs_entry_size, p->cp);
/*
@@ -338,7 +338,7 @@ gen6_pipeline_common_pointers_1(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_VIEWPORT_STATE_POINTERS */
if (session->viewport_state_changed) {
- p->gen6_3DSTATE_VIEWPORT_STATE_POINTERS(p->dev,
+ gen6_emit_3DSTATE_VIEWPORT_STATE_POINTERS(p->dev,
p->state.CLIP_VIEWPORT,
p->state.SF_VIEWPORT,
p->state.CC_VIEWPORT, p->cp);
@@ -354,7 +354,7 @@ gen6_pipeline_common_pointers_2(struct ilo_3d_pipeline *p,
if (session->cc_state_blend_changed ||
session->cc_state_dsa_changed ||
session->cc_state_cc_changed) {
- p->gen6_3DSTATE_CC_STATE_POINTERS(p->dev,
+ gen6_emit_3DSTATE_CC_STATE_POINTERS(p->dev,
p->state.BLEND_STATE,
p->state.DEPTH_STENCIL_STATE,
p->state.COLOR_CALC_STATE, p->cp);
@@ -364,7 +364,7 @@ gen6_pipeline_common_pointers_2(struct ilo_3d_pipeline *p,
if (session->sampler_state_vs_changed ||
session->sampler_state_gs_changed ||
session->sampler_state_fs_changed) {
- p->gen6_3DSTATE_SAMPLER_STATE_POINTERS(p->dev,
+ gen6_emit_3DSTATE_SAMPLER_STATE_POINTERS(p->dev,
p->state.vs.SAMPLER_STATE,
0,
p->state.wm.SAMPLER_STATE, p->cp);
@@ -378,7 +378,7 @@ gen6_pipeline_common_pointers_3(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_SCISSOR_STATE_POINTERS */
if (session->scissor_state_changed) {
- p->gen6_3DSTATE_SCISSOR_STATE_POINTERS(p->dev,
+ gen6_emit_3DSTATE_SCISSOR_STATE_POINTERS(p->dev,
p->state.SCISSOR_RECT, p->cp);
}
@@ -386,7 +386,7 @@ gen6_pipeline_common_pointers_3(struct ilo_3d_pipeline *p,
if (session->binding_table_vs_changed ||
session->binding_table_gs_changed ||
session->binding_table_fs_changed) {
- p->gen6_3DSTATE_BINDING_TABLE_POINTERS(p->dev,
+ gen6_emit_3DSTATE_BINDING_TABLE_POINTERS(p->dev,
p->state.vs.BINDING_TABLE_STATE,
p->state.gs.BINDING_TABLE_STATE,
p->state.wm.BINDING_TABLE_STATE, p->cp);
@@ -401,13 +401,13 @@ gen6_pipeline_vf(struct ilo_3d_pipeline *p,
/* 3DSTATE_INDEX_BUFFER */
if (DIRTY(IB) || session->primitive_restart_changed ||
session->batch_bo_changed) {
- p->gen6_3DSTATE_INDEX_BUFFER(p->dev,
+ gen6_emit_3DSTATE_INDEX_BUFFER(p->dev,
&ilo->ib, ilo->draw->primitive_restart, p->cp);
}
/* 3DSTATE_VERTEX_BUFFERS */
if (DIRTY(VB) || DIRTY(VE) || session->batch_bo_changed)
- p->gen6_3DSTATE_VERTEX_BUFFERS(p->dev, ilo->ve, &ilo->vb, p->cp);
+ gen6_emit_3DSTATE_VERTEX_BUFFERS(p->dev, ilo->ve, &ilo->vb, p->cp);
/* 3DSTATE_VERTEX_ELEMENTS */
if (DIRTY(VE) || DIRTY(VS)) {
@@ -432,7 +432,7 @@ gen6_pipeline_vf(struct ilo_3d_pipeline *p,
prepend_generate_ids = true;
}
- p->gen6_3DSTATE_VERTEX_ELEMENTS(p->dev, ve,
+ gen6_emit_3DSTATE_VERTEX_ELEMENTS(p->dev, ve,
last_velement_edgeflag, prepend_generate_ids, p->cp);
}
}
@@ -444,16 +444,16 @@ gen6_pipeline_vf_statistics(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_VF_STATISTICS */
if (session->hw_ctx_changed)
- p->gen6_3DSTATE_VF_STATISTICS(p->dev, false, p->cp);
+ gen6_emit_3DSTATE_VF_STATISTICS(p->dev, false, p->cp);
}
-void
+static void
gen6_pipeline_vf_draw(struct ilo_3d_pipeline *p,
const struct ilo_context *ilo,
struct gen6_pipeline_session *session)
{
/* 3DPRIMITIVE */
- p->gen6_3DPRIMITIVE(p->dev, ilo->draw, &ilo->ib, false, p->cp);
+ gen6_emit_3DPRIMITIVE(p->dev, ilo->draw, &ilo->ib, false, p->cp);
p->state.has_gen6_wa_pipe_control = false;
}
@@ -475,7 +475,7 @@ gen6_pipeline_vs(struct ilo_3d_pipeline *p,
/* 3DSTATE_CONSTANT_VS */
if (emit_3dstate_constant_vs) {
- p->gen6_3DSTATE_CONSTANT_VS(p->dev,
+ gen6_emit_3DSTATE_CONSTANT_VS(p->dev,
&p->state.vs.PUSH_CONSTANT_BUFFER,
&p->state.vs.PUSH_CONSTANT_BUFFER_size,
1, p->cp);
@@ -485,7 +485,7 @@ gen6_pipeline_vs(struct ilo_3d_pipeline *p,
if (emit_3dstate_vs) {
const int num_samplers = ilo->sampler[PIPE_SHADER_VERTEX].count;
- p->gen6_3DSTATE_VS(p->dev, ilo->vs, num_samplers, p->cp);
+ gen6_emit_3DSTATE_VS(p->dev, ilo->vs, num_samplers, p->cp);
}
if (emit_3dstate_constant_vs && p->dev->gen == ILO_GEN(6))
@@ -499,14 +499,14 @@ gen6_pipeline_gs(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_CONSTANT_GS */
if (session->pcb_state_gs_changed)
- p->gen6_3DSTATE_CONSTANT_GS(p->dev, NULL, NULL, 0, p->cp);
+ gen6_emit_3DSTATE_CONSTANT_GS(p->dev, NULL, NULL, 0, p->cp);
/* 3DSTATE_GS */
if (DIRTY(GS) || DIRTY(VS) ||
session->prim_changed || session->kernel_bo_changed) {
const int verts_per_prim = u_vertices_per_prim(session->reduced_prim);
- p->gen6_3DSTATE_GS(p->dev, ilo->gs, ilo->vs, verts_per_prim, p->cp);
+ gen6_emit_3DSTATE_GS(p->dev, ilo->gs, ilo->vs, verts_per_prim, p->cp);
}
}
@@ -566,7 +566,7 @@ gen6_pipeline_gs_svbi(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_3DSTATE_GS_SVB_INDEX(p->dev,
+ gen6_emit_3DSTATE_GS_SVB_INDEX(p->dev,
0, p->state.so_num_vertices, p->state.so_max_vertices,
false, p->cp);
@@ -583,7 +583,7 @@ gen6_pipeline_gs_svbi(struct ilo_3d_pipeline *p,
* 0xFFFFFFFF in order to not cause overflow in that SVBI."
*/
for (i = 1; i < 4; i++) {
- p->gen6_3DSTATE_GS_SVB_INDEX(p->dev,
+ gen6_emit_3DSTATE_GS_SVB_INDEX(p->dev,
i, 0, 0xffffffff, false, p->cp);
}
}
@@ -614,7 +614,7 @@ gen6_pipeline_clip(struct ilo_3d_pipeline *p,
}
}
- p->gen6_3DSTATE_CLIP(p->dev, ilo->rasterizer,
+ gen6_emit_3DSTATE_CLIP(p->dev, ilo->rasterizer,
ilo->fs, enable_guardband, 1, p->cp);
}
}
@@ -626,7 +626,7 @@ gen6_pipeline_sf(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_SF */
if (DIRTY(RASTERIZER) || DIRTY(VS) || DIRTY(GS) || DIRTY(FS)) {
- p->gen6_3DSTATE_SF(p->dev, ilo->rasterizer, ilo->fs,
+ gen6_emit_3DSTATE_SF(p->dev, ilo->rasterizer, ilo->fs,
(ilo->gs) ? ilo->gs : ilo->vs, p->cp);
}
}
@@ -641,7 +641,7 @@ gen6_pipeline_sf_rect(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_3DSTATE_DRAWING_RECTANGLE(p->dev, 0, 0,
+ gen6_emit_3DSTATE_DRAWING_RECTANGLE(p->dev, 0, 0,
ilo->fb.state.width, ilo->fb.state.height, p->cp);
}
}
@@ -653,7 +653,7 @@ gen6_pipeline_wm(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_CONSTANT_PS */
if (session->pcb_state_fs_changed)
- p->gen6_3DSTATE_CONSTANT_PS(p->dev, NULL, NULL, 0, p->cp);
+ gen6_emit_3DSTATE_CONSTANT_PS(p->dev, NULL, NULL, 0, p->cp);
/* 3DSTATE_WM */
if (DIRTY(FS) || DIRTY(SAMPLER_FS) || DIRTY(BLEND) || DIRTY(DSA) ||
@@ -666,7 +666,7 @@ gen6_pipeline_wm(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6) && session->hw_ctx_changed)
gen6_wa_pipe_control_wm_max_threads_stall(p);
- p->gen6_3DSTATE_WM(p->dev, ilo->fs, num_samplers,
+ gen6_emit_3DSTATE_WM(p->dev, ilo->fs, num_samplers,
ilo->rasterizer, dual_blend, cc_may_kill, p->cp);
}
}
@@ -688,11 +688,11 @@ gen6_pipeline_wm_multisample(struct ilo_3d_pipeline *p,
gen6_wa_pipe_control_wm_multisample_flush(p);
}
- p->gen6_3DSTATE_MULTISAMPLE(p->dev,
+ gen6_emit_3DSTATE_MULTISAMPLE(p->dev,
ilo->fb.num_samples, packed_sample_pos,
ilo->rasterizer->state.half_pixel_center, p->cp);
- p->gen6_3DSTATE_SAMPLE_MASK(p->dev,
+ gen6_emit_3DSTATE_SAMPLE_MASK(p->dev,
(ilo->fb.num_samples > 1) ? ilo->sample_mask : 0x1, p->cp);
}
}
@@ -722,10 +722,10 @@ gen6_pipeline_wm_depth(struct ilo_3d_pipeline *p,
gen6_wa_pipe_control_wm_depth_flush(p);
}
- p->gen6_3DSTATE_DEPTH_BUFFER(p->dev, zs, p->cp);
+ gen6_emit_3DSTATE_DEPTH_BUFFER(p->dev, zs, p->cp);
/* TODO */
- p->gen6_3DSTATE_CLEAR_PARAMS(p->dev, 0, p->cp);
+ gen6_emit_3DSTATE_CLEAR_PARAMS(p->dev, 0, p->cp);
}
}
@@ -740,10 +740,10 @@ gen6_pipeline_wm_raster(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_3DSTATE_POLY_STIPPLE_PATTERN(p->dev,
+ gen6_emit_3DSTATE_POLY_STIPPLE_PATTERN(p->dev,
&ilo->poly_stipple, p->cp);
- p->gen6_3DSTATE_POLY_STIPPLE_OFFSET(p->dev, 0, 0, p->cp);
+ gen6_emit_3DSTATE_POLY_STIPPLE_OFFSET(p->dev, 0, 0, p->cp);
}
/* 3DSTATE_LINE_STIPPLE */
@@ -751,7 +751,7 @@ gen6_pipeline_wm_raster(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_3DSTATE_LINE_STIPPLE(p->dev,
+ gen6_emit_3DSTATE_LINE_STIPPLE(p->dev,
ilo->rasterizer->state.line_stipple_pattern,
ilo->rasterizer->state.line_stipple_factor + 1, p->cp);
}
@@ -761,7 +761,7 @@ gen6_pipeline_wm_raster(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_3DSTATE_AA_LINE_PARAMETERS(p->dev, p->cp);
+ gen6_emit_3DSTATE_AA_LINE_PARAMETERS(p->dev, p->cp);
}
}
@@ -772,23 +772,23 @@ gen6_pipeline_state_viewports(struct ilo_3d_pipeline *p,
{
/* SF_CLIP_VIEWPORT and CC_VIEWPORT */
if (p->dev->gen >= ILO_GEN(7) && DIRTY(VIEWPORT)) {
- p->state.SF_CLIP_VIEWPORT = p->gen7_SF_CLIP_VIEWPORT(p->dev,
+ p->state.SF_CLIP_VIEWPORT = gen7_emit_SF_CLIP_VIEWPORT(p->dev,
ilo->viewport.cso, ilo->viewport.count, p->cp);
- p->state.CC_VIEWPORT = p->gen6_CC_VIEWPORT(p->dev,
+ p->state.CC_VIEWPORT = gen6_emit_CC_VIEWPORT(p->dev,
ilo->viewport.cso, ilo->viewport.count, p->cp);
session->viewport_state_changed = true;
}
/* SF_VIEWPORT, CLIP_VIEWPORT, and CC_VIEWPORT */
else if (DIRTY(VIEWPORT)) {
- p->state.CLIP_VIEWPORT = p->gen6_CLIP_VIEWPORT(p->dev,
+ p->state.CLIP_VIEWPORT = gen6_emit_CLIP_VIEWPORT(p->dev,
ilo->viewport.cso, ilo->viewport.count, p->cp);
- p->state.SF_VIEWPORT = p->gen6_SF_VIEWPORT(p->dev,
+ p->state.SF_VIEWPORT = gen6_emit_SF_VIEWPORT(p->dev,
ilo->viewport.cso, ilo->viewport.count, p->cp);
- p->state.CC_VIEWPORT = p->gen6_CC_VIEWPORT(p->dev,
+ p->state.CC_VIEWPORT = gen6_emit_CC_VIEWPORT(p->dev,
ilo->viewport.cso, ilo->viewport.count, p->cp);
session->viewport_state_changed = true;
@@ -802,7 +802,7 @@ gen6_pipeline_state_cc(struct ilo_3d_pipeline *p,
{
/* BLEND_STATE */
if (DIRTY(BLEND) || DIRTY(FB) || DIRTY(DSA)) {
- p->state.BLEND_STATE = p->gen6_BLEND_STATE(p->dev,
+ p->state.BLEND_STATE = gen6_emit_BLEND_STATE(p->dev,
ilo->blend, &ilo->fb, &ilo->dsa->alpha, p->cp);
session->cc_state_blend_changed = true;
@@ -811,7 +811,7 @@ gen6_pipeline_state_cc(struct ilo_3d_pipeline *p,
/* COLOR_CALC_STATE */
if (DIRTY(DSA) || DIRTY(STENCIL_REF) || DIRTY(BLEND_COLOR)) {
p->state.COLOR_CALC_STATE =
- p->gen6_COLOR_CALC_STATE(p->dev, &ilo->stencil_ref,
+ gen6_emit_COLOR_CALC_STATE(p->dev, &ilo->stencil_ref,
ilo->dsa->alpha.ref_value, &ilo->blend_color, p->cp);
session->cc_state_cc_changed = true;
@@ -820,7 +820,7 @@ gen6_pipeline_state_cc(struct ilo_3d_pipeline *p,
/* DEPTH_STENCIL_STATE */
if (DIRTY(DSA)) {
p->state.DEPTH_STENCIL_STATE =
- p->gen6_DEPTH_STENCIL_STATE(p->dev, ilo->dsa, p->cp);
+ gen6_emit_DEPTH_STENCIL_STATE(p->dev, ilo->dsa, p->cp);
session->cc_state_dsa_changed = true;
}
@@ -834,7 +834,7 @@ gen6_pipeline_state_scissors(struct ilo_3d_pipeline *p,
/* SCISSOR_RECT */
if (DIRTY(SCISSOR) || DIRTY(VIEWPORT)) {
/* there should be as many scissors as there are viewports */
- p->state.SCISSOR_RECT = p->gen6_SCISSOR_RECT(p->dev,
+ p->state.SCISSOR_RECT = gen6_emit_SCISSOR_RECT(p->dev,
&ilo->scissor, ilo->viewport.count, p->cp);
session->scissor_state_changed = true;
@@ -859,7 +859,7 @@ gen6_pipeline_state_surfaces_rt(struct ilo_3d_pipeline *p,
assert(surface && surface->is_rt);
surface_state[i] =
- p->gen6_SURFACE_STATE(p->dev, &surface->u.rt, true, p->cp);
+ gen6_emit_SURFACE_STATE(p->dev, &surface->u.rt, true, p->cp);
}
/*
@@ -874,7 +874,7 @@ gen6_pipeline_state_surfaces_rt(struct ilo_3d_pipeline *p,
1, 0, &null_surface);
surface_state[i] =
- p->gen6_SURFACE_STATE(p->dev, &null_surface, true, p->cp);
+ gen6_emit_SURFACE_STATE(p->dev, &null_surface, true, p->cp);
i++;
}
@@ -913,7 +913,7 @@ gen6_pipeline_state_surfaces_so(struct ilo_3d_pipeline *p,
(target < so->count) ? so->states[target] : NULL;
if (so_target) {
- surface_state[i] = p->gen6_so_SURFACE_STATE(p->dev,
+ surface_state[i] = gen6_emit_so_SURFACE_STATE(p->dev,
so_target, so_info, i, p->cp);
}
else {
@@ -979,7 +979,7 @@ gen6_pipeline_state_surfaces_view(struct ilo_3d_pipeline *p,
(const struct ilo_view_cso *) view->states[i];
surface_state[i] =
- p->gen6_SURFACE_STATE(p->dev, &cso->surface, false, p->cp);
+ gen6_emit_SURFACE_STATE(p->dev, &cso->surface, false, p->cp);
}
else {
surface_state[i] = 0;
@@ -1038,7 +1038,7 @@ gen6_pipeline_state_surfaces_const(struct ilo_3d_pipeline *p,
count = util_last_bit(cbuf->enabled_mask);
for (i = 0; i < count; i++) {
if (cbuf->cso[i].resource) {
- surface_state[i] = p->gen6_SURFACE_STATE(p->dev,
+ surface_state[i] = gen6_emit_SURFACE_STATE(p->dev,
&cbuf->cso[i].surface, false, p->cp);
}
else {
@@ -1106,7 +1106,7 @@ gen6_pipeline_state_binding_tables(struct ilo_3d_pipeline *p,
if (size < session->num_surfaces[shader_type])
size = session->num_surfaces[shader_type];
- *binding_table_state = p->gen6_BINDING_TABLE_STATE(p->dev,
+ *binding_table_state = gen6_emit_BINDING_TABLE_STATE(p->dev,
surface_state, size, p->cp);
*binding_table_state_size = size;
}
@@ -1170,13 +1170,13 @@ gen6_pipeline_state_samplers(struct ilo_3d_pipeline *p,
for (i = 0; i < num_samplers; i++) {
border_color_state[i] = (samplers[i]) ?
- p->gen6_SAMPLER_BORDER_COLOR_STATE(p->dev,
+ gen6_emit_SAMPLER_BORDER_COLOR_STATE(p->dev,
samplers[i], p->cp) : 0;
}
}
/* should we take the minimum of num_samplers and num_views? */
- *sampler_state = p->gen6_SAMPLER_STATE(p->dev,
+ *sampler_state = gen6_emit_SAMPLER_STATE(p->dev,
samplers, views,
border_color_state,
MIN2(num_samplers, num_views), p->cp);
@@ -1198,7 +1198,7 @@ gen6_pipeline_state_pcb(struct ilo_3d_pipeline *p,
p->state.vs.PUSH_CONSTANT_BUFFER_size = clip_state_size;
p->state.vs.PUSH_CONSTANT_BUFFER =
- p->gen6_push_constant_buffer(p->dev,
+ gen6_emit_push_constant_buffer(p->dev,
p->state.vs.PUSH_CONSTANT_BUFFER_size, &pcb, p->cp);
memcpy(pcb, &ilo->clip, clip_state_size);
@@ -1378,7 +1378,7 @@ ilo_3d_pipeline_emit_flush_gen6(struct ilo_3d_pipeline *p)
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_INSTRUCTION_FLUSH |
PIPE_CONTROL_WRITE_FLUSH |
PIPE_CONTROL_DEPTH_CACHE_FLUSH |
@@ -1396,7 +1396,7 @@ ilo_3d_pipeline_emit_write_timestamp_gen6(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, true);
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_WRITE_TIMESTAMP,
bo, index * sizeof(uint64_t) | PIPE_CONTROL_GLOBAL_GTT_WRITE,
true, p->cp);
@@ -1409,7 +1409,7 @@ ilo_3d_pipeline_emit_write_depth_count_gen6(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_STALL |
PIPE_CONTROL_WRITE_DEPTH_COUNT,
bo, index * sizeof(uint64_t) | PIPE_CONTROL_GLOBAL_GTT_WRITE,
@@ -1605,64 +1605,9 @@ ilo_3d_pipeline_estimate_size_gen6(struct ilo_3d_pipeline *p,
void
ilo_3d_pipeline_init_gen6(struct ilo_3d_pipeline *p)
{
- const struct ilo_gpe_gen6 *gen6 = ilo_gpe_gen6_get();
-
p->estimate_size = ilo_3d_pipeline_estimate_size_gen6;
p->emit_draw = ilo_3d_pipeline_emit_draw_gen6;
p->emit_flush = ilo_3d_pipeline_emit_flush_gen6;
p->emit_write_timestamp = ilo_3d_pipeline_emit_write_timestamp_gen6;
p->emit_write_depth_count = ilo_3d_pipeline_emit_write_depth_count_gen6;
-
-#define GEN6_USE(p, name, from) \
- p->gen6_ ## name = from->emit_ ## name
- GEN6_USE(p, STATE_BASE_ADDRESS, gen6);
- GEN6_USE(p, STATE_SIP, gen6);
- GEN6_USE(p, PIPELINE_SELECT, gen6);
- GEN6_USE(p, 3DSTATE_BINDING_TABLE_POINTERS, gen6);
- GEN6_USE(p, 3DSTATE_SAMPLER_STATE_POINTERS, gen6);
- GEN6_USE(p, 3DSTATE_URB, gen6);
- GEN6_USE(p, 3DSTATE_VERTEX_BUFFERS, gen6);
- GEN6_USE(p, 3DSTATE_VERTEX_ELEMENTS, gen6);
- GEN6_USE(p, 3DSTATE_INDEX_BUFFER, gen6);
- GEN6_USE(p, 3DSTATE_VF_STATISTICS, gen6);
- GEN6_USE(p, 3DSTATE_VIEWPORT_STATE_POINTERS, gen6);
- GEN6_USE(p, 3DSTATE_CC_STATE_POINTERS, gen6);
- GEN6_USE(p, 3DSTATE_SCISSOR_STATE_POINTERS, gen6);
- GEN6_USE(p, 3DSTATE_VS, gen6);
- GEN6_USE(p, 3DSTATE_GS, gen6);
- GEN6_USE(p, 3DSTATE_CLIP, gen6);
- GEN6_USE(p, 3DSTATE_SF, gen6);
- GEN6_USE(p, 3DSTATE_WM, gen6);
- GEN6_USE(p, 3DSTATE_CONSTANT_VS, gen6);
- GEN6_USE(p, 3DSTATE_CONSTANT_GS, gen6);
- GEN6_USE(p, 3DSTATE_CONSTANT_PS, gen6);
- GEN6_USE(p, 3DSTATE_SAMPLE_MASK, gen6);
- GEN6_USE(p, 3DSTATE_DRAWING_RECTANGLE, gen6);
- GEN6_USE(p, 3DSTATE_DEPTH_BUFFER, gen6);
- GEN6_USE(p, 3DSTATE_POLY_STIPPLE_OFFSET, gen6);
- GEN6_USE(p, 3DSTATE_POLY_STIPPLE_PATTERN, gen6);
- GEN6_USE(p, 3DSTATE_LINE_STIPPLE, gen6);
- GEN6_USE(p, 3DSTATE_AA_LINE_PARAMETERS, gen6);
- GEN6_USE(p, 3DSTATE_GS_SVB_INDEX, gen6);
- GEN6_USE(p, 3DSTATE_MULTISAMPLE, gen6);
- GEN6_USE(p, 3DSTATE_STENCIL_BUFFER, gen6);
- GEN6_USE(p, 3DSTATE_HIER_DEPTH_BUFFER, gen6);
- GEN6_USE(p, 3DSTATE_CLEAR_PARAMS, gen6);
- GEN6_USE(p, PIPE_CONTROL, gen6);
- GEN6_USE(p, 3DPRIMITIVE, gen6);
- GEN6_USE(p, INTERFACE_DESCRIPTOR_DATA, gen6);
- GEN6_USE(p, SF_VIEWPORT, gen6);
- GEN6_USE(p, CLIP_VIEWPORT, gen6);
- GEN6_USE(p, CC_VIEWPORT, gen6);
- GEN6_USE(p, COLOR_CALC_STATE, gen6);
- GEN6_USE(p, BLEND_STATE, gen6);
- GEN6_USE(p, DEPTH_STENCIL_STATE, gen6);
- GEN6_USE(p, SCISSOR_RECT, gen6);
- GEN6_USE(p, BINDING_TABLE_STATE, gen6);
- GEN6_USE(p, SURFACE_STATE, gen6);
- GEN6_USE(p, so_SURFACE_STATE, gen6);
- GEN6_USE(p, SAMPLER_STATE, gen6);
- GEN6_USE(p, SAMPLER_BORDER_COLOR_STATE, gen6);
- GEN6_USE(p, push_constant_buffer, gen6);
-#undef GEN6_USE
}
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h
index a9c4051d2df..36609f238f1 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.h
@@ -114,11 +114,6 @@ gen6_pipeline_vf_statistics(struct ilo_3d_pipeline *p,
struct gen6_pipeline_session *session);
void
-gen6_pipeline_vf_draw(struct ilo_3d_pipeline *p,
- const struct ilo_context *ilo,
- struct gen6_pipeline_session *session);
-
-void
gen6_pipeline_vs(struct ilo_3d_pipeline *p,
const struct ilo_context *ilo,
struct gen6_pipeline_session *session);
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen7.c b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen7.c
index fc16f80a54a..18ec65a85ab 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen7.c
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen7.c
@@ -88,7 +88,7 @@ gen7_wa_pipe_control_cs_stall(struct ilo_3d_pipeline *p,
bo = p->workaround_bo;
}
- p->gen6_PIPE_CONTROL(p->dev, dw1, bo, 0, false, p->cp);
+ gen6_emit_PIPE_CONTROL(p->dev, dw1, bo, 0, false, p->cp);
}
static void
@@ -105,7 +105,7 @@ gen7_wa_pipe_control_vs_depth_stall(struct ilo_3d_pipeline *p)
* 3DSTATE_SAMPLER_STATE_POINTER_VS command. Only one PIPE_CONTROL
* needs to be sent before any combination of VS associated 3DSTATE."
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_STALL |
PIPE_CONTROL_WRITE_IMMEDIATE,
p->workaround_bo, 0, false, p->cp);
@@ -144,18 +144,18 @@ gen7_wa_pipe_control_wm_depth_stall(struct ilo_3d_pipeline *p,
* guarantee that the pipeline from WM onwards is already flushed
* (e.g., via a preceding MI_FLUSH)."
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_STALL,
NULL, 0, false, p->cp);
if (!change_depth_buffer)
return;
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_CACHE_FLUSH,
NULL, 0, false, p->cp);
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_DEPTH_STALL,
NULL, 0, false, p->cp);
}
@@ -172,7 +172,7 @@ gen7_wa_pipe_control_wm_max_threads_stall(struct ilo_3d_pipeline *p)
* between 3DPRIMITIVE commands, a PIPE_CONTROL command with Stall at
* Pixel Scoreboard set is required to be issued."
*/
- p->gen6_PIPE_CONTROL(p->dev,
+ gen6_emit_PIPE_CONTROL(p->dev,
PIPE_CONTROL_STALL_AT_SCOREBOARD,
NULL, 0, false, p->cp);
@@ -210,12 +210,12 @@ gen7_pipeline_common_urb(struct ilo_3d_pipeline *p,
gen7_wa_pipe_control_vs_depth_stall(p);
- p->gen7_3DSTATE_URB_VS(p->dev,
+ gen7_emit_3DSTATE_URB_VS(p->dev,
offset, vs_total_size, vs_entry_size, p->cp);
- p->gen7_3DSTATE_URB_GS(p->dev, offset, 0, 0, p->cp);
- p->gen7_3DSTATE_URB_HS(p->dev, offset, 0, 0, p->cp);
- p->gen7_3DSTATE_URB_DS(p->dev, offset, 0, 0, p->cp);
+ gen7_emit_3DSTATE_URB_GS(p->dev, offset, 0, 0, p->cp);
+ gen7_emit_3DSTATE_URB_HS(p->dev, offset, 0, 0, p->cp);
+ gen7_emit_3DSTATE_URB_DS(p->dev, offset, 0, 0, p->cp);
}
}
@@ -230,10 +230,10 @@ gen7_pipeline_common_pcb_alloc(struct ilo_3d_pipeline *p,
* push constant buffers are only allowed to take up at most the first
* 16KB of the URB
*/
- p->gen7_3DSTATE_PUSH_CONSTANT_ALLOC_VS(p->dev,
+ gen7_emit_3DSTATE_PUSH_CONSTANT_ALLOC_VS(p->dev,
0, 8192, p->cp);
- p->gen7_3DSTATE_PUSH_CONSTANT_ALLOC_PS(p->dev,
+ gen7_emit_3DSTATE_PUSH_CONSTANT_ALLOC_PS(p->dev,
8192, 8192, p->cp);
gen7_wa_pipe_control_cs_stall(p, true, true);
@@ -247,10 +247,10 @@ gen7_pipeline_common_pointers_1(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_VIEWPORT_STATE_POINTERS_{CC,SF_CLIP} */
if (session->viewport_state_changed) {
- p->gen7_3DSTATE_VIEWPORT_STATE_POINTERS_CC(p->dev,
+ gen7_emit_3DSTATE_VIEWPORT_STATE_POINTERS_CC(p->dev,
p->state.CC_VIEWPORT, p->cp);
- p->gen7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP(p->dev,
+ gen7_emit_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP(p->dev,
p->state.SF_CLIP_VIEWPORT, p->cp);
}
}
@@ -262,19 +262,19 @@ gen7_pipeline_common_pointers_2(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_BLEND_STATE_POINTERS */
if (session->cc_state_blend_changed) {
- p->gen7_3DSTATE_BLEND_STATE_POINTERS(p->dev,
+ gen7_emit_3DSTATE_BLEND_STATE_POINTERS(p->dev,
p->state.BLEND_STATE, p->cp);
}
/* 3DSTATE_CC_STATE_POINTERS */
if (session->cc_state_cc_changed) {
- p->gen7_3DSTATE_CC_STATE_POINTERS(p->dev,
+ gen7_emit_3DSTATE_CC_STATE_POINTERS(p->dev,
p->state.COLOR_CALC_STATE, p->cp);
}
/* 3DSTATE_DEPTH_STENCIL_STATE_POINTERS */
if (session->cc_state_dsa_changed) {
- p->gen7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS(p->dev,
+ gen7_emit_3DSTATE_DEPTH_STENCIL_STATE_POINTERS(p->dev,
p->state.DEPTH_STENCIL_STATE, p->cp);
}
}
@@ -288,26 +288,40 @@ gen7_pipeline_vs(struct ilo_3d_pipeline *p,
const bool emit_3dstate_sampler_state = session->sampler_state_vs_changed;
/* see gen6_pipeline_vs() */
const bool emit_3dstate_constant_vs = session->pcb_state_vs_changed;
- const bool emit_3dstate_vs = (DIRTY(VS) || DIRTY(SAMPLER_VS));
+ const bool emit_3dstate_vs = (DIRTY(VS) || DIRTY(SAMPLER_VS) ||
+ session->kernel_bo_changed);
/* emit depth stall before any of the VS commands */
if (emit_3dstate_binding_table || emit_3dstate_sampler_state ||
- emit_3dstate_constant_vs || emit_3dstate_vs)
- gen7_wa_pipe_control_vs_depth_stall(p);
+ emit_3dstate_constant_vs || emit_3dstate_vs)
+ gen7_wa_pipe_control_vs_depth_stall(p);
/* 3DSTATE_BINDING_TABLE_POINTERS_VS */
if (emit_3dstate_binding_table) {
- p->gen7_3DSTATE_BINDING_TABLE_POINTERS_VS(p->dev,
- p->state.vs.BINDING_TABLE_STATE, p->cp);
+ gen7_emit_3DSTATE_BINDING_TABLE_POINTERS_VS(p->dev,
+ p->state.vs.BINDING_TABLE_STATE, p->cp);
}
/* 3DSTATE_SAMPLER_STATE_POINTERS_VS */
if (emit_3dstate_sampler_state) {
- p->gen7_3DSTATE_SAMPLER_STATE_POINTERS_VS(p->dev,
- p->state.vs.SAMPLER_STATE, p->cp);
+ gen7_emit_3DSTATE_SAMPLER_STATE_POINTERS_VS(p->dev,
+ p->state.vs.SAMPLER_STATE, p->cp);
+ }
+
+ /* 3DSTATE_CONSTANT_VS */
+ if (emit_3dstate_constant_vs) {
+ gen7_emit_3DSTATE_CONSTANT_VS(p->dev,
+ &p->state.vs.PUSH_CONSTANT_BUFFER,
+ &p->state.vs.PUSH_CONSTANT_BUFFER_size,
+ 1, p->cp);
}
- gen6_pipeline_vs(p, ilo, session);
+ /* 3DSTATE_VS */
+ if (emit_3dstate_vs) {
+ const int num_samplers = ilo->sampler[PIPE_SHADER_VERTEX].count;
+
+ gen6_emit_3DSTATE_VS(p->dev, ilo->vs, num_samplers, p->cp);
+ }
}
static void
@@ -317,13 +331,13 @@ gen7_pipeline_hs(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_CONSTANT_HS and 3DSTATE_HS */
if (session->hw_ctx_changed) {
- p->gen7_3DSTATE_CONSTANT_HS(p->dev, 0, 0, 0, p->cp);
- p->gen7_3DSTATE_HS(p->dev, NULL, 0, p->cp);
+ gen7_emit_3DSTATE_CONSTANT_HS(p->dev, 0, 0, 0, p->cp);
+ gen7_emit_3DSTATE_HS(p->dev, NULL, 0, p->cp);
}
/* 3DSTATE_BINDING_TABLE_POINTERS_HS */
if (session->hw_ctx_changed)
- p->gen7_3DSTATE_BINDING_TABLE_POINTERS_HS(p->dev, 0, p->cp);
+ gen7_emit_3DSTATE_BINDING_TABLE_POINTERS_HS(p->dev, 0, p->cp);
}
static void
@@ -333,7 +347,7 @@ gen7_pipeline_te(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_TE */
if (session->hw_ctx_changed)
- p->gen7_3DSTATE_TE(p->dev, p->cp);
+ gen7_emit_3DSTATE_TE(p->dev, p->cp);
}
static void
@@ -343,13 +357,13 @@ gen7_pipeline_ds(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_CONSTANT_DS and 3DSTATE_DS */
if (session->hw_ctx_changed) {
- p->gen7_3DSTATE_CONSTANT_DS(p->dev, 0, 0, 0, p->cp);
- p->gen7_3DSTATE_DS(p->dev, NULL, 0, p->cp);
+ gen7_emit_3DSTATE_CONSTANT_DS(p->dev, 0, 0, 0, p->cp);
+ gen7_emit_3DSTATE_DS(p->dev, NULL, 0, p->cp);
}
/* 3DSTATE_BINDING_TABLE_POINTERS_DS */
if (session->hw_ctx_changed)
- p->gen7_3DSTATE_BINDING_TABLE_POINTERS_DS(p->dev, 0, p->cp);
+ gen7_emit_3DSTATE_BINDING_TABLE_POINTERS_DS(p->dev, 0, p->cp);
}
@@ -360,13 +374,13 @@ gen7_pipeline_gs(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_CONSTANT_GS and 3DSTATE_GS */
if (session->hw_ctx_changed) {
- p->gen6_3DSTATE_CONSTANT_GS(p->dev, 0, 0, 0, p->cp);
- p->gen7_3DSTATE_GS(p->dev, NULL, 0, p->cp);
+ gen7_emit_3DSTATE_CONSTANT_GS(p->dev, 0, 0, 0, p->cp);
+ gen7_emit_3DSTATE_GS(p->dev, NULL, 0, p->cp);
}
/* 3DSTATE_BINDING_TABLE_POINTERS_GS */
if (session->binding_table_gs_changed) {
- p->gen7_3DSTATE_BINDING_TABLE_POINTERS_GS(p->dev,
+ gen7_emit_3DSTATE_BINDING_TABLE_POINTERS_GS(p->dev,
p->state.gs.BINDING_TABLE_STATE, p->cp);
}
}
@@ -408,17 +422,17 @@ gen7_pipeline_sol(struct ilo_3d_pipeline *p,
base += p->state.so_num_vertices * stride;
}
- p->gen7_3DSTATE_SO_BUFFER(p->dev, i, base, stride,
+ gen7_emit_3DSTATE_SO_BUFFER(p->dev, i, base, stride,
ilo->so.states[i], p->cp);
}
for (; i < 4; i++)
- p->gen7_3DSTATE_SO_BUFFER(p->dev, i, 0, 0, NULL, p->cp);
+ gen7_emit_3DSTATE_SO_BUFFER(p->dev, i, 0, 0, NULL, p->cp);
}
/* 3DSTATE_SO_DECL_LIST */
if (dirty_sh && ilo->so.enabled)
- p->gen7_3DSTATE_SO_DECL_LIST(p->dev, so_info, p->cp);
+ gen7_emit_3DSTATE_SO_DECL_LIST(p->dev, so_info, p->cp);
/* 3DSTATE_STREAMOUT */
if (DIRTY(SO) || DIRTY(RASTERIZER) || dirty_sh) {
@@ -426,7 +440,7 @@ gen7_pipeline_sol(struct ilo_3d_pipeline *p,
const int output_count = ilo_shader_get_kernel_param(shader,
ILO_KERNEL_OUTPUT_COUNT);
- p->gen7_3DSTATE_STREAMOUT(p->dev, buffer_mask, output_count,
+ gen7_emit_3DSTATE_STREAMOUT(p->dev, buffer_mask, output_count,
ilo->rasterizer->state.rasterizer_discard, p->cp);
}
}
@@ -438,14 +452,14 @@ gen7_pipeline_sf(struct ilo_3d_pipeline *p,
{
/* 3DSTATE_SBE */
if (DIRTY(RASTERIZER) || DIRTY(VS) || DIRTY(GS) || DIRTY(FS)) {
- p->gen7_3DSTATE_SBE(p->dev, ilo->rasterizer, ilo->fs,
+ gen7_emit_3DSTATE_SBE(p->dev, ilo->rasterizer, ilo->fs,
(ilo->gs) ? ilo->gs : ilo->vs, ilo->cp);
}
/* 3DSTATE_SF */
if (DIRTY(RASTERIZER) || DIRTY(FB)) {
gen7_wa_pipe_control_cs_stall(p, true, true);
- p->gen7_3DSTATE_SF(p->dev, ilo->rasterizer, ilo->fb.state.zsbuf, p->cp);
+ gen7_emit_3DSTATE_SF(p->dev, ilo->rasterizer, ilo->fb.state.zsbuf, p->cp);
}
}
@@ -462,25 +476,25 @@ gen7_pipeline_wm(struct ilo_3d_pipeline *p,
if (p->dev->gen == ILO_GEN(7) && session->hw_ctx_changed)
gen7_wa_pipe_control_wm_max_threads_stall(p);
- p->gen7_3DSTATE_WM(p->dev, ilo->fs,
+ gen7_emit_3DSTATE_WM(p->dev, ilo->fs,
ilo->rasterizer, cc_may_kill, p->cp);
}
/* 3DSTATE_BINDING_TABLE_POINTERS_PS */
if (session->binding_table_fs_changed) {
- p->gen7_3DSTATE_BINDING_TABLE_POINTERS_PS(p->dev,
+ gen7_emit_3DSTATE_BINDING_TABLE_POINTERS_PS(p->dev,
p->state.wm.BINDING_TABLE_STATE, p->cp);
}
/* 3DSTATE_SAMPLER_STATE_POINTERS_PS */
if (session->sampler_state_fs_changed) {
- p->gen7_3DSTATE_SAMPLER_STATE_POINTERS_PS(p->dev,
+ gen7_emit_3DSTATE_SAMPLER_STATE_POINTERS_PS(p->dev,
p->state.wm.SAMPLER_STATE, p->cp);
}
/* 3DSTATE_CONSTANT_PS */
if (session->pcb_state_fs_changed)
- p->gen6_3DSTATE_CONSTANT_PS(p->dev, NULL, NULL, 0, p->cp);
+ gen7_emit_3DSTATE_CONSTANT_PS(p->dev, NULL, NULL, 0, p->cp);
/* 3DSTATE_PS */
if (DIRTY(FS) || DIRTY(SAMPLER_FS) || DIRTY(BLEND) ||
@@ -488,12 +502,12 @@ gen7_pipeline_wm(struct ilo_3d_pipeline *p,
const int num_samplers = ilo->sampler[PIPE_SHADER_FRAGMENT].count;
const bool dual_blend = ilo->blend->dual_blend;
- p->gen7_3DSTATE_PS(p->dev, ilo->fs, num_samplers, dual_blend, p->cp);
+ gen7_emit_3DSTATE_PS(p->dev, ilo->fs, num_samplers, dual_blend, p->cp);
}
/* 3DSTATE_SCISSOR_STATE_POINTERS */
if (session->scissor_state_changed) {
- p->gen6_3DSTATE_SCISSOR_STATE_POINTERS(p->dev,
+ gen6_emit_3DSTATE_SCISSOR_STATE_POINTERS(p->dev,
p->state.SCISSOR_RECT, p->cp);
}
@@ -531,12 +545,12 @@ gen7_pipeline_wm(struct ilo_3d_pipeline *p,
zs = &ilo->fb.null_zs;
}
- p->gen7_3DSTATE_DEPTH_BUFFER(p->dev, zs, p->cp);
- p->gen6_3DSTATE_HIER_DEPTH_BUFFER(p->dev, zs, p->cp);
- p->gen6_3DSTATE_STENCIL_BUFFER(p->dev, zs, p->cp);
+ gen6_emit_3DSTATE_DEPTH_BUFFER(p->dev, zs, p->cp);
+ gen6_emit_3DSTATE_HIER_DEPTH_BUFFER(p->dev, zs, p->cp);
+ gen6_emit_3DSTATE_STENCIL_BUFFER(p->dev, zs, p->cp);
/* TODO */
- p->gen6_3DSTATE_CLEAR_PARAMS(p->dev, 0, p->cp);
+ gen7_emit_3DSTATE_CLEAR_PARAMS(p->dev, 0, p->cp);
}
}
@@ -556,17 +570,27 @@ gen7_pipeline_wm_multisample(struct ilo_3d_pipeline *p,
(ilo->fb.num_samples > 1) ? &p->packed_sample_position_4x :
&p->packed_sample_position_1x;
- p->gen6_3DSTATE_MULTISAMPLE(p->dev,
+ gen6_emit_3DSTATE_MULTISAMPLE(p->dev,
ilo->fb.num_samples, packed_sample_pos,
ilo->rasterizer->state.half_pixel_center, p->cp);
- p->gen7_3DSTATE_SAMPLE_MASK(p->dev,
+ gen7_emit_3DSTATE_SAMPLE_MASK(p->dev,
(ilo->fb.num_samples > 1) ? ilo->sample_mask : 0x1,
ilo->fb.num_samples, p->cp);
}
}
static void
+gen7_pipeline_vf_draw(struct ilo_3d_pipeline *p,
+ const struct ilo_context *ilo,
+ struct gen6_pipeline_session *session)
+{
+ /* 3DPRIMITIVE */
+ gen7_emit_3DPRIMITIVE(p->dev, ilo->draw, &ilo->ib, false, p->cp);
+ p->state.has_gen6_wa_pipe_control = false;
+}
+
+static void
gen7_pipeline_commands(struct ilo_3d_pipeline *p,
const struct ilo_context *ilo,
struct gen6_pipeline_session *session)
@@ -597,7 +621,7 @@ gen7_pipeline_commands(struct ilo_3d_pipeline *p,
gen6_pipeline_wm_raster(p, ilo, session);
gen6_pipeline_sf_rect(p, ilo, session);
gen6_pipeline_vf(p, ilo, session);
- gen6_pipeline_vf_draw(p, ilo, session);
+ gen7_pipeline_vf_draw(p, ilo, session);
}
static void
@@ -779,94 +803,9 @@ ilo_3d_pipeline_estimate_size_gen7(struct ilo_3d_pipeline *p,
void
ilo_3d_pipeline_init_gen7(struct ilo_3d_pipeline *p)
{
- const struct ilo_gpe_gen7 *gen7 = ilo_gpe_gen7_get();
-
p->estimate_size = ilo_3d_pipeline_estimate_size_gen7;
p->emit_draw = ilo_3d_pipeline_emit_draw_gen7;
p->emit_flush = ilo_3d_pipeline_emit_flush_gen6;
p->emit_write_timestamp = ilo_3d_pipeline_emit_write_timestamp_gen6;
p->emit_write_depth_count = ilo_3d_pipeline_emit_write_depth_count_gen6;
-
-#define GEN6_USE(p, name, from) \
- p->gen6_ ## name = from->emit_ ## name
- GEN6_USE(p, STATE_BASE_ADDRESS, gen7);
- GEN6_USE(p, STATE_SIP, gen7);
- GEN6_USE(p, PIPELINE_SELECT, gen7);
- GEN6_USE(p, 3DSTATE_VERTEX_BUFFERS, gen7);
- GEN6_USE(p, 3DSTATE_VERTEX_ELEMENTS, gen7);
- GEN6_USE(p, 3DSTATE_INDEX_BUFFER, gen7);
- GEN6_USE(p, 3DSTATE_VF_STATISTICS, gen7);
- GEN6_USE(p, 3DSTATE_SCISSOR_STATE_POINTERS, gen7);
- GEN6_USE(p, 3DSTATE_VS, gen7);
- GEN6_USE(p, 3DSTATE_CLIP, gen7);
- GEN6_USE(p, 3DSTATE_CONSTANT_VS, gen7);
- GEN6_USE(p, 3DSTATE_CONSTANT_GS, gen7);
- GEN6_USE(p, 3DSTATE_CONSTANT_PS, gen7);
- GEN6_USE(p, 3DSTATE_DRAWING_RECTANGLE, gen7);
- GEN6_USE(p, 3DSTATE_POLY_STIPPLE_OFFSET, gen7);
- GEN6_USE(p, 3DSTATE_POLY_STIPPLE_PATTERN, gen7);
- GEN6_USE(p, 3DSTATE_LINE_STIPPLE, gen7);
- GEN6_USE(p, 3DSTATE_AA_LINE_PARAMETERS, gen7);
- GEN6_USE(p, 3DSTATE_MULTISAMPLE, gen7);
- GEN6_USE(p, 3DSTATE_STENCIL_BUFFER, gen7);
- GEN6_USE(p, 3DSTATE_HIER_DEPTH_BUFFER, gen7);
- GEN6_USE(p, 3DSTATE_CLEAR_PARAMS, gen7);
- GEN6_USE(p, PIPE_CONTROL, gen7);
- GEN6_USE(p, 3DPRIMITIVE, gen7);
- GEN6_USE(p, INTERFACE_DESCRIPTOR_DATA, gen7);
- GEN6_USE(p, CC_VIEWPORT, gen7);
- GEN6_USE(p, COLOR_CALC_STATE, gen7);
- GEN6_USE(p, BLEND_STATE, gen7);
- GEN6_USE(p, DEPTH_STENCIL_STATE, gen7);
- GEN6_USE(p, SCISSOR_RECT, gen7);
- GEN6_USE(p, BINDING_TABLE_STATE, gen7);
- GEN6_USE(p, SURFACE_STATE, gen7);
- GEN6_USE(p, SAMPLER_STATE, gen7);
- GEN6_USE(p, SAMPLER_BORDER_COLOR_STATE, gen7);
- GEN6_USE(p, push_constant_buffer, gen7);
-#undef GEN6_USE
-
-#define GEN7_USE(p, name, from) \
- p->gen7_ ## name = from->emit_ ## name
- GEN7_USE(p, 3DSTATE_DEPTH_BUFFER, gen7);
- GEN7_USE(p, 3DSTATE_CC_STATE_POINTERS, gen7);
- GEN7_USE(p, 3DSTATE_GS, gen7);
- GEN7_USE(p, 3DSTATE_SF, gen7);
- GEN7_USE(p, 3DSTATE_WM, gen7);
- GEN7_USE(p, 3DSTATE_SAMPLE_MASK, gen7);
- GEN7_USE(p, 3DSTATE_CONSTANT_HS, gen7);
- GEN7_USE(p, 3DSTATE_CONSTANT_DS, gen7);
- GEN7_USE(p, 3DSTATE_HS, gen7);
- GEN7_USE(p, 3DSTATE_TE, gen7);
- GEN7_USE(p, 3DSTATE_DS, gen7);
- GEN7_USE(p, 3DSTATE_STREAMOUT, gen7);
- GEN7_USE(p, 3DSTATE_SBE, gen7);
- GEN7_USE(p, 3DSTATE_PS, gen7);
- GEN7_USE(p, 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP, gen7);
- GEN7_USE(p, 3DSTATE_VIEWPORT_STATE_POINTERS_CC, gen7);
- GEN7_USE(p, 3DSTATE_BLEND_STATE_POINTERS, gen7);
- GEN7_USE(p, 3DSTATE_DEPTH_STENCIL_STATE_POINTERS, gen7);
- GEN7_USE(p, 3DSTATE_BINDING_TABLE_POINTERS_VS, gen7);
- GEN7_USE(p, 3DSTATE_BINDING_TABLE_POINTERS_HS, gen7);
- GEN7_USE(p, 3DSTATE_BINDING_TABLE_POINTERS_DS, gen7);
- GEN7_USE(p, 3DSTATE_BINDING_TABLE_POINTERS_GS, gen7);
- GEN7_USE(p, 3DSTATE_BINDING_TABLE_POINTERS_PS, gen7);
- GEN7_USE(p, 3DSTATE_SAMPLER_STATE_POINTERS_VS, gen7);
- GEN7_USE(p, 3DSTATE_SAMPLER_STATE_POINTERS_HS, gen7);
- GEN7_USE(p, 3DSTATE_SAMPLER_STATE_POINTERS_DS, gen7);
- GEN7_USE(p, 3DSTATE_SAMPLER_STATE_POINTERS_GS, gen7);
- GEN7_USE(p, 3DSTATE_SAMPLER_STATE_POINTERS_PS, gen7);
- GEN7_USE(p, 3DSTATE_URB_VS, gen7);
- GEN7_USE(p, 3DSTATE_URB_HS, gen7);
- GEN7_USE(p, 3DSTATE_URB_DS, gen7);
- GEN7_USE(p, 3DSTATE_URB_GS, gen7);
- GEN7_USE(p, 3DSTATE_PUSH_CONSTANT_ALLOC_VS, gen7);
- GEN7_USE(p, 3DSTATE_PUSH_CONSTANT_ALLOC_HS, gen7);
- GEN7_USE(p, 3DSTATE_PUSH_CONSTANT_ALLOC_DS, gen7);
- GEN7_USE(p, 3DSTATE_PUSH_CONSTANT_ALLOC_GS, gen7);
- GEN7_USE(p, 3DSTATE_PUSH_CONSTANT_ALLOC_PS, gen7);
- GEN7_USE(p, 3DSTATE_SO_DECL_LIST, gen7);
- GEN7_USE(p, 3DSTATE_SO_BUFFER, gen7);
- GEN7_USE(p, SF_CLIP_VIEWPORT, gen7);
-#undef GEN7_USE
}
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen6.c b/src/gallium/drivers/ilo/ilo_gpe_gen6.c
index 6059276f4d3..c64d9f6050f 100644
--- a/src/gallium/drivers/ilo/ilo_gpe_gen6.c
+++ b/src/gallium/drivers/ilo/ilo_gpe_gen6.c
@@ -2541,64 +2541,6 @@ gen6_estimate_state_size(const struct ilo_dev_info *dev,
static const struct ilo_gpe_gen6 gen6_gpe = {
.estimate_command_size = gen6_estimate_command_size,
.estimate_state_size = gen6_estimate_state_size,
-
-#define GEN6_SET(name) .emit_ ## name = gen6_emit_ ## name
- GEN6_SET(STATE_BASE_ADDRESS),
- GEN6_SET(STATE_SIP),
- GEN6_SET(3DSTATE_VF_STATISTICS),
- GEN6_SET(PIPELINE_SELECT),
- GEN6_SET(MEDIA_VFE_STATE),
- GEN6_SET(MEDIA_CURBE_LOAD),
- GEN6_SET(MEDIA_INTERFACE_DESCRIPTOR_LOAD),
- GEN6_SET(MEDIA_GATEWAY_STATE),
- GEN6_SET(MEDIA_STATE_FLUSH),
- GEN6_SET(MEDIA_OBJECT_WALKER),
- GEN6_SET(3DSTATE_BINDING_TABLE_POINTERS),
- GEN6_SET(3DSTATE_SAMPLER_STATE_POINTERS),
- GEN6_SET(3DSTATE_URB),
- GEN6_SET(3DSTATE_VERTEX_BUFFERS),
- GEN6_SET(3DSTATE_VERTEX_ELEMENTS),
- GEN6_SET(3DSTATE_INDEX_BUFFER),
- GEN6_SET(3DSTATE_VIEWPORT_STATE_POINTERS),
- GEN6_SET(3DSTATE_CC_STATE_POINTERS),
- GEN6_SET(3DSTATE_SCISSOR_STATE_POINTERS),
- GEN6_SET(3DSTATE_VS),
- GEN6_SET(3DSTATE_GS),
- GEN6_SET(3DSTATE_CLIP),
- GEN6_SET(3DSTATE_SF),
- GEN6_SET(3DSTATE_WM),
- GEN6_SET(3DSTATE_CONSTANT_VS),
- GEN6_SET(3DSTATE_CONSTANT_GS),
- GEN6_SET(3DSTATE_CONSTANT_PS),
- GEN6_SET(3DSTATE_SAMPLE_MASK),
- GEN6_SET(3DSTATE_DRAWING_RECTANGLE),
- GEN6_SET(3DSTATE_DEPTH_BUFFER),
- GEN6_SET(3DSTATE_POLY_STIPPLE_OFFSET),
- GEN6_SET(3DSTATE_POLY_STIPPLE_PATTERN),
- GEN6_SET(3DSTATE_LINE_STIPPLE),
- GEN6_SET(3DSTATE_AA_LINE_PARAMETERS),
- GEN6_SET(3DSTATE_GS_SVB_INDEX),
- GEN6_SET(3DSTATE_MULTISAMPLE),
- GEN6_SET(3DSTATE_STENCIL_BUFFER),
- GEN6_SET(3DSTATE_HIER_DEPTH_BUFFER),
- GEN6_SET(3DSTATE_CLEAR_PARAMS),
- GEN6_SET(PIPE_CONTROL),
- GEN6_SET(3DPRIMITIVE),
- GEN6_SET(INTERFACE_DESCRIPTOR_DATA),
- GEN6_SET(SF_VIEWPORT),
- GEN6_SET(CLIP_VIEWPORT),
- GEN6_SET(CC_VIEWPORT),
- GEN6_SET(COLOR_CALC_STATE),
- GEN6_SET(BLEND_STATE),
- GEN6_SET(DEPTH_STENCIL_STATE),
- GEN6_SET(SCISSOR_RECT),
- GEN6_SET(BINDING_TABLE_STATE),
- GEN6_SET(SURFACE_STATE),
- GEN6_SET(so_SURFACE_STATE),
- GEN6_SET(SAMPLER_STATE),
- GEN6_SET(SAMPLER_BORDER_COLOR_STATE),
- GEN6_SET(push_constant_buffer),
-#undef GEN6_SET
};
const struct ilo_gpe_gen6 *
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen6.h b/src/gallium/drivers/ilo/ilo_gpe_gen6.h
index 7d4bbb59dfe..840dce73dd3 100644
--- a/src/gallium/drivers/ilo/ilo_gpe_gen6.h
+++ b/src/gallium/drivers/ilo/ilo_gpe_gen6.h
@@ -123,346 +123,6 @@ struct ilo_cp;
struct ilo_texture;
struct ilo_shader;
-typedef void
-(*ilo_gpe_gen6_STATE_BASE_ADDRESS)(const struct ilo_dev_info *dev,
- struct intel_bo *general_state_bo,
- struct intel_bo *surface_state_bo,
- struct intel_bo *dynamic_state_bo,
- struct intel_bo *indirect_object_bo,
- struct intel_bo *instruction_bo,
- uint32_t general_state_size,
- uint32_t dynamic_state_size,
- uint32_t indirect_object_size,
- uint32_t instruction_size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_STATE_SIP)(const struct ilo_dev_info *dev,
- uint32_t sip,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_VF_STATISTICS)(const struct ilo_dev_info *dev,
- bool enable,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_PIPELINE_SELECT)(const struct ilo_dev_info *dev,
- int pipeline,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_MEDIA_VFE_STATE)(const struct ilo_dev_info *dev,
- int max_threads, int num_urb_entries,
- int urb_entry_size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_MEDIA_CURBE_LOAD)(const struct ilo_dev_info *dev,
- uint32_t buf, int size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_MEDIA_INTERFACE_DESCRIPTOR_LOAD)(const struct ilo_dev_info *dev,
- uint32_t offset, int num_ids,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_MEDIA_GATEWAY_STATE)(const struct ilo_dev_info *dev,
- int id, int byte, int thread_count,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_MEDIA_STATE_FLUSH)(const struct ilo_dev_info *dev,
- int thread_count_water_mark,
- int barrier_mask,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_MEDIA_OBJECT_WALKER)(const struct ilo_dev_info *dev,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_BINDING_TABLE_POINTERS)(const struct ilo_dev_info *dev,
- uint32_t vs_binding_table,
- uint32_t gs_binding_table,
- uint32_t ps_binding_table,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_SAMPLER_STATE_POINTERS)(const struct ilo_dev_info *dev,
- uint32_t vs_sampler_state,
- uint32_t gs_sampler_state,
- uint32_t ps_sampler_state,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_URB)(const struct ilo_dev_info *dev,
- int vs_total_size, int gs_total_size,
- int vs_entry_size, int gs_entry_size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_VERTEX_BUFFERS)(const struct ilo_dev_info *dev,
- const struct ilo_ve_state *ve,
- const struct ilo_vb_state *vb,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_VERTEX_ELEMENTS)(const struct ilo_dev_info *dev,
- const struct ilo_ve_state *ve,
- bool last_velement_edgeflag,
- bool prepend_generated_ids,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_INDEX_BUFFER)(const struct ilo_dev_info *dev,
- const struct ilo_ib_state *ib,
- bool enable_cut_index,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_VIEWPORT_STATE_POINTERS)(const struct ilo_dev_info *dev,
- uint32_t clip_viewport,
- uint32_t sf_viewport,
- uint32_t cc_viewport,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_CC_STATE_POINTERS)(const struct ilo_dev_info *dev,
- uint32_t blend_state,
- uint32_t depth_stencil_state,
- uint32_t color_calc_state,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_SCISSOR_STATE_POINTERS)(const struct ilo_dev_info *dev,
- uint32_t scissor_rect,
- struct ilo_cp *cp);
-
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_VS)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *vs,
- int num_samplers,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_GS)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *gs,
- const struct ilo_shader_state *vs,
- int verts_per_prim,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_CLIP)(const struct ilo_dev_info *dev,
- const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader_state *fs,
- bool enable_guardband,
- int num_viewports,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_SF)(const struct ilo_dev_info *dev,
- const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader_state *fs,
- const struct ilo_shader_state *last_sh,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_WM)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *fs,
- int num_samplers,
- const struct ilo_rasterizer_state *rasterizer,
- bool dual_blend, bool cc_may_kill,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_CONSTANT_VS)(const struct ilo_dev_info *dev,
- const uint32_t *bufs, const int *sizes,
- int num_bufs,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_CONSTANT_GS)(const struct ilo_dev_info *dev,
- const uint32_t *bufs, const int *sizes,
- int num_bufs,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_CONSTANT_PS)(const struct ilo_dev_info *dev,
- const uint32_t *bufs, const int *sizes,
- int num_bufs,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_SAMPLE_MASK)(const struct ilo_dev_info *dev,
- unsigned sample_mask,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_DRAWING_RECTANGLE)(const struct ilo_dev_info *dev,
- unsigned x, unsigned y,
- unsigned width, unsigned height,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_DEPTH_BUFFER)(const struct ilo_dev_info *dev,
- const struct ilo_zs_surface *zs,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_POLY_STIPPLE_OFFSET)(const struct ilo_dev_info *dev,
- int x_offset, int y_offset,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_POLY_STIPPLE_PATTERN)(const struct ilo_dev_info *dev,
- const struct pipe_poly_stipple *pattern,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_LINE_STIPPLE)(const struct ilo_dev_info *dev,
- unsigned pattern, unsigned factor,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_AA_LINE_PARAMETERS)(const struct ilo_dev_info *dev,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_GS_SVB_INDEX)(const struct ilo_dev_info *dev,
- int index, unsigned svbi,
- unsigned max_svbi,
- bool load_vertex_count,
- struct ilo_cp *cp);
-
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_MULTISAMPLE)(const struct ilo_dev_info *dev,
- int num_samples,
- const uint32_t *packed_sample_pos,
- bool pixel_location_center,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_STENCIL_BUFFER)(const struct ilo_dev_info *dev,
- const struct ilo_zs_surface *zs,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_HIER_DEPTH_BUFFER)(const struct ilo_dev_info *dev,
- const struct ilo_zs_surface *zs,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DSTATE_CLEAR_PARAMS)(const struct ilo_dev_info *dev,
- uint32_t clear_val,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_PIPE_CONTROL)(const struct ilo_dev_info *dev,
- uint32_t dw1,
- struct intel_bo *bo, uint32_t bo_offset,
- bool write_qword,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen6_3DPRIMITIVE)(const struct ilo_dev_info *dev,
- const struct pipe_draw_info *info,
- const struct ilo_ib_state *ib,
- bool rectlist,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_INTERFACE_DESCRIPTOR_DATA)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state **cs,
- uint32_t *sampler_state,
- int *num_samplers,
- uint32_t *binding_table_state,
- int *num_surfaces,
- int num_ids,
- struct ilo_cp *cp);
-typedef uint32_t
-(*ilo_gpe_gen6_SF_VIEWPORT)(const struct ilo_dev_info *dev,
- const struct ilo_viewport_cso *viewports,
- unsigned num_viewports,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_CLIP_VIEWPORT)(const struct ilo_dev_info *dev,
- const struct ilo_viewport_cso *viewports,
- unsigned num_viewports,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_CC_VIEWPORT)(const struct ilo_dev_info *dev,
- const struct ilo_viewport_cso *viewports,
- unsigned num_viewports,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_COLOR_CALC_STATE)(const struct ilo_dev_info *dev,
- const struct pipe_stencil_ref *stencil_ref,
- float alpha_ref,
- const struct pipe_blend_color *blend_color,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_BLEND_STATE)(const struct ilo_dev_info *dev,
- const struct ilo_blend_state *blend,
- const struct ilo_fb_state *fb,
- const struct pipe_alpha_state *alpha,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_DEPTH_STENCIL_STATE)(const struct ilo_dev_info *dev,
- const struct ilo_dsa_state *dsa,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_SCISSOR_RECT)(const struct ilo_dev_info *dev,
- const struct ilo_scissor_state *scissor,
- unsigned num_viewports,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_BINDING_TABLE_STATE)(const struct ilo_dev_info *dev,
- uint32_t *surface_states,
- int num_surface_states,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_SURFACE_STATE)(const struct ilo_dev_info *dev,
- const struct ilo_view_surface *surface,
- bool for_render,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_so_SURFACE_STATE)(const struct ilo_dev_info *dev,
- const struct pipe_stream_output_target *so,
- const struct pipe_stream_output_info *so_info,
- int so_index,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_SAMPLER_STATE)(const struct ilo_dev_info *dev,
- const struct ilo_sampler_cso * const *samplers,
- const struct pipe_sampler_view * const *views,
- const uint32_t *sampler_border_colors,
- int num_samplers,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_SAMPLER_BORDER_COLOR_STATE)(const struct ilo_dev_info *dev,
- const struct ilo_sampler_cso *sampler,
- struct ilo_cp *cp);
-
-typedef uint32_t
-(*ilo_gpe_gen6_push_constant_buffer)(const struct ilo_dev_info *dev,
- int size, void **pcb,
- struct ilo_cp *cp);
-
/**
* GEN6 graphics processing engine
*
@@ -477,64 +137,6 @@ struct ilo_gpe_gen6 {
int (*estimate_state_size)(const struct ilo_dev_info *dev,
enum ilo_gpe_gen6_state state,
int arg);
-
-#define GEN6_EMIT(name) ilo_gpe_gen6_ ## name emit_ ## name
- GEN6_EMIT(STATE_BASE_ADDRESS);
- GEN6_EMIT(STATE_SIP);
- GEN6_EMIT(3DSTATE_VF_STATISTICS);
- GEN6_EMIT(PIPELINE_SELECT);
- GEN6_EMIT(MEDIA_VFE_STATE);
- GEN6_EMIT(MEDIA_CURBE_LOAD);
- GEN6_EMIT(MEDIA_INTERFACE_DESCRIPTOR_LOAD);
- GEN6_EMIT(MEDIA_GATEWAY_STATE);
- GEN6_EMIT(MEDIA_STATE_FLUSH);
- GEN6_EMIT(MEDIA_OBJECT_WALKER);
- GEN6_EMIT(3DSTATE_BINDING_TABLE_POINTERS);
- GEN6_EMIT(3DSTATE_SAMPLER_STATE_POINTERS);
- GEN6_EMIT(3DSTATE_URB);
- GEN6_EMIT(3DSTATE_VERTEX_BUFFERS);
- GEN6_EMIT(3DSTATE_VERTEX_ELEMENTS);
- GEN6_EMIT(3DSTATE_INDEX_BUFFER);
- GEN6_EMIT(3DSTATE_VIEWPORT_STATE_POINTERS);
- GEN6_EMIT(3DSTATE_CC_STATE_POINTERS);
- GEN6_EMIT(3DSTATE_SCISSOR_STATE_POINTERS);
- GEN6_EMIT(3DSTATE_VS);
- GEN6_EMIT(3DSTATE_GS);
- GEN6_EMIT(3DSTATE_CLIP);
- GEN6_EMIT(3DSTATE_SF);
- GEN6_EMIT(3DSTATE_WM);
- GEN6_EMIT(3DSTATE_CONSTANT_VS);
- GEN6_EMIT(3DSTATE_CONSTANT_GS);
- GEN6_EMIT(3DSTATE_CONSTANT_PS);
- GEN6_EMIT(3DSTATE_SAMPLE_MASK);
- GEN6_EMIT(3DSTATE_DRAWING_RECTANGLE);
- GEN6_EMIT(3DSTATE_DEPTH_BUFFER);
- GEN6_EMIT(3DSTATE_POLY_STIPPLE_OFFSET);
- GEN6_EMIT(3DSTATE_POLY_STIPPLE_PATTERN);
- GEN6_EMIT(3DSTATE_LINE_STIPPLE);
- GEN6_EMIT(3DSTATE_AA_LINE_PARAMETERS);
- GEN6_EMIT(3DSTATE_GS_SVB_INDEX);
- GEN6_EMIT(3DSTATE_MULTISAMPLE);
- GEN6_EMIT(3DSTATE_STENCIL_BUFFER);
- GEN6_EMIT(3DSTATE_HIER_DEPTH_BUFFER);
- GEN6_EMIT(3DSTATE_CLEAR_PARAMS);
- GEN6_EMIT(PIPE_CONTROL);
- GEN6_EMIT(3DPRIMITIVE);
- GEN6_EMIT(INTERFACE_DESCRIPTOR_DATA);
- GEN6_EMIT(SF_VIEWPORT);
- GEN6_EMIT(CLIP_VIEWPORT);
- GEN6_EMIT(CC_VIEWPORT);
- GEN6_EMIT(COLOR_CALC_STATE);
- GEN6_EMIT(BLEND_STATE);
- GEN6_EMIT(DEPTH_STENCIL_STATE);
- GEN6_EMIT(SCISSOR_RECT);
- GEN6_EMIT(BINDING_TABLE_STATE);
- GEN6_EMIT(SURFACE_STATE);
- GEN6_EMIT(so_SURFACE_STATE);
- GEN6_EMIT(SAMPLER_STATE);
- GEN6_EMIT(SAMPLER_BORDER_COLOR_STATE);
- GEN6_EMIT(push_constant_buffer);
-#undef GEN6_EMIT
};
const struct ilo_gpe_gen6 *
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen7.c b/src/gallium/drivers/ilo/ilo_gpe_gen7.c
index 0af7eea0cb2..cfabe8b3a2f 100644
--- a/src/gallium/drivers/ilo/ilo_gpe_gen7.c
+++ b/src/gallium/drivers/ilo/ilo_gpe_gen7.c
@@ -792,95 +792,8 @@ gen7_estimate_state_size(const struct ilo_dev_info *dev,
static void
gen7_init(struct ilo_gpe_gen7 *gen7)
{
- const struct ilo_gpe_gen6 *gen6 = ilo_gpe_gen6_get();
-
gen7->estimate_command_size = gen7_estimate_command_size;
gen7->estimate_state_size = gen7_estimate_state_size;
-
-#define GEN7_USE(gen7, name, from) gen7->emit_ ## name = from->emit_ ## name
-#define GEN7_SET(gen7, name) gen7->emit_ ## name = gen7_emit_ ## name
- GEN7_USE(gen7, STATE_BASE_ADDRESS, gen6);
- GEN7_USE(gen7, STATE_SIP, gen6);
- GEN7_USE(gen7, 3DSTATE_VF_STATISTICS, gen6);
- GEN7_USE(gen7, PIPELINE_SELECT, gen6);
- GEN7_USE(gen7, MEDIA_VFE_STATE, gen6);
- GEN7_USE(gen7, MEDIA_CURBE_LOAD, gen6);
- GEN7_USE(gen7, MEDIA_INTERFACE_DESCRIPTOR_LOAD, gen6);
- GEN7_USE(gen7, MEDIA_STATE_FLUSH, gen6);
- GEN7_SET(gen7, GPGPU_WALKER);
- GEN7_SET(gen7, 3DSTATE_CLEAR_PARAMS);
- GEN7_USE(gen7, 3DSTATE_DEPTH_BUFFER, gen6);
- GEN7_USE(gen7, 3DSTATE_STENCIL_BUFFER, gen6);
- GEN7_USE(gen7, 3DSTATE_HIER_DEPTH_BUFFER, gen6);
- GEN7_USE(gen7, 3DSTATE_VERTEX_BUFFERS, gen6);
- GEN7_USE(gen7, 3DSTATE_VERTEX_ELEMENTS, gen6);
- GEN7_USE(gen7, 3DSTATE_INDEX_BUFFER, gen6);
- GEN7_SET(gen7, 3DSTATE_CC_STATE_POINTERS);
- GEN7_USE(gen7, 3DSTATE_SCISSOR_STATE_POINTERS, gen6);
- GEN7_USE(gen7, 3DSTATE_VS, gen6);
- GEN7_SET(gen7, 3DSTATE_GS);
- GEN7_USE(gen7, 3DSTATE_CLIP, gen6);
- GEN7_SET(gen7, 3DSTATE_SF);
- GEN7_SET(gen7, 3DSTATE_WM);
- GEN7_SET(gen7, 3DSTATE_CONSTANT_VS);
- GEN7_SET(gen7, 3DSTATE_CONSTANT_GS);
- GEN7_SET(gen7, 3DSTATE_CONSTANT_PS);
- GEN7_SET(gen7, 3DSTATE_SAMPLE_MASK);
- GEN7_SET(gen7, 3DSTATE_CONSTANT_HS);
- GEN7_SET(gen7, 3DSTATE_CONSTANT_DS);
- GEN7_SET(gen7, 3DSTATE_HS);
- GEN7_SET(gen7, 3DSTATE_TE);
- GEN7_SET(gen7, 3DSTATE_DS);
- GEN7_SET(gen7, 3DSTATE_STREAMOUT);
- GEN7_SET(gen7, 3DSTATE_SBE);
- GEN7_SET(gen7, 3DSTATE_PS);
- GEN7_SET(gen7, 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP);
- GEN7_SET(gen7, 3DSTATE_VIEWPORT_STATE_POINTERS_CC);
- GEN7_SET(gen7, 3DSTATE_BLEND_STATE_POINTERS);
- GEN7_SET(gen7, 3DSTATE_DEPTH_STENCIL_STATE_POINTERS);
- GEN7_SET(gen7, 3DSTATE_BINDING_TABLE_POINTERS_VS);
- GEN7_SET(gen7, 3DSTATE_BINDING_TABLE_POINTERS_HS);
- GEN7_SET(gen7, 3DSTATE_BINDING_TABLE_POINTERS_DS);
- GEN7_SET(gen7, 3DSTATE_BINDING_TABLE_POINTERS_GS);
- GEN7_SET(gen7, 3DSTATE_BINDING_TABLE_POINTERS_PS);
- GEN7_SET(gen7, 3DSTATE_SAMPLER_STATE_POINTERS_VS);
- GEN7_SET(gen7, 3DSTATE_SAMPLER_STATE_POINTERS_HS);
- GEN7_SET(gen7, 3DSTATE_SAMPLER_STATE_POINTERS_DS);
- GEN7_SET(gen7, 3DSTATE_SAMPLER_STATE_POINTERS_GS);
- GEN7_SET(gen7, 3DSTATE_SAMPLER_STATE_POINTERS_PS);
- GEN7_SET(gen7, 3DSTATE_URB_VS);
- GEN7_SET(gen7, 3DSTATE_URB_HS);
- GEN7_SET(gen7, 3DSTATE_URB_DS);
- GEN7_SET(gen7, 3DSTATE_URB_GS);
- GEN7_USE(gen7, 3DSTATE_DRAWING_RECTANGLE, gen6);
- GEN7_USE(gen7, 3DSTATE_POLY_STIPPLE_OFFSET, gen6);
- GEN7_USE(gen7, 3DSTATE_POLY_STIPPLE_PATTERN, gen6);
- GEN7_USE(gen7, 3DSTATE_LINE_STIPPLE, gen6);
- GEN7_USE(gen7, 3DSTATE_AA_LINE_PARAMETERS, gen6);
- GEN7_USE(gen7, 3DSTATE_MULTISAMPLE, gen6);
- GEN7_SET(gen7, 3DSTATE_PUSH_CONSTANT_ALLOC_VS);
- GEN7_SET(gen7, 3DSTATE_PUSH_CONSTANT_ALLOC_HS);
- GEN7_SET(gen7, 3DSTATE_PUSH_CONSTANT_ALLOC_DS);
- GEN7_SET(gen7, 3DSTATE_PUSH_CONSTANT_ALLOC_GS);
- GEN7_SET(gen7, 3DSTATE_PUSH_CONSTANT_ALLOC_PS);
- GEN7_SET(gen7, 3DSTATE_SO_DECL_LIST);
- GEN7_SET(gen7, 3DSTATE_SO_BUFFER);
- GEN7_USE(gen7, PIPE_CONTROL, gen6);
- GEN7_SET(gen7, 3DPRIMITIVE);
- GEN7_USE(gen7, INTERFACE_DESCRIPTOR_DATA, gen6);
- GEN7_SET(gen7, SF_CLIP_VIEWPORT);
- GEN7_USE(gen7, CC_VIEWPORT, gen6);
- GEN7_USE(gen7, COLOR_CALC_STATE, gen6);
- GEN7_USE(gen7, BLEND_STATE, gen6);
- GEN7_USE(gen7, DEPTH_STENCIL_STATE, gen6);
- GEN7_USE(gen7, SCISSOR_RECT, gen6);
- GEN7_USE(gen7, BINDING_TABLE_STATE, gen6);
- GEN7_USE(gen7, SURFACE_STATE, gen6);
- GEN7_USE(gen7, SAMPLER_STATE, gen6);
- GEN7_USE(gen7, SAMPLER_BORDER_COLOR_STATE, gen6);
- GEN7_USE(gen7, push_constant_buffer, gen6);
-#undef GEN7_USE
-#undef GEN7_SET
}
static struct ilo_gpe_gen7 gen7_gpe;
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen7.h b/src/gallium/drivers/ilo/ilo_gpe_gen7.h
index e9ddf18a284..a14c9f49415 100644
--- a/src/gallium/drivers/ilo/ilo_gpe_gen7.h
+++ b/src/gallium/drivers/ilo/ilo_gpe_gen7.h
@@ -127,268 +127,6 @@ enum ilo_gpe_gen7_state {
ILO_GPE_GEN7_STATE_COUNT,
};
-typedef ilo_gpe_gen6_STATE_BASE_ADDRESS ilo_gpe_gen7_STATE_BASE_ADDRESS;
-typedef ilo_gpe_gen6_STATE_SIP ilo_gpe_gen7_STATE_SIP;
-typedef ilo_gpe_gen6_3DSTATE_VF_STATISTICS ilo_gpe_gen7_3DSTATE_VF_STATISTICS;
-typedef ilo_gpe_gen6_PIPELINE_SELECT ilo_gpe_gen7_PIPELINE_SELECT;
-typedef ilo_gpe_gen6_MEDIA_VFE_STATE ilo_gpe_gen7_MEDIA_VFE_STATE;
-typedef ilo_gpe_gen6_MEDIA_CURBE_LOAD ilo_gpe_gen7_MEDIA_CURBE_LOAD;
-typedef ilo_gpe_gen6_MEDIA_INTERFACE_DESCRIPTOR_LOAD ilo_gpe_gen7_MEDIA_INTERFACE_DESCRIPTOR_LOAD;
-typedef ilo_gpe_gen6_MEDIA_STATE_FLUSH ilo_gpe_gen7_MEDIA_STATE_FLUSH;
-
-typedef void
-(*ilo_gpe_gen7_GPGPU_WALKER)(const struct ilo_dev_info *dev,
- struct ilo_cp *cp);
-
-typedef ilo_gpe_gen6_3DSTATE_CLEAR_PARAMS ilo_gpe_gen7_3DSTATE_CLEAR_PARAMS;
-typedef ilo_gpe_gen6_3DSTATE_DEPTH_BUFFER ilo_gpe_gen7_3DSTATE_DEPTH_BUFFER;
-typedef ilo_gpe_gen6_3DSTATE_STENCIL_BUFFER ilo_gpe_gen7_3DSTATE_STENCIL_BUFFER;
-typedef ilo_gpe_gen6_3DSTATE_HIER_DEPTH_BUFFER ilo_gpe_gen7_3DSTATE_HIER_DEPTH_BUFFER;
-typedef ilo_gpe_gen6_3DSTATE_VERTEX_BUFFERS ilo_gpe_gen7_3DSTATE_VERTEX_BUFFERS;
-typedef ilo_gpe_gen6_3DSTATE_VERTEX_ELEMENTS ilo_gpe_gen7_3DSTATE_VERTEX_ELEMENTS;
-typedef ilo_gpe_gen6_3DSTATE_INDEX_BUFFER ilo_gpe_gen7_3DSTATE_INDEX_BUFFER;
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_CC_STATE_POINTERS)(const struct ilo_dev_info *dev,
- uint32_t color_calc_state,
- struct ilo_cp *cp);
-
-typedef ilo_gpe_gen6_3DSTATE_SCISSOR_STATE_POINTERS ilo_gpe_gen7_3DSTATE_SCISSOR_STATE_POINTERS;
-typedef ilo_gpe_gen6_3DSTATE_VS ilo_gpe_gen7_3DSTATE_VS;
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_GS)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *gs,
- int num_samplers,
- struct ilo_cp *cp);
-
-typedef ilo_gpe_gen6_3DSTATE_CLIP ilo_gpe_gen7_3DSTATE_CLIP;
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SF)(const struct ilo_dev_info *dev,
- const struct ilo_rasterizer_state *rasterizer,
- const struct pipe_surface *zs_surf,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_WM)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *fs,
- const struct ilo_rasterizer_state *rasterizer,
- bool cc_may_kill,
- struct ilo_cp *cp);
-
-typedef ilo_gpe_gen6_3DSTATE_CONSTANT_VS ilo_gpe_gen7_3DSTATE_CONSTANT_VS;
-typedef ilo_gpe_gen6_3DSTATE_CONSTANT_GS ilo_gpe_gen7_3DSTATE_CONSTANT_GS;
-typedef ilo_gpe_gen6_3DSTATE_CONSTANT_PS ilo_gpe_gen7_3DSTATE_CONSTANT_PS;
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SAMPLE_MASK)(const struct ilo_dev_info *dev,
- unsigned sample_mask,
- int num_samples,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_CONSTANT_HS)(const struct ilo_dev_info *dev,
- const uint32_t *bufs, const int *sizes,
- int num_bufs,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_CONSTANT_DS)(const struct ilo_dev_info *dev,
- const uint32_t *bufs, const int *sizes,
- int num_bufs,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_HS)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *hs,
- int num_samplers,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_TE)(const struct ilo_dev_info *dev,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_DS)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *ds,
- int num_samplers,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_STREAMOUT)(const struct ilo_dev_info *dev,
- unsigned buffer_mask,
- int vertex_attrib_count,
- bool rasterizer_discard,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SBE)(const struct ilo_dev_info *dev,
- const struct ilo_rasterizer_state *rasterizer,
- const struct ilo_shader_state *fs,
- const struct ilo_shader_state *last_sh,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_PS)(const struct ilo_dev_info *dev,
- const struct ilo_shader_state *fs,
- int num_samplers, bool dual_blend,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP)(const struct ilo_dev_info *dev,
- uint32_t viewport,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_VIEWPORT_STATE_POINTERS_CC)(const struct ilo_dev_info *dev,
- uint32_t viewport,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_BLEND_STATE_POINTERS)(const struct ilo_dev_info *dev,
- uint32_t blend,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_DEPTH_STENCIL_STATE_POINTERS)(const struct ilo_dev_info *dev,
- uint32_t depth_stencil,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_BINDING_TABLE_POINTERS_VS)(const struct ilo_dev_info *dev,
- uint32_t binding_table,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_BINDING_TABLE_POINTERS_HS)(const struct ilo_dev_info *dev,
- uint32_t binding_table,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_BINDING_TABLE_POINTERS_DS)(const struct ilo_dev_info *dev,
- uint32_t binding_table,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_BINDING_TABLE_POINTERS_GS)(const struct ilo_dev_info *dev,
- uint32_t binding_table,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_BINDING_TABLE_POINTERS_PS)(const struct ilo_dev_info *dev,
- uint32_t binding_table,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SAMPLER_STATE_POINTERS_VS)(const struct ilo_dev_info *dev,
- uint32_t sampler_state,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SAMPLER_STATE_POINTERS_HS)(const struct ilo_dev_info *dev,
- uint32_t sampler_state,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SAMPLER_STATE_POINTERS_DS)(const struct ilo_dev_info *dev,
- uint32_t sampler_state,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SAMPLER_STATE_POINTERS_GS)(const struct ilo_dev_info *dev,
- uint32_t sampler_state,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SAMPLER_STATE_POINTERS_PS)(const struct ilo_dev_info *dev,
- uint32_t sampler_state,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_URB_VS)(const struct ilo_dev_info *dev,
- int offset, int size, int entry_size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_URB_HS)(const struct ilo_dev_info *dev,
- int offset, int size, int entry_size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_URB_DS)(const struct ilo_dev_info *dev,
- int offset, int size, int entry_size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_URB_GS)(const struct ilo_dev_info *dev,
- int offset, int size, int entry_size,
- struct ilo_cp *cp);
-
-typedef ilo_gpe_gen6_3DSTATE_DRAWING_RECTANGLE ilo_gpe_gen7_3DSTATE_DRAWING_RECTANGLE;
-typedef ilo_gpe_gen6_3DSTATE_POLY_STIPPLE_OFFSET ilo_gpe_gen7_3DSTATE_POLY_STIPPLE_OFFSET;
-typedef ilo_gpe_gen6_3DSTATE_POLY_STIPPLE_PATTERN ilo_gpe_gen7_3DSTATE_POLY_STIPPLE_PATTERN;
-typedef ilo_gpe_gen6_3DSTATE_LINE_STIPPLE ilo_gpe_gen7_3DSTATE_LINE_STIPPLE;
-typedef ilo_gpe_gen6_3DSTATE_AA_LINE_PARAMETERS ilo_gpe_gen7_3DSTATE_AA_LINE_PARAMETERS;
-typedef ilo_gpe_gen6_3DSTATE_MULTISAMPLE ilo_gpe_gen7_3DSTATE_MULTISAMPLE;
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_PUSH_CONSTANT_ALLOC_VS)(const struct ilo_dev_info *dev,
- int offset, int size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_PUSH_CONSTANT_ALLOC_HS)(const struct ilo_dev_info *dev,
- int offset, int size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_PUSH_CONSTANT_ALLOC_DS)(const struct ilo_dev_info *dev,
- int offset, int size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_PUSH_CONSTANT_ALLOC_GS)(const struct ilo_dev_info *dev,
- int offset, int size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_PUSH_CONSTANT_ALLOC_PS)(const struct ilo_dev_info *dev,
- int offset, int size,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SO_DECL_LIST)(const struct ilo_dev_info *dev,
- const struct pipe_stream_output_info *so_info,
- struct ilo_cp *cp);
-
-typedef void
-(*ilo_gpe_gen7_3DSTATE_SO_BUFFER)(const struct ilo_dev_info *dev,
- int index, int base, int stride,
- const struct pipe_stream_output_target *so_target,
- struct ilo_cp *cp);
-
-typedef ilo_gpe_gen6_PIPE_CONTROL ilo_gpe_gen7_PIPE_CONTROL;
-typedef ilo_gpe_gen6_3DPRIMITIVE ilo_gpe_gen7_3DPRIMITIVE;
-typedef ilo_gpe_gen6_INTERFACE_DESCRIPTOR_DATA ilo_gpe_gen7_INTERFACE_DESCRIPTOR_DATA;
-
-typedef uint32_t
-(*ilo_gpe_gen7_SF_CLIP_VIEWPORT)(const struct ilo_dev_info *dev,
- const struct ilo_viewport_cso *viewports,
- unsigned num_viewports,
- struct ilo_cp *cp);
-
-typedef ilo_gpe_gen6_CC_VIEWPORT ilo_gpe_gen7_CC_VIEWPORT;
-typedef ilo_gpe_gen6_COLOR_CALC_STATE ilo_gpe_gen7_COLOR_CALC_STATE;
-typedef ilo_gpe_gen6_BLEND_STATE ilo_gpe_gen7_BLEND_STATE;
-typedef ilo_gpe_gen6_DEPTH_STENCIL_STATE ilo_gpe_gen7_DEPTH_STENCIL_STATE;
-typedef ilo_gpe_gen6_SCISSOR_RECT ilo_gpe_gen7_SCISSOR_RECT;
-typedef ilo_gpe_gen6_BINDING_TABLE_STATE ilo_gpe_gen7_BINDING_TABLE_STATE;
-typedef ilo_gpe_gen6_SURFACE_STATE ilo_gpe_gen7_SURFACE_STATE;
-typedef ilo_gpe_gen6_SAMPLER_STATE ilo_gpe_gen7_SAMPLER_STATE;
-typedef ilo_gpe_gen6_SAMPLER_BORDER_COLOR_STATE ilo_gpe_gen7_SAMPLER_BORDER_COLOR_STATE;
-typedef ilo_gpe_gen6_push_constant_buffer ilo_gpe_gen7_push_constant_buffer;
-
/**
* GEN7 graphics processing engine
*
@@ -402,89 +140,6 @@ struct ilo_gpe_gen7 {
int (*estimate_state_size)(const struct ilo_dev_info *dev,
enum ilo_gpe_gen7_state state,
int arg);
-
-#define GEN7_EMIT(name) ilo_gpe_gen7_ ## name emit_ ## name
- GEN7_EMIT(STATE_BASE_ADDRESS);
- GEN7_EMIT(STATE_SIP);
- GEN7_EMIT(3DSTATE_VF_STATISTICS);
- GEN7_EMIT(PIPELINE_SELECT);
- GEN7_EMIT(MEDIA_VFE_STATE);
- GEN7_EMIT(MEDIA_CURBE_LOAD);
- GEN7_EMIT(MEDIA_INTERFACE_DESCRIPTOR_LOAD);
- GEN7_EMIT(MEDIA_STATE_FLUSH);
- GEN7_EMIT(GPGPU_WALKER);
- GEN7_EMIT(3DSTATE_CLEAR_PARAMS);
- GEN7_EMIT(3DSTATE_DEPTH_BUFFER);
- GEN7_EMIT(3DSTATE_STENCIL_BUFFER);
- GEN7_EMIT(3DSTATE_HIER_DEPTH_BUFFER);
- GEN7_EMIT(3DSTATE_VERTEX_BUFFERS);
- GEN7_EMIT(3DSTATE_VERTEX_ELEMENTS);
- GEN7_EMIT(3DSTATE_INDEX_BUFFER);
- GEN7_EMIT(3DSTATE_CC_STATE_POINTERS);
- GEN7_EMIT(3DSTATE_SCISSOR_STATE_POINTERS);
- GEN7_EMIT(3DSTATE_VS);
- GEN7_EMIT(3DSTATE_GS);
- GEN7_EMIT(3DSTATE_CLIP);
- GEN7_EMIT(3DSTATE_SF);
- GEN7_EMIT(3DSTATE_WM);
- GEN7_EMIT(3DSTATE_CONSTANT_VS);
- GEN7_EMIT(3DSTATE_CONSTANT_GS);
- GEN7_EMIT(3DSTATE_CONSTANT_PS);
- GEN7_EMIT(3DSTATE_SAMPLE_MASK);
- GEN7_EMIT(3DSTATE_CONSTANT_HS);
- GEN7_EMIT(3DSTATE_CONSTANT_DS);
- GEN7_EMIT(3DSTATE_HS);
- GEN7_EMIT(3DSTATE_TE);
- GEN7_EMIT(3DSTATE_DS);
- GEN7_EMIT(3DSTATE_STREAMOUT);
- GEN7_EMIT(3DSTATE_SBE);
- GEN7_EMIT(3DSTATE_PS);
- GEN7_EMIT(3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP);
- GEN7_EMIT(3DSTATE_VIEWPORT_STATE_POINTERS_CC);
- GEN7_EMIT(3DSTATE_BLEND_STATE_POINTERS);
- GEN7_EMIT(3DSTATE_DEPTH_STENCIL_STATE_POINTERS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_VS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_HS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_DS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_GS);
- GEN7_EMIT(3DSTATE_BINDING_TABLE_POINTERS_PS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_VS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_HS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_DS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_GS);
- GEN7_EMIT(3DSTATE_SAMPLER_STATE_POINTERS_PS);
- GEN7_EMIT(3DSTATE_URB_VS);
- GEN7_EMIT(3DSTATE_URB_HS);
- GEN7_EMIT(3DSTATE_URB_DS);
- GEN7_EMIT(3DSTATE_URB_GS);
- GEN7_EMIT(3DSTATE_DRAWING_RECTANGLE);
- GEN7_EMIT(3DSTATE_POLY_STIPPLE_OFFSET);
- GEN7_EMIT(3DSTATE_POLY_STIPPLE_PATTERN);
- GEN7_EMIT(3DSTATE_LINE_STIPPLE);
- GEN7_EMIT(3DSTATE_AA_LINE_PARAMETERS);
- GEN7_EMIT(3DSTATE_MULTISAMPLE);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_VS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_HS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_DS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_GS);
- GEN7_EMIT(3DSTATE_PUSH_CONSTANT_ALLOC_PS);
- GEN7_EMIT(3DSTATE_SO_DECL_LIST);
- GEN7_EMIT(3DSTATE_SO_BUFFER);
- GEN7_EMIT(PIPE_CONTROL);
- GEN7_EMIT(3DPRIMITIVE);
- GEN7_EMIT(INTERFACE_DESCRIPTOR_DATA);
- GEN7_EMIT(SF_CLIP_VIEWPORT);
- GEN7_EMIT(CC_VIEWPORT);
- GEN7_EMIT(COLOR_CALC_STATE);
- GEN7_EMIT(BLEND_STATE);
- GEN7_EMIT(DEPTH_STENCIL_STATE);
- GEN7_EMIT(SCISSOR_RECT);
- GEN7_EMIT(BINDING_TABLE_STATE);
- GEN7_EMIT(SURFACE_STATE);
- GEN7_EMIT(SAMPLER_STATE);
- GEN7_EMIT(SAMPLER_BORDER_COLOR_STATE);
- GEN7_EMIT(push_constant_buffer);
-#undef GEN7_EMIT
};
const struct ilo_gpe_gen7 *