[Mesa-dev] [PATCH 0/2] mesa/gallium: add NV_texture_barrier

Keith Whitwell keithw at vmware.com
Fri Mar 11 05:56:45 PST 2011


On Fri, 2011-03-11 at 06:05 +0100, Marek Olšák wrote:
> Hi,
> 
> these 2 patches add GL_NV_texture_barrier to Mesa and Gallium,
> respectively. The extension can be used for programmable
> blending, where the same texture can be bound as both a sampler
> and renderbuffer. The same feature exists in Direct10 and
> the entry point is:
> 
> VOID APIENTRY ResourceReadAfterWriteHazard(
>   __in  D3D10DDI_HDEVICE hDevice,
>   __in  D3D10DDI_HRESOURCE hResource
> )
> 
> I have chosen the same name for Gallium:
> 
> void (*resource_read_after_write_hazard)(struct pipe_context *,
>                                          struct pipe_resource *)
> 
> The function is documented in the second patch.
> There is a new piglit test too, called blending-in-shader.
> I only have working r300g support, but I may add softpipe
> if needed.

I support this goal, but think you've probably chosen the wrong name for
the function.

The call you're introducing is a method for the application to cooperate
with the driver to get meaningful results when a single resource is
bound for read & write at the same time.

In DX10-land, ResourceReadAfterWriteHazard() is something generated
internally by the runtime when a resource which was previously bound to
write is being rebound to read from, ie. something like:

   if (ctx->is_resource_referenced(ctx, resource))
       ctx->flush(ctx);



More information about the mesa-dev mailing list