<div class="gmail_quote">On Fri, Mar 11, 2011 at 2:56 PM, Keith Whitwell <span dir="ltr"><<a href="mailto:keithw@vmware.com">keithw@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Fri, 2011-03-11 at 06:05 +0100, Marek Olšák wrote:<br>
> Hi,<br>
><br>
> these 2 patches add GL_NV_texture_barrier to Mesa and Gallium,<br>
> respectively. The extension can be used for programmable<br>
> blending, where the same texture can be bound as both a sampler<br>
> and renderbuffer. The same feature exists in Direct10 and<br>
> the entry point is:<br>
><br>
> VOID APIENTRY ResourceReadAfterWriteHazard(<br>
> __in D3D10DDI_HDEVICE hDevice,<br>
> __in D3D10DDI_HRESOURCE hResource<br>
> )<br>
><br>
> I have chosen the same name for Gallium:<br>
><br>
> void (*resource_read_after_write_hazard)(struct pipe_context *,<br>
> struct pipe_resource *)<br>
><br>
> The function is documented in the second patch.<br>
> There is a new piglit test too, called blending-in-shader.<br>
> I only have working r300g support, but I may add softpipe<br>
> if needed.<br>
<br>
</div>I support this goal, but think you've probably chosen the wrong name for<br>
the function.<br>
<br>
The call you're introducing is a method for the application to cooperate<br>
with the driver to get meaningful results when a single resource is<br>
bound for read & write at the same time.<br>
<br>
In DX10-land, ResourceReadAfterWriteHazard() is something generated<br>
internally by the runtime when a resource which was previously bound to<br>
write is being rebound to read from, ie. something like:<br>
<br>
if (ctx->is_resource_referenced(ctx, resource))<br>
ctx->flush(ctx);<br>
<br>