iris: Handle states=NULL in iris_bind_sampler_states

Clover likes to do this to clear our a bunch of samplers without
actually passing an array of NULL pointers.  It's easy enough to
handle in iris.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13072>
This commit is contained in:
Jason Ekstrand 2021-09-27 18:52:09 -05:00 committed by Marge Bot
parent 5a9f907d94
commit 5f8e043fb6

View file

@ -2081,8 +2081,9 @@ iris_bind_sampler_states(struct pipe_context *ctx,
bool dirty = false;
for (int i = 0; i < count; i++) {
if (shs->samplers[start + i] != states[i]) {
shs->samplers[start + i] = states[i];
struct iris_sampler_state *state = states ? states[i] : NULL;
if (shs->samplers[start + i] != state) {
shs->samplers[start + i] = state;
dirty = true;
}
}