[Mesa-dev] [PATCH 3/5] intel: Remove now trivial intel_renderbuffer_set_{hiz_, }region().

Chad Versace chad at chad-versace.us
Wed Jul 6 14:46:21 PDT 2011


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

On 06/29/2011 03:26 PM, Eric Anholt wrote:
> Note that as a result of this cleanup a bug in intel_process_dri2_buffer_no_separate_stencil() beomes quite apparent. --- 
> src/mesa/drivers/dri/intel/intel_context.c |   40 ++++++++++++---------------- src/mesa/drivers/dri/intel/intel_fbo.c     |
> 19 ------------- src/mesa/drivers/dri/intel/intel_fbo.h     |   12 -------- 3 files changed, 17 insertions(+), 54
> deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 547d81b..91f6c6d
> 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -1112,7 +1112,6
> @@ intel_query_dri2_buffers_no_separate_stencil(struct intel_context *intel, * * \see intel_update_renderbuffers() * \see
> intel_region_alloc_for_handle() - * \see intel_renderbuffer_set_region() */ static void 
> intel_process_dri2_buffer_no_separate_stencil(struct intel_context *intel, @@ -1124,7 +1123,6 @@
> intel_process_dri2_buffer_no_separate_stencil(struct intel_context *intel, assert(!intel->must_use_separate_stencil);
> 
> struct gl_framebuffer *fb = drawable->driverPrivate; -   struct intel_region *region = NULL; struct intel_renderbuffer
> *depth_rb = NULL;
> 
> if (!rb) @@ -1151,20 +1149,18 @@ intel_process_dri2_buffer_no_separate_stencil(struct intel_context *intel, if
> (unlikely(INTEL_DEBUG & DEBUG_DRI)) { fprintf(stderr, "(reusing depth buffer as stencil)\n"); } -
> intel_region_reference(&region, depth_rb->region); +      intel_region_reference(&rb->region, depth_rb->region); } else { -
> region = intel_region_alloc_for_handle(intel->intelScreen, -					     buffer->cpp, -					     drawable->w, -
> drawable->h, -					     buffer->pitch / buffer->cpp, -					     buffer->name, -					     buffer_name); +
> intel_region_release(&rb->region); +      rb->region = intel_region_alloc_for_handle(intel->intelScreen, +
> buffer->cpp, +						 drawable->w, +						 drawable->h, +						 buffer->pitch / buffer->cpp, +						 buffer->name, +
> buffer_name); }
> 
> -   intel_renderbuffer_set_region(intel, rb, region); -   intel_region_release(&region); - if (buffer->attachment ==
> __DRI_BUFFER_DEPTH_STENCIL) { struct intel_renderbuffer *stencil_rb = intel_get_renderbuffer(fb, BUFFER_STENCIL); @@ -1175,7
> +1171,8 @@ intel_process_dri2_buffer_no_separate_stencil(struct intel_context *intel, if (stencil_rb->region &&
> stencil_rb->region->name == buffer->name) return;
> 
> -      intel_renderbuffer_set_region(intel, stencil_rb, region); +      /* XXX: Surely this is incorrect. */ +
> intel_region_reference(&stencil_rb->region, NULL); } }

Concerning the XXX, the appropriate reference is:
    intel_region_reference(&stencil_rb->region, rb->region);

Or equivalently,
    struct intel_renderbuffer *depth_rb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
    assert(rb == depth_rb);
    intel_region_reference(&stencil_rb->region, depth_rb->region);

With the fix,
Reviewed-by: Chad Versace <chad at chad-versace.us>

- -- 
Chad Versace
chad at chad-versace.us
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOFNesAAoJEAIvNt057x8iCssP/1X5PN2u9OKE/dgEkgGkxmLe
IymIUnEodgBNWrlg03ApFAOFsGfRlykGKI0yoGLuiWI8wkR3Zoc0WJBuOdYy2zMP
TZ5afzLouLrmFKRNPdP4hgbLmEK1SXOIwt0AjeuGYuNsYwF/+DFo3VEnP4hSq3rS
N+04k8zJkfD2LGEQq/aWSd2uSC0ZEI7ULtEHSC2+N/o3BcyPg6fkmKO4UlJOIXaH
VQTSerkoKDmJbSw2gM1nhTKruZU5YxNvf3HUkGiWWO2vOpMJxd7Suhxa841PY7Ct
Rl4jfPfvKToO2LNBhLro+Ah/xbq1XUmnM0V0Jxrw6T2gFYcZvV/dnwOYajF8M5a9
V/X09brhGP2pLpNNmvW4gMipT3fKJR72Pa9OC1yF0R3+j4ttgzXsoTMZ24EIQsu/
wZtplZ/ct054hx2cdFvE5ATG6/RiWfWqHcD0WyZwmf1uELeq/gIfht+92RQanh9S
47hPgkkL6t+3vhHW/2MzWsuVunGG2LqcOQqy73MN2H4BS0HoD4hJqsv+dGky+2JN
MNAvn1RQKhTskLAIY960BlPR4t2nqSAuAuGerUbgcy2liWKPsp7E69he8q/lxqRI
x04fVyJ2+8kSIXknwCcmkXTimfpP5aZIJUZX2ryUS89M22GOKBJ+QpZtXs2eWBsa
FLRk0mJhU4TvBegdUXfZ
=Jz6K
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list