[Mesa-dev] [PATCH 05/31] mesa: remove update_framebuffer_size

Timothy Arceri tarceri at itsqueeze.com
Tue Jun 13 01:46:19 UTC 2017


On 13/06/17 02:55, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> For the default framebuffer, _mesa_resize_framebuffer updates it.
> For FBOs, _mesa_test_framebuffer_completeness updates it.
> 
> This code is redundant.

Everything in the series besides this patch is:

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

You might want to wait for comment from the Intel devs on the first few 
patches that touch i965 before pushing.

As for this patch, its causing the below tests to fail on the intel drivers:

Project: piglit-test
Test: piglit.spec.ext_texture_compression_rgtc.fbo-generatemipmap-formats
Status: fail
Platform/arch:
	skl/m64, ivb/m64, ilk/m64, g965/m64, snb/m64, bxt/m64, bsw/m64, 
byt/m64, g45/m64, hsw/m64, bdwgt3e/m64
Command line: 
/tmp/build_root/m64/lib/piglit/bin/fbo-generatemipmap-formats 
GL_EXT_texture_compression_rgtc -auto -fbo

Project: piglit-test
Test: 
piglit.spec.arb_texture_compression_bptc.fbo-generatemipmap-formats unorm
Status: fail
Platform/arch:
	skl/m64, ivb/m64, bxt/m64, bsw/m64, byt/m64, hsw/m64, bdwgt3e/m64
Command line: 
/tmp/build_root/m64/lib/piglit/bin/fbo-generatemipmap-formats 
GL_ARB_texture_compression_bptc-unorm -auto -fbo

Project: piglit-test
Test: piglit.spec.3dfx_texture_compression_fxt1.fbo-generatemipmap-formats
Status: fail
Platform/arch:
	skl/m64, ivb/m64, ilk/m64, g965/m64, snb/m64, bxt/m64, bsw/m64, 
byt/m64, g45/m64, hsw/m64, bdwgt3e/m64
Command line: 
/tmp/build_root/m64/lib/piglit/bin/fbo-generatemipmap-formats 
GL_3DFX_texture_compression_FXT1 -auto -fbo

Project: piglit-test
Test: piglit.spec.ext_texture_compression_s3tc.fbo-generatemipmap-formats
Status: fail
Platform/arch:
	skl/m64, ivb/m64, ilk/m64, g965/m64, snb/m64, bxt/m64, bsw/m64, 
byt/m64, g45/m64, hsw/m64, bdwgt3e/m64
Command line: 
/tmp/build_root/m64/lib/piglit/bin/fbo-generatemipmap-formats 
GL_EXT_texture_compression_s3tc -auto -fbo

Project: piglit-test
Test: piglit.spec.ext_texture_srgb.fbo-generatemipmap-formats-s3tc
Status: fail
Platform/arch:
	skl/m64, ivb/m64, ilk/m64, g965/m64, snb/m64, bxt/m64, bsw/m64, 
byt/m64, g45/m64, hsw/m64, bdwgt3e/m64
Command line: 
/tmp/build_root/m64/lib/piglit/bin/fbo-generatemipmap-formats 
GL_EXT_texture_sRGB-s3tc -auto -fbo

Project: piglit-test
Test: 
piglit.spec.arb_texture_compression_bptc.fbo-generatemipmap-formats float
Status: fail
Platform/arch:
	skl/m64, ivb/m64, bxt/m64, bsw/m64, byt/m64, hsw/m64, bdwgt3e/m64
Command line: 
/tmp/build_root/m64/lib/piglit/bin/fbo-generatemipmap-formats 
GL_ARB_texture_compression_bptc-float -auto -fbo

Project: piglit-test
Test: piglit.spec.arb_texture_compression.fbo-generatemipmap-formats
Status: fail
Platform/arch:
	skl/m64, ivb/m64, ilk/m64, g965/m64, snb/m64, bxt/m64, bsw/m64, 
byt/m64, g45/m64, hsw/m64, bdwgt3e/m64
Command line: 
/tmp/build_root/m64/lib/piglit/bin/fbo-generatemipmap-formats 
GL_ARB_texture_compression -auto -fbo



