From: Zhenyu Wang Date: Tue, 28 Dec 2010 03:03:45 +0000 (+0800) Subject: i965: Fix occlusion query on sandybridge X-Git-Tag: 062012170305~8157 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=689aca782216d2666486dea02206cbc9c4162e0d;p=profile%2Fivi%2Fmesa.git i965: Fix occlusion query on sandybridge Clear target query buffer fixed occlusion query on sandybridge. https://bugs.freedesktop.org/show_bug.cgi?id=32167 --- diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index f28f286..656aad6 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -232,6 +232,12 @@ brw_prepare_query_begin(struct brw_context *brw) brw->query.bo = NULL; brw->query.bo = drm_intel_bo_alloc(intel->bufmgr, "query", 4096, 1); + + /* clear target buffer */ + drm_intel_bo_map(brw->query.bo, GL_TRUE); + memset((char *)brw->query.bo->virtual, 0, 4096); + drm_intel_bo_unmap(brw->query.bo); + brw->query.index = 0; }