[Mesa-dev] [PATCH 08/12] intel: Track miptrees for fake packed depth/stencil renderbuffers.

Chad Versace chad.versace at linux.intel.com
Tue Dec 6 10:43:15 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/05/2011 11:42 AM, Eric Anholt wrote:
> Right now the fake packed d/s RBs are creating two sub-renderbuffers
> with their own storage, and the hardware setup and the mapping code
> have been explicitly referencing them.  By setting miptrees on them,
> we'll be able to make our renderbuffer code for fake packed
> depth/stencil more consistent with all our other renderbuffers.
> 
> The interesting new behavior here is that there is now a mt with a
> non-depthstencil format (X8Z24) that has a stencil_mt field
> associated.  This looks like it should be safe, and we'll need to be
> able to do this for floating point depth/stencil as well.
> ---
>  src/mesa/drivers/dri/intel/intel_fbo.c         |   10 ++++++++++
>  src/mesa/drivers/dri/intel/intel_mipmap_tree.c |    5 +++--
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 


> @@ -614,6 +615,12 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
>  	 return false;
>        }
>  
> +      depth_irb = intel_renderbuffer(depth_rb);
> +      stencil_irb = intel_renderbuffer(stencil_rb);
> +
> +      intel_miptree_reference(&depth_irb->mt->stencil_mt, stencil_irb->mt);
> +      intel_miptree_reference(&irb->mt, depth_irb->mt);
> +

I like the symmetry imposed by this hunk.

> --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> @@ -808,8 +808,9 @@ intel_miptree_map_depthstencil(struct intel_context *intel,
>  	    ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
>  						 x + s_image_x + map->x,
>  						 y + s_image_y + map->y);
> -	    ptrdiff_t z_offset = ((y + z_image_y) * z_mt->region->pitch +
> -				  (x + z_image_x));
> +	    ptrdiff_t z_offset = (((y + map->y + z_image_y) *
> +				   z_mt->region->pitch) +
> +				  (x + map->x + z_image_x));
>  	    uint8_t s = s_map[s_offset];
>  	    uint32_t z = z_map[z_offset];

I think you intended to squash this hunk into the previous patch. But the hunk is
unnecessary anyway, because it just adds redundant parens.

With this hunk removed, the patch is
Reviewed-by:  Chad Versace <chad.versace at linux.intel.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJO3mJCAAoJEAIvNt057x8iYSMQAILU8eLY4CwJs7fNnx5Axitf
IT139qdf/HYfQo/Nkm/0i+OOmknCIYSDe7L6+6TqbktVWq0DLtNwvl/How+yKld+
EstdLb+xMdkbn2/eLJUvscrXYcOYAyl2fMq+G//UQBt1h8WLAF6e6oLye8Mm0Wjd
IFmYnSF761XVJ/mB7Jvy9rvIp41ZAkcNrOyFx4j+T/XaCyLh6TKWK72b9CJoXdZs
BxE62TBJ+a63/Zd/Tt8zGT1/sOD1uaV8xv3KlZkdN0ECQqQnzGtZMONCf84LS7+w
UTGwPCXZ2pNJRJ3mQeEY3K+3018/Hj4sxoMoHafhoPksz+q5Rx/Xa8Kig1Fls6WI
3fJ/z1QGapstrx40553O1R4xQKFXhMVv+0J6FU1I84mLwofo/z1/yku1sMpy4eGn
t4v42OqXrquq9J+r0bG3mmIFKCi4B90mKKW11FaebjUzSuDK15PiAUciAWNM13yR
BG98ib//arme4YF3YXL58JQoyI3vXF4rWTmARVgsehhr/6VkrE8JxxaH/KXY4kVa
QFx3kreSFrENsN0So/Ed1E69T/4lAU3kQCFTaCfLyu1pHU+OprEP0GzgvNHl3xx/
M60iT9ACfAoINb7ufiYn6jXwxLZHDU7MRzVBDv+9jA6Erv9zkcPr1/jvpUi5aQtz
lGSzVKHGvNp+IgIHlaqy
=Rwfa
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list