Mesa (master): i965/fs: Fix INTEL_DEBUG=perf program key printing.

Kenneth Graunke kwg at kemper.freedesktop.org
Sun Aug 26 06:02:03 UTC 2012


Module: Mesa
Branch: master
Commit: 98211d5af7efa26c350f6191457ab2564847abde
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=98211d5af7efa26c350f6191457ab2564847abde

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Aug 15 16:35:35 2012 -0700

i965/fs: Fix INTEL_DEBUG=perf program key printing.

When dumping differences in program keys, it printed messages of the
format:

   [Name of thing that changed]  [new]->[old]

This was terribly confusing: the right arrow implies "the value changed
from this to that", when in fact the message conveyed the opposite.

Except that some of the time, it didn't, since we accidentally swapped
the arguments to brw_debug_recompile_sampler_key.  With two swaps, it
would often come out in the expected format.

This patch fixes it to properly print:

   [Name of thing that changed]  [old]->[new]

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_wm.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index ba6f874..e7ef9f2 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -366,18 +366,18 @@ brw_debug_recompile_sampler_key(const struct brw_sampler_prog_key_data *old_key,
 
    for (unsigned int i = 0; i < BRW_MAX_TEX_UNIT; i++) {
       found |= key_debug("EXT_texture_swizzle or DEPTH_TEXTURE_MODE",
-                         key->swizzles[i], old_key->swizzles[i]);
+                         old_key->swizzles[i], key->swizzles[i]);
    }
    found |= key_debug("GL_CLAMP enabled on any texture unit's 1st coordinate",
-                      key->gl_clamp_mask[0], old_key->gl_clamp_mask[0]);
+                      old_key->gl_clamp_mask[0], key->gl_clamp_mask[0]);
    found |= key_debug("GL_CLAMP enabled on any texture unit's 2nd coordinate",
-                      key->gl_clamp_mask[1], old_key->gl_clamp_mask[1]);
+                      old_key->gl_clamp_mask[1], key->gl_clamp_mask[1]);
    found |= key_debug("GL_CLAMP enabled on any texture unit's 3rd coordinate",
-                      key->gl_clamp_mask[2], old_key->gl_clamp_mask[2]);
+                      old_key->gl_clamp_mask[2], key->gl_clamp_mask[2]);
    found |= key_debug("GL_MESA_ycbcr texturing\n",
-                      key->yuvtex_mask, old_key->yuvtex_mask);
+                      old_key->yuvtex_mask, key->yuvtex_mask);
    found |= key_debug("GL_MESA_ycbcr UV swapping\n",
-                      key->yuvtex_swap_mask, old_key->yuvtex_swap_mask);
+                      old_key->yuvtex_swap_mask, key->yuvtex_swap_mask);
 
    return found;
 }
@@ -413,18 +413,18 @@ brw_wm_debug_recompile(struct brw_context *brw,
    }
 
    found |= key_debug("alphatest, computed depth, depth test, or depth write",
-                      key->iz_lookup, old_key->iz_lookup);
-   found |= key_debug("depth statistics", key->stats_wm, old_key->stats_wm);
-   found |= key_debug("flat shading", key->flat_shade, old_key->flat_shade);
-   found |= key_debug("number of color buffers", key->nr_color_regions, old_key->nr_color_regions);
-   found |= key_debug("rendering to FBO", key->render_to_fbo, old_key->render_to_fbo);
-   found |= key_debug("fragment color clamping", key->clamp_fragment_color, old_key->clamp_fragment_color);
-   found |= key_debug("line smoothing", key->line_aa, old_key->line_aa);
-   found |= key_debug("proj_attrib_mask", key->proj_attrib_mask, old_key->proj_attrib_mask);
-   found |= key_debug("renderbuffer height", key->drawable_height, old_key->drawable_height);
-   found |= key_debug("vertex shader outputs", key->vp_outputs_written, old_key->vp_outputs_written);
-
-   found |= brw_debug_recompile_sampler_key(&key->tex, &old_key->tex);
+                      old_key->iz_lookup, key->iz_lookup);
+   found |= key_debug("depth statistics", old_key->stats_wm, key->stats_wm);
+   found |= key_debug("flat shading", old_key->flat_shade, key->flat_shade);
+   found |= key_debug("number of color buffers", old_key->nr_color_regions, key->nr_color_regions);
+   found |= key_debug("rendering to FBO", old_key->render_to_fbo, key->render_to_fbo);
+   found |= key_debug("fragment color clamping", old_key->clamp_fragment_color, key->clamp_fragment_color);
+   found |= key_debug("line smoothing", old_key->line_aa, key->line_aa);
+   found |= key_debug("proj_attrib_mask", old_key->proj_attrib_mask, key->proj_attrib_mask);
+   found |= key_debug("renderbuffer height", old_key->drawable_height, key->drawable_height);
+   found |= key_debug("vertex shader outputs", old_key->vp_outputs_written, key->vp_outputs_written);
+
+   found |= brw_debug_recompile_sampler_key(&old_key->tex, &key->tex);
 
    if (!found) {
       perf_debug("  Something else\n");




More information about the mesa-commit mailing list