struct iris_state_ref sampler_table;
struct iris_sampler_state *samplers[IRIS_MAX_TEXTURE_SAMPLERS];
struct iris_sampler_view *textures[IRIS_MAX_TEXTURE_SAMPLERS];
+ unsigned num_images;
unsigned num_samplers;
unsigned num_textures;
};
}
}
+static void
+resolve_image_views(struct iris_batch *batch,
+ struct iris_shader_state *shs)
+{
+ for (int i = 0; i < shs->num_images; i++) {
+ struct pipe_resource *res = shs->image[i].res;
+ if (!res)
+ continue;
+
+ // XXX: aux tracking
+ iris_cache_flush_for_read(batch, iris_resource_bo(res));
+ }
+}
+
+
/**
* \brief Resolve buffers before drawing.
*
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
shs->samplers[start + i] = states[i];
}
+ // XXX: count may include NULLs
+
/* Assemble the SAMPLER_STATEs into a contiguous table that lives
* in the dynamic state memory zone, so we can point to it via the
* 3DSTATE_SAMPLER_STATE_POINTERS_* commands.
gl_shader_stage stage = stage_from_pipe(p_stage);
struct iris_shader_state *shs = &ice->state.shaders[stage];
+ shs->num_images = MAX2(shs->num_images, start_slot + count);
+
for (unsigned i = 0; i < count; i++) {
if (p_images && p_images[i].resource) {
const struct pipe_image_view *img = &p_images[i];