gallium: nir_opt_access desynchronizes image access modifiers in NIR with Program->sh.ImageAccess
I've tried to add inference of ACCESS_NON_READABLE
to nir_opt_access
(see https://gitlab.freedesktop.org/GL/mesa/-/commits/fix/3138-opt-write-only-access/), however some GL tests started to fail (e.g. arb_shader_image_load_store-qualifiers
) on Iris. (Why am I doing this opt? It would fix #3138 (closed) and may save some ops on Intel).
I found out that update_uniforms_shader_info
updates access modifiers based on glsl, and when the modifiers are changed in NIR - Program->sh.ImageAccess
becomes obsolete. While wrong, this doesn't cause issues in non-writable case, however for non-readable case in Iris:
- We don't emit additional NIR code for color conversion (this is based on modifiers in NIR);
- Based on obsolete
Program->sh.ImageAccess
we MAY change image format, cause it is counted as readable;
The above causes wrong values to be written to the image.
I'm not sure how to deal with this and would like to get some advice.
@cwabbott0 - Maybe you had thoughts about Program->sh.ImageAccess
when added nir_opt_access ?
@tarceri - Could you offer some thoughts?