summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-01-30 01:50:44 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:05 -0800
commitbda9a77b47cd2d1ce6bef3bb31511430362fb8b0 (patch)
tree0a99eb2bf6ef99cd7469ccc85a0a14cf1eb6ddc5 /src
parentf9d834d588c6750e720fd8460fe37506072e4d6a (diff)
iris: smaller blend state
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_state.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index f374d077d5e..5f9573dd8dd 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -1163,6 +1163,10 @@ iris_set_framebuffer_state(struct pipe_context *ctx,
ice->state.dirty |= IRIS_DIRTY_MULTISAMPLE;
}
+ if (cso->nr_cbufs != state->nr_cbufs) {
+ ice->state.dirty |= IRIS_DIRTY_BLEND_STATE;
+ }
+
cso->width = state->width;
cso->height = state->height;
cso->layers = state->layers;
@@ -1842,14 +1846,13 @@ iris_upload_render_state(struct iris_context *ice,
if (dirty & IRIS_DIRTY_BLEND_STATE) {
struct iris_blend_state *cso_blend = ice->state.cso_blend;
+ struct pipe_framebuffer_state *cso_fb = &ice->state.framebuffer;
struct iris_depth_stencil_alpha_state *cso_zsa = ice->state.cso_zsa;
- // XXX: 3DSTATE_BLEND_STATE_POINTERS - BLEND_STATE
- // -> from iris_blend_state (most) + iris_depth_stencil_alpha_state
- // (alpha test function/enable) + has writeable RT from ???????
+ const int num_dwords = 4 * (GENX(BLEND_STATE_length) +
+ cso_fb->nr_cbufs * GENX(BLEND_STATE_ENTRY_length));
uint32_t blend_offset;
uint32_t *blend_map =
- iris_alloc_state(batch, sizeof(cso_blend->blend_state),
- 64, &blend_offset);
+ iris_alloc_state(batch, num_dwords, 64, &blend_offset);
uint32_t blend_state_header;
iris_pack_state(GENX(BLEND_STATE), &blend_state_header, bs) {