summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-09-01 08:12:51 +0200
committerMarek Olšák <maraeo@gmail.com>2010-09-04 18:56:22 +0200
commitcfc461fca6ad5656f58c48803d13052537063316 (patch)
treefbeb8c1e4420ecd197a1d3d9b355f17cd8f9a781 /src/gallium/drivers
parentd2f4ceaa47695f9dc203c28b39d332eea8a115b2 (diff)
r300g: add a new debug option which disables compiler optimizations
Those are: - dead-code elimination - constant folding - peephole (mainly copy propagation) - register allocation There are some bugs which I need to track down. Also fix up the descriptions of all the debug options.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r300/r300_debug.c37
-rw-r--r--src/gallium/drivers/r300/r300_fs.c1
-rw-r--r--src/gallium/drivers/r300/r300_screen.h1
-rw-r--r--src/gallium/drivers/r300/r300_vs.c1
4 files changed, 22 insertions, 18 deletions
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c
index c3e157e99a..786fdf6ce8 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -27,24 +27,25 @@
#include <stdio.h>
static const struct debug_named_value debug_options[] = {
- { "fp", DBG_FP, "Fragment program handling (for debugging)" },
- { "vp", DBG_VP, "Vertex program handling (for debugging)" },
- { "draw", DBG_DRAW, "Draw calls (for debugging)" },
- { "swtcl", DBG_SWTCL, "SWTCL-specific info (for debugging)" },
- { "rsblock", DBG_RS_BLOCK, "Rasterizer registers (for debugging)" },
- { "psc", DBG_PSC, "Vertex stream registers (for debugging)" },
- { "tex", DBG_TEX, "Textures (for debugging)" },
- { "texalloc", DBG_TEXALLOC, "Texture allocation (for debugging)" },
- { "fall", DBG_FALL, "Fallbacks (for debugging)" },
- { "rs", DBG_RS, "Rasterizer (for debugging)" },
- { "fb", DBG_FB, "Framebuffer (for debugging)" },
- { "cbzb", DBG_CBZB, "Fast color clear info (for debugging)" },
- { "fakeocc", DBG_FAKE_OCC, "Use fake occlusion queries (for debugging)" },
- { "anisohq", DBG_ANISOHQ, "High quality anisotropic filtering (for benchmarking)" },
- { "notiling", DBG_NO_TILING, "Disable tiling (for benchmarking)" },
- { "noimmd", DBG_NO_IMMD, "Disable immediate mode (for benchmarking)" },
- { "stats", DBG_STATS, "Gather statistics" },
- { "hyperz", DBG_HYPERZ, "HyperZ (for debugging)" },
+ { "fp", DBG_FP, "Log fragment program compilation" },
+ { "vp", DBG_VP, "Log bertex program compilation" },
+ { "draw", DBG_DRAW, "Log draw calls" },
+ { "swtcl", DBG_SWTCL, "Log SWTCL-specific info" },
+ { "rsblock", DBG_RS_BLOCK, "Log rasterizer registers" },
+ { "psc", DBG_PSC, "Log vertex stream registers" },
+ { "tex", DBG_TEX, "Log basic info about textures" },
+ { "texalloc", DBG_TEXALLOC, "Log texture mipmap tree info" },
+ { "fall", DBG_FALL, "Log fallbacks" },
+ { "rs", DBG_RS, "Log rasterizer" },
+ { "fb", DBG_FB, "Log framebuffer" },
+ { "cbzb", DBG_CBZB, "Log fast color clear info" },
+ { "stats", DBG_STATS, "Log emission statistics" },
+ { "hyperz", DBG_HYPERZ, "Log HyperZ info" },
+ { "fakeocc", DBG_FAKE_OCC, "Use fake occlusion queries" },
+ { "anisohq", DBG_ANISOHQ, "Use high quality anisotropic filtering" },
+ { "notiling", DBG_NO_TILING, "Disable tiling" },
+ { "noimmd", DBG_NO_IMMD, "Disable immediate mode" },
+ { "noopt", DBG_NO_OPT, "Disable shader optimizations" },
/* must be last */
DEBUG_NAMED_VALUE_END
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index e8ebe90b33..b9f4d77dea 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -385,6 +385,7 @@ static void r300_translate_fragment_shader(
compiler.code = &shader->code;
compiler.state = shader->compare_state;
compiler.Base.is_r500 = r300->screen->caps.is_r500;
+ compiler.Base.disable_optimizations = DBG_ON(r300, DBG_NO_OPT);
compiler.Base.has_half_swizzles = TRUE;
compiler.Base.max_temp_regs = compiler.Base.is_r500 ? 128 : 32;
compiler.Base.max_constants = compiler.Base.is_r500 ? 256 : 32;
diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h
index 13a3320b99..f2f63213e0 100644
--- a/src/gallium/drivers/r300/r300_screen.h
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -97,6 +97,7 @@ r300_winsys_screen(struct pipe_screen *screen) {
#define DBG_NO_TILING (1 << 17)
#define DBG_NO_IMMD (1 << 18)
#define DBG_FAKE_OCC (1 << 19)
+#define DBG_NO_OPT (1 << 20)
/* Statistics. */
#define DBG_STATS (1 << 24)
/*@}*/
diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c
index 2db7b52a87..add3d552c4 100644
--- a/src/gallium/drivers/r300/r300_vs.c
+++ b/src/gallium/drivers/r300/r300_vs.c
@@ -205,6 +205,7 @@ void r300_translate_vertex_shader(struct r300_context *r300,
compiler.code = &vs->code;
compiler.UserData = vs;
compiler.Base.is_r500 = r300->screen->caps.is_r500;
+ compiler.Base.disable_optimizations = DBG_ON(r300, DBG_NO_OPT);
compiler.Base.has_half_swizzles = FALSE;
compiler.Base.max_temp_regs = 32;
compiler.Base.max_constants = 256;