> ---
>   src/mesa/main/framebuffer.c | 44 +-------------------------------------------
>   1 file changed, 1 insertion(+), 43 deletions(-)
> 
> diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
> index c4eecf6..039762a 100644
> --- a/src/mesa/main/framebuffer.c
> +++ b/src/mesa/main/framebuffer.c
> @@ -314,57 +314,20 @@ _mesa_resize_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
>         /* update scissor / window bounds */
>         _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
>         /* Signal new buffer state so that swrast will update its clipping
>          * info (the CLIP_BIT flag).
>          */
>         ctx->NewState |= _NEW_BUFFERS;
>      }
>   }
>   
>   /**
> - * Examine all the framebuffer's renderbuffers to update the Width/Height
> - * fields of the framebuffer.  If we have renderbuffers with different
> - * sizes, set the framebuffer's width and height to the min size.
> - * Note: this is only intended for user-created framebuffers, not
> - * window-system framebuffes.
> - */
> -static void
> -update_framebuffer_size(struct gl_context *ctx, struct gl_framebuffer *fb)
> -{
> -   GLuint minWidth = ~0, minHeight = ~0;
> -   GLuint i;
> -
> -   /* user-created framebuffers only */
> -   assert(_mesa_is_user_fbo(fb));
> -
> -   for (i = 0; i < BUFFER_COUNT; i++) {
> -      struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
> -      const struct gl_renderbuffer *rb = att->Renderbuffer;
> -      if (rb) {
> -         minWidth = MIN2(minWidth, rb->Width);
> -         minHeight = MIN2(minHeight, rb->Height);
> -      }
> -   }
> -
> -   if (minWidth != ~0U) {
> -      fb->Width = minWidth;
> -      fb->Height = minHeight;
> -   }
> -   else {
> -      fb->Width = 0;
> -      fb->Height = 0;
> -   }
> -}
> -
> -
> -
> -/**
>    * Given a bounding box, intersect the bounding box with the scissor of
>    * a specified vieport.
>    *
>    * \param ctx     GL context.
>    * \param idx     Index of the desired viewport
>    * \param bbox    Bounding box for the scissored viewport.  Stored as xmin,
>    *                xmax, ymin, ymax.
>    */
>   void
>   _mesa_intersect_scissor_bounding_box(const struct gl_context *ctx,
> @@ -396,21 +359,21 @@ _mesa_intersect_scissor_bounding_box(const struct gl_context *ctx,
>   /**
>    * Calculate the inclusive bounding box for the scissor of a specific viewport
>    *
>    * \param ctx     GL context.
>    * \param buffer  Framebuffer to be checked against
>    * \param idx     Index of the desired viewport
>    * \param bbox    Bounding box for the scissored viewport.  Stored as xmin,
>    *                xmax, ymin, ymax.
>    *
>    * \warning This function assumes that the framebuffer dimensions are up to
> - * date (e.g., update_framebuffer_size has been recently called on \c buffer).
> + * date.
>    *
>    * \sa _mesa_clip_to_region
>    */
>   static void
>   scissor_bounding_box(const struct gl_context *ctx,
>                        const struct gl_framebuffer *buffer,
>                        unsigned idx, int *bbox)
>   {
>      bbox[0] = 0;
>      bbox[2] = 0;
> @@ -431,25 +394,20 @@ scissor_bounding_box(const struct gl_context *ctx,
>    */
>   void
>   _mesa_update_draw_buffer_bounds(struct gl_context *ctx,
>                                   struct gl_framebuffer *buffer)
>   {
>      int bbox[4];
>   
>      if (!buffer)
>         return;
>   
> -   if (_mesa_is_user_fbo(buffer)) {
> -      /* user-created framebuffer size depends on the renderbuffers */
> -      update_framebuffer_size(ctx, buffer);
> -   }
> -
>      /* Default to the first scissor as that's always valid */
>      scissor_bounding_box(ctx, buffer, 0, bbox);
>      buffer->_Xmin = bbox[0];
>      buffer->_Ymin = bbox[2];
>      buffer->_Xmax = bbox[1];
>      buffer->_Ymax = bbox[3];
>   }
>   
>   
>   /**
> 


More information about the mesa-dev mailing list