From 162c69ae54a47719281b4c1a0e7c17da0a1db9d2 Mon Sep 17 00:00:00 2001 From: "Park, Jeongmin" Date: Wed, 4 Feb 2015 15:08:28 +0900 Subject: [PATCH 1/2] st/osmesa: Simplify code for finding z buffer --- src/gallium/state_trackers/osmesa/osmesa.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c index 4e2b2e0..c52dae8 100644 --- a/src/gallium/state_trackers/osmesa/osmesa.c +++ b/src/gallium/state_trackers/osmesa/osmesa.c @@ -319,25 +319,9 @@ osmesa_st_framebuffer_flush_front(struct st_context_iface *stctx, int dst_stride; if (osmesa->pp) { - struct pipe_resource *zsbuf = NULL; - unsigned i; - - /* Find the z/stencil buffer if there is one */ - for (i = 0; i < Elements(osbuffer->textures); i++) { - struct pipe_resource *res = osbuffer->textures[i]; - if (res) { - const struct util_format_description *desc = - util_format_description(res->format); - - if (util_format_has_depth(desc)) { - zsbuf = res; - break; - } - } - } - /* run the postprocess stage(s) */ - pp_run(osmesa->pp, res, res, zsbuf); + pp_run(osmesa->pp, res, res, + osbuffer->textures[ST_ATTACHMENT_DEPTH_STENCIL]); } u_box_2d(0, 0, res->width0, res->height0, &box); -- 2.0.2