iris: actually flush for storage images

This commit is contained in:
Kenneth Graunke 2018-11-25 19:03:43 -08:00
parent 69e97670bc
commit 0ded23a552
3 changed files with 21 additions and 0 deletions

View file

@ -282,6 +282,7 @@ struct iris_shader_state {
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;
};

View file

@ -51,6 +51,21 @@ resolve_sampler_views(struct iris_batch *batch,
}
}
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.
*
@ -64,6 +79,7 @@ iris_predraw_resolve_inputs(struct iris_context *ice,
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

View file

@ -1371,6 +1371,8 @@ iris_bind_sampler_states(struct pipe_context *ctx,
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.
@ -1666,6 +1668,8 @@ iris_set_shader_images(struct pipe_context *ctx,
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];