From 59de5d9b6ab32e4eb2450732d5cc72e9b16be098 Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Tue, 19 Nov 2019 15:00:06 -0800 Subject: [PATCH] iris: Implement WA for push constants. v2: Apply WA to gen11+ instead of gen12+ (Jordan). Reviewed-by: Jordan Justen --- src/gallium/drivers/iris/iris_state.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 10c1bc4b7c3..c4b7393419a 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -5412,12 +5412,23 @@ iris_upload_dirty_render_state(struct iris_context *ice, } } + /* GEN:BUG:1604061319 + * + * 3DSTATE_CONSTANT_* needs to be programmed before BTP_* + * + * Testing shows that all the 3DSTATE_CONSTANT_XS need to be emitted if + * any stage has a dirty binding table. + */ + const bool emit_const_wa = GEN_GEN >= 11 && + (dirty & IRIS_ALL_DIRTY_BINDINGS) != 0; + #if GEN_GEN >= 12 uint32_t nobuffer_stages = 0; #endif for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) { - if (!(dirty & (IRIS_DIRTY_CONSTANTS_VS << stage))) + if (!(dirty & (IRIS_DIRTY_CONSTANTS_VS << stage)) && + !emit_const_wa) continue; struct iris_shader_state *shs = &ice->state.shaders[stage]; -- 2.30.2