void iris_predraw_resolve_inputs(struct iris_context *ice,
struct iris_batch *batch,
- struct iris_shader_state *shs,
bool *draw_aux_buffer_disabled,
+ gl_shader_stage stage,
bool consider_framebuffer);
void iris_predraw_resolve_framebuffer(struct iris_context *ice,
struct iris_batch *batch,
bool draw_aux_buffer_disabled[BRW_MAX_DRAW_BUFFERS] = { };
for (gl_shader_stage stage = 0; stage < MESA_SHADER_COMPUTE; stage++) {
- if (ice->shaders.prog[stage])
- iris_predraw_resolve_inputs(ice,batch, &ice->state.shaders[stage],
- draw_aux_buffer_disabled, true);
+ if (ice->shaders.prog[stage]) {
+ iris_predraw_resolve_inputs(ice, batch, draw_aux_buffer_disabled,
+ stage, true);
+ }
}
iris_predraw_resolve_framebuffer(ice, batch, draw_aux_buffer_disabled);
/* We can't do resolves on the compute engine, so awkwardly, we have to
* do them on the render batch...
*/
- iris_predraw_resolve_inputs(ice, &ice->batches[IRIS_BATCH_RENDER],
- &ice->state.shaders[MESA_SHADER_COMPUTE],
- NULL, false);
+ iris_predraw_resolve_inputs(ice, &ice->batches[IRIS_BATCH_RENDER], NULL,
+ MESA_SHADER_COMPUTE, false);
iris_batch_maybe_flush(batch, 1500);
void
iris_predraw_resolve_inputs(struct iris_context *ice,
struct iris_batch *batch,
- struct iris_shader_state *shs,
bool *draw_aux_buffer_disabled,
+ gl_shader_stage stage,
bool consider_framebuffer)
{
- resolve_sampler_views(ice, batch, shs, draw_aux_buffer_disabled, consider_framebuffer);
- resolve_image_views(ice, batch, shs, draw_aux_buffer_disabled, consider_framebuffer);
+ struct iris_shader_state *shs = &ice->state.shaders[stage];
+
+ uint64_t dirty = (IRIS_DIRTY_BINDINGS_VS << stage) |
+ (consider_framebuffer ? IRIS_DIRTY_BINDINGS_FS : 0);
+
+ if (ice->state.dirty & dirty) {
+ resolve_sampler_views(ice, batch, shs, draw_aux_buffer_disabled,
+ consider_framebuffer);
+ resolve_image_views(ice, batch, shs, draw_aux_buffer_disabled,
+ consider_framebuffer);
+ }
// XXX: ASTC hacks
}