[Mesa-dev] [PATCH 08/12] intel: Track miptrees for fake packed depth/stencil renderbuffers.
Eric Anholt
eric at anholt.net
Tue Dec 6 14:43:12 PST 2011
On Tue, 06 Dec 2011 10:43:15 -0800, Chad Versace <chad.versace at linux.intel.com> wrote:
> On 12/05/2011 11:42 AM, Eric Anholt wrote:
> > --- 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.
The addition of map->x/y isn't redundant. How about folding this hunk
into HEAD~1 instead:
@@ -805,12 +805,12 @@ intel_miptree_map_depthstencil(struct intel_context *intel
for (uint32_t y = 0; y < map->h; y++) {
for (uint32_t x = 0; x < map->w; x++) {
+ int map_x = map->x + x, map_y = map->y + y;
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 + map->y + z_image_y) *
- z_mt->region->pitch) +
- (x + map->x + z_image_x));
+ map_x + s_image_x,
+ map_y + s_image_y);
+ ptrdiff_t z_offset = ((map_y + z_image_y) * z_mt->region->pitch +
+ (map_x + z_image_x));
uint8_t s = s_map[s_offset];
uint32_t z = z_map[z_offset];
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111206/9de8183f/attachment.pgp>
More information about the mesa-dev
mailing list