[Mesa-dev] [PATCH] intel: Fix render-to-texture in non-FinishRenderTexture cases.

Kenneth Graunke kenneth at whitecape.org
Wed May 8 10:19:35 PDT 2013


On 05/07/2013 04:46 PM, Ian Romanick wrote:
> On 05/07/2013 03:53 PM, Eric Anholt wrote:
>> With EGL_KHR_gl_renderbuffer_iamge, we have the ability to render to
>                                 ^^^^^
> image
>
>> renderbuffers that are also textures, so the core Mesa
>> FinishRenderTexture
>> hook doesn't get called.  That hook also wasn't called in various cases
>> within the driver where we'd update texture contents using the render
>> cache (like glCopyTexSubImage) that resulted in
>> intel_batchbuffer_emit_mi_flush().
>>
>> To fix it, track a set of rendered-to BOs in our context, which is
>> cleared at batch wrap or emit_mi_flush time, and do an emit_mi_flush if
>> one of our textures is in that set.
>
> That sounds like an optimal (if complex) solution for the EGLimage. When
> Ken described the bug to me, I was envisioning a simpler fix:  if a
> renderbuffer is attached to an EGLimage, use FinishRenderTexture.  Out
> of curiosity, do you think that would have also worked?  It seems like
> that would be cheaper in the non-EGLimage case, though it doesn't sound
> like it matters.

Another problem is that FinishRenderTexture() on most drivers assumes 
that the attachment parameter contains a texture object...which, given 
the name, seems fairly reasonable.  i965 doesn't since it unilaterally 
flushes the texture cache, so it would work out, but we'd have to be 
careful to avoid breaking everyone else.


More information about the mesa-dev mailing list