iris: scissors

This commit is contained in:
Kenneth Graunke 2018-01-09 11:51:34 -08:00
parent 7c875deaf0
commit 970836c34e
2 changed files with 15 additions and 3 deletions

View file

@ -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;

View file

@ -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