Mesa (master): i965/fs: Fix segfault when using INTEL_DEBUG= perf with non-GLSL.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Oct 16 19:03:08 UTC 2012


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Oct 15 12:00:38 2012 -0700

i965/fs: Fix segfault when using INTEL_DEBUG=perf with non-GLSL.

Now that ARB programs and fixed function are routed through the new
backend, shader might be NULL.  Don't do INTEL_DEBUG=perf support in
that case, since it relies on shader->compiled_once.

Since INTEL_DEBUG=perf wasn't previously supported, this maintains the
status quo.  It might be nice to support it someday, however.

This could be moved to brw_shader_program instead of brw_shader, but
it appears even prog can be NULL in that case.

Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 0545a74..fa8cf89 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1974,7 +1974,7 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c,
 
    c->prog_data.dispatch_width = 8;
 
-   if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+   if (unlikely(INTEL_DEBUG & DEBUG_PERF) && shader) {
       if (shader->compiled_once)
          brw_wm_debug_recompile(brw, prog, &c->key);
       shader->compiled_once = true;




More information about the mesa-commit mailing list