[Mesa-dev] [PATCH] i965/blorp: Fix hiz ops on MSAA surfaces

Kenneth Graunke kenneth at whitecape.org
Tue Nov 18 00:56:02 PST 2014


On Tuesday, November 18, 2014 09:49:53 PM Chris Forbes wrote:
> Two things were broken here:
> - The depth/stencil surface dimensions were broken for MSAA.
> - Sample count was programmed incorrectly.
> 
> Result was the depth resolve didn't work correctly on MSAA surfaces, and
> so sampling the surface later produced garbage.
> 
> Fixes the new piglit test arb_texture_multisample-sample-depth, and
> various artifacts in 'tesseract' with msaa=4 glineardepth=0.
> 
> Not observed any piglit regressions on Haswell.
> 
> v2: Just set brw_hiz_op_params::dst.num_samples rather than adding a
>     helper function (Ken).
> 
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  src/mesa/drivers/dri/i965/brw_blorp.cpp  |  1 +
>  src/mesa/drivers/dri/i965/gen7_blorp.cpp | 11 +++++++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp 
b/src/mesa/drivers/dri/i965/brw_blorp.cpp
> index 20ce7b7..0ecf330 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp
> @@ -323,6 +323,7 @@ brw_hiz_op_params::brw_hiz_op_params(struct 
intel_mipmap_tree *mt,
>      */
>     depth.width = ALIGN(depth.width, 8);
>     depth.height = ALIGN(depth.height, 4);
> +   dst.num_samples = mt->num_samples;
>  
>     x1 = depth.width;
>     y1 = depth.height;
> diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp 
b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
> index 206a6ff..03fc9c8 100644
> --- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
> +++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
> @@ -663,6 +663,17 @@ gen7_blorp_emit_depth_stencil_config(struct brw_context 
*brw,
>         */
>        surfwidth = params->depth.width;
>        surfheight = params->depth.height;
> +
> +      if (params->dst.num_samples > 1) {
> +         /* If this is an MSAA + HIZ op, we need to program the
> +          * aligned logical size of the depth surface.
> +          */
> +         surfwidth = ALIGN(params->depth.mt->logical_width0, 8);
> +         surfheight = ALIGN(params->depth.mt->logical_height0, 4);
> +      } else {
> +         surfwidth = params->depth.width;
> +         surfheight = params->depth.height;
> +      }
>     } else {
>        surfwidth = params->depth.mt->logical_width0;
>        surfheight = params->depth.mt->logical_height0;
> 

Jordan, Chad...could one of you take a look at this?  It looks reasonable, but 
I always get confused by when/where we do rounding in BLORP.

Chris - we might want to Cc this to stable too.

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141118/a62a9382/attachment.sig>


More information about the mesa-dev mailing list