resolve_sampler_views(struct iris_batch *batch,
struct iris_shader_state *shs)
{
- for (int i = 0; i < shs->num_textures; i++) {
- struct iris_sampler_view *isv = shs->textures[i];
- if (!isv)
- continue;
+ uint32_t views = shs->bound_sampler_views;
+ while (views) {
+ const int i = u_bit_scan(&views);
+ struct iris_sampler_view *isv = shs->textures[i];
struct iris_resource *res = (void *) isv->base.texture;
// XXX: aux tracking
resolve_image_views(struct iris_batch *batch,
struct iris_shader_state *shs)
{
- for (int i = 0; i < shs->num_images; i++) {
+ uint32_t views = shs->bound_image_views;
+
+ while (views) {
+ const int i = u_bit_scan(&views);
struct pipe_resource *res = shs->image[i].res;
- if (!res)
- continue;
// XXX: aux tracking
iris_cache_flush_for_read(batch, iris_resource_bo(res));
* enabled depth texture, and flush the render cache for any dirty textures.
*/
void
-iris_predraw_resolve_inputs(struct iris_context *ice,
- struct iris_batch *batch)
+iris_predraw_resolve_inputs(struct iris_batch *batch,
+ struct iris_shader_state *shs)
{
- for (gl_shader_stage stage = 0; stage < MESA_SHADER_STAGES; stage++) {
- struct iris_shader_state *shs = &ice->state.shaders[stage];
- resolve_sampler_views(batch, shs);
- resolve_image_views(batch, shs);
- }
-
- // XXX: storage images
+ resolve_sampler_views(batch, shs);
+ resolve_image_views(batch, shs);
}
void