From 369cd9ae2803e2f40a2ebf1b94918436eb779f6e Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 19 Oct 2021 05:31:55 -0700 Subject: [PATCH] iris: Set MOCS on 3DSTATE_CONSTANT_ALL packets that disable all buffers We'd like to add safeguards against accidental use of MOCS 0 (uncached), which can have large performance implications. One case where we missed setting a non-zero MOCS was in 3DSTATE_CONSTANT_ALL packets which fully disable all constant buffers. (If any constant buffer was present, we would set an actual MOCS value.) MOCS really shouldn't matter here, as there are no actual constant buffers to be cached. That said, it should be harmless to do so, and we can just assume a generic MOCS for internal buffers. Reviewed-by: Jason Ekstrand Part-of: --- src/gallium/drivers/iris/iris_state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 841365d4bec..7515452049e 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -5550,6 +5550,7 @@ emit_push_constant_packet_all(struct iris_context *ice, if (!push_bos) { iris_emit_cmd(batch, GENX(3DSTATE_CONSTANT_ALL), pc) { pc.ShaderUpdateEnable = shader_mask; + pc.MOCS = iris_mocs(NULL, isl_dev, 0); } return; }