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 <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13480>
This commit is contained in:
Kenneth Graunke 2021-10-19 05:31:55 -07:00 committed by Marge Bot
parent 0544afd2df
commit 369cd9ae28

View file

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