This helps avoid having to iterate over [0, PIPE_MAX_CONSTANT_BUFFERS)
looking to see if any resources are bound.
struct iris_sampler_state *samplers[IRIS_MAX_TEXTURE_SAMPLERS];
struct iris_sampler_view *textures[IRIS_MAX_TEXTURE_SAMPLERS];
+ /** Bitfield of which constant buffers are bound (non-null). */
+ uint32_t bound_cbufs;
+
/** Bitfield of which image views are bound (non-null). */
uint32_t bound_image_views;
struct iris_const_buffer *cbuf = &shs->constbuf[index];
if (input && input->buffer) {
+ shs->bound_cbufs |= 1u << index;
+
assert(index > 0);
pipe_resource_reference(&cbuf->data.res, input->buffer);
upload_ubo_surf_state(ice, cbuf, input->buffer_size);
} else {
+ shs->bound_cbufs &= ~(1u << index);
pipe_resource_reference(&cbuf->data.res, NULL);
pipe_resource_reference(&cbuf->surface_state.res, NULL);
}