From 84a419432deffd47f166819e432a5f927f149263 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 3 Nov 2018 06:44:48 -0700 Subject: [PATCH] iris: Flag constants dirty on program changes 3DSTATE_CONSTANT_* looks at prog_data->ubo_ranges. We were getting saved by iris_set_constant_buffers() usually happening when changing programs (as they usually change uniforms too), but with the clear shader that doesn't use uniforms, we weren't getting one and were leaving push constants enabled, screwing things up. Also clean up a bit of a mess left by the hacks - we were missing bindings in the VS/FS/CS case, among other issues... --- src/gallium/drivers/iris/iris_program_cache.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/iris/iris_program_cache.c b/src/gallium/drivers/iris/iris_program_cache.c index 9fad14a2847..f5c6fc26794 100644 --- a/src/gallium/drivers/iris/iris_program_cache.c +++ b/src/gallium/drivers/iris/iris_program_cache.c @@ -106,20 +106,19 @@ dirty_flag_for_cache(enum iris_program_cache_id cache_id) { assert(cache_id <= MESA_SHADER_STAGES); + uint64_t flags = (IRIS_DIRTY_VS | + IRIS_DIRTY_BINDINGS_VS | + IRIS_DIRTY_CONSTANTS_VS) << cache_id; // XXX: ugly... // XXX: move this flagging out to a higher level, allow comparison of // XXX: new and old programs to decide what bits to twiddle // XXX: CLIP: toggle if barycentric modes has any NONPERSPECTIVE or not if (cache_id == IRIS_CACHE_FS) - return IRIS_DIRTY_WM | IRIS_DIRTY_FS | IRIS_DIRTY_CLIP | IRIS_DIRTY_SBE; + flags |= IRIS_DIRTY_WM | IRIS_DIRTY_CLIP | IRIS_DIRTY_SBE; if (cache_id == IRIS_CACHE_VS) - return IRIS_DIRTY_VS | IRIS_DIRTY_VF_SGVS; + flags |= IRIS_DIRTY_VF_SGVS; - /* For compute, prog_data->threads needs to be uploaded as constants. */ - if (cache_id == IRIS_CACHE_CS) - return IRIS_DIRTY_CS | IRIS_DIRTY_CONSTANTS_CS; - - return IRIS_DIRTY_VS << cache_id | IRIS_DIRTY_BINDINGS_VS << cache_id; + return flags; } static unsigned -- 2.30.2