From patchwork Sun Apr 25 20:03:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Willenbrock X-Patchwork-Id: 94965 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3PKDDow007575 for ; Sun, 25 Apr 2010 20:13:49 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CBB59E7E2; Sun, 25 Apr 2010 13:13:13 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.insert-into.net (mail.insert-into.net [212.112.238.121]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E6AB9E7D5 for ; Sun, 25 Apr 2010 13:13:10 -0700 (PDT) Received: by mail.insert-into.net (Postfix, from userid 10) id D8A3221A9074; Sun, 25 Apr 2010 22:13:09 +0200 (CEST) Received: from [10.27.2.96] (fangorn.pirsoft.dnsalias.net [10.27.2.96]) by smtp.pirsoft.dnsalias.org (Postfix) with ESMTPSA id ADCDC7123D0; Sun, 25 Apr 2010 22:03:42 +0200 (CEST) Message-ID: <4BD4A01E.5010406@pirsoft.de> Date: Sun, 25 Apr 2010 22:03:42 +0200 From: Pierre Willenbrock User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.9) Gecko/20100415 Gentoo/2.0.4-r1 SeaMonkey/2.0.4 MIME-Version: 1.0 To: "intel-gfx@lists.freedesktop.org" References: <4BD49E6E.8050307@pirsoft.de> In-Reply-To: <4BD49E6E.8050307@pirsoft.de> X-Enigmail-Version: 1.0.1 Subject: Re: [Intel-gfx] [PATCH] for mesa: Fill the padding between entrys in the sampler key X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 25 Apr 2010 20:13:50 +0000 (UTC) diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index d7650af..1582ff1 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -228,6 +228,8 @@ brw_wm_sampler_populate_key(struct brw_context *brw, { GLcontext *ctx = &brw->intel.ctx; int unit; + char *last_entry_end = ((char*)&key->sampler_count) + + sizeof(key->sampler_count); key->sampler_count = 0; @@ -240,7 +242,9 @@ brw_wm_sampler_populate_key(struct brw_context *brw, struct gl_texture_image *firstImage = texObj->Image[0][intelObj->firstLevel]; - memset(entry, 0, sizeof(*entry)); + memset(last_entry_end, 0, + (char*)entry - last_entry_end + sizeof(*entry)); + last_entry_end = ((char*)entry) + sizeof(*entry); entry->tex_target = texObj->Target; @@ -280,6 +284,8 @@ brw_wm_sampler_populate_key(struct brw_context *brw, key->sampler_count = unit + 1; } } + struct wm_sampler_entry *entry = &key->sampler[key->sampler_count]; + memset(last_entry_end, 0, (char*)entry - last_entry_end); } /* All samplers must be uploaded in a single contiguous array, which