[Mesa-dev] [RFC] gallium: add interface for writable shader images

Jose Fonseca jfonseca at vmware.com
Mon Jul 13 07:24:04 PDT 2015


On 09/07/15 22:05, Marek Olšák wrote:
> I'd like to discuss one more thing that will affect whether image
> slots will be global (shared by all shaders) or not.
>
> Which image unit an image uniform uses is not a compile-time thing,
> but it's specified later using glUniform1i. That means we need a
> per-shader table that maps image uniforms to global image units. One
> possible solution is to add this pipe_context function:
>
> void (*set_shader_image_mapping)(
>     struct pipe_context *, unsigned shader,
>     unsigned start_decl_index, unsigned count,
>     unsigned *decl_to_slot_mapping);
>
> This is only required if the shader image slots are global and not
> per-shader. (if they are per-shader, st/mesa can reorder the slots for
> each shader independently just like it already does for textures and
> UBOs) Shader storage buffer objects suffer from the same issue. Atomic
> counters don't.
>
> Therefore, image slots must be per-shader (like sampler slots) to
> avoid this craziness and keep things simple.

Sounds OK to me too.

D3D11's UAV binding points are global, but that can be easily 
accomodated by binding the same UAVs array on all stages.

Jose




More information about the mesa-dev mailing list