[Mesa-dev,05/10] mesa: Stop skipping the FinishRenderTexture calls for winsys FBOs.

Submitted by Eric Anholt on March 4, 2014, 10:17 p.m.

Details

Message ID 1393971464-12892-6-git-send-email-eric@anholt.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Eric Anholt March 4, 2014, 10:17 p.m.
Now that BindRenderbufferTexImage() is a thing that drivers can do, winsys
FBOs *can* have NeedsFinishRenderTexture set.  The early exit here
predated the NFRT flag, so it did make sense at the time.
---
 src/mesa/main/fbobject.c | 3 ---
 1 file changed, 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index a9dcc51..12d6332 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2008,9 +2008,6 @@  check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
 static void
 check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
 {
-   if (_mesa_is_winsys_fbo(fb))
-      return; /* can't render to texture with winsys framebuffers */
-
    if (ctx->Driver.FinishRenderTexture) {
       GLuint i;
       for (i = 0; i < BUFFER_COUNT; i++) {

Comments

On 03/04/2014 02:17 PM, Eric Anholt wrote:
> Now that BindRenderbufferTexImage() is a thing that drivers can do, winsys
> FBOs *can* have NeedsFinishRenderTexture set.  The early exit here
> predated the NFRT flag, so it did make sense at the time.
> ---
>  src/mesa/main/fbobject.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index a9dcc51..12d6332 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2008,9 +2008,6 @@ check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
>  static void
>  check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
>  {
> -   if (_mesa_is_winsys_fbo(fb))
> -      return; /* can't render to texture with winsys framebuffers */
> -
>     if (ctx->Driver.FinishRenderTexture) {
>        GLuint i;
>        for (i = 0; i < BUFFER_COUNT; i++) {
> 

The asymmetry here strikes me as a little odd...now you can have
FinishRenderTexture called for renderbuffers, but RenderTexture still
retains the "no winsys fbos" check.  I guess that makes some sense,
since the driver is already handling BindRenderbufferTexImage, so
there's no need for a second "begin" hook.

This is all fairly theoretical though: i965 is the only driver that
exposes BindRenderbufferTexImage, and it no longer has RenderTexture or
FinishRenderTexture hooks.

So, you could actually drop this patch.  But I'm not thrilled about
that, since other drivers may implement BindRenderbufferTexImage, and
would almost certainly forget this.

Maybe instead change it to:
if (_mesa_is_winsys_fbo(fb) && !ctx->Driver.BindRenderbufferTexImage)

That avoids the overhead of the BUFFER_COUNT loop for existing drivers.

*shrug*