From: Kenneth Graunke Date: Tue, 9 Jan 2018 19:51:34 +0000 (-0800) Subject: iris: scissors X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=970836c34e242d47b91206ce52b0179cf0db70b5;p=mesa.git iris: scissors --- diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index 8cd1fc7623f..95353c8cea9 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -46,6 +46,7 @@ enum iris_dirty { IRIS_DIRTY_BLEND_STATE = (1ull << 7), IRIS_DIRTY_RASTER = (1ull << 8), IRIS_DIRTY_CLIP = (1ull << 9), + IRIS_DIRTY_SCISSOR = (1ull << 10), }; struct iris_depth_stencil_alpha_state; @@ -57,6 +58,7 @@ struct iris_context { struct { uint64_t dirty; + unsigned num_scissors; struct iris_blend_state *cso_blend; struct iris_rasterizer_state *cso_rast; struct iris_depth_stencil_alpha_state *cso_zsa; diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index f7e308e6eff..a3540a2a6df 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -742,6 +742,8 @@ iris_set_scissor_states(struct pipe_context *ctx, { struct iris_context *ice = (struct iris_context *) ctx; + ice->state.num_scissors = num_scissors; + for (unsigned i = start_slot; i < start_slot + num_scissors; i++) { ice->state.scissors[i] = *state; } @@ -1117,6 +1119,17 @@ iris_upload_render_state(struct iris_context *ice, struct iris_batch *batch) iris_batch_emit(batch, cso->sf, sizeof(cso->sf)); } + if (dirty & IRIS_DIRTY_SCISSOR) { + uint32_t scissor_offset = + iris_emit_state(batch, ice->state.scissors, + sizeof(struct pipe_scissor_state) * + ice->state.num_scissors, 32); + + iris_emit_cmd(batch, GENX(3DSTATE_SCISSOR_STATE_POINTERS), ptr) { + ptr.ScissorRectPointer = scissor_offset; + } + } + #if 0 l3 configuration @@ -1124,9 +1137,6 @@ iris_upload_render_state(struct iris_context *ice, struct iris_batch *batch) -> pipe_viewport_state for matrix elements, guardband is calculated from those. can calculate screen space from matrix apparently... - 3DSTATE_SCISSOR_STATE_POINTERS - SCISSOR_RECT - -> from ice->state.scissors - 3DSTATE_PUSH_CONSTANT_ALLOC_* 3DSTATE_URB_* -> TODO