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...
This commit is contained in:
Kenneth Graunke 2018-11-03 06:44:48 -07:00
parent 317ba8796f
commit 84a419432d

View file

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