summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-04-18 02:32:54 +0200
committerMarek Olšák <[email protected]>2010-04-18 02:56:09 +0200
commit5b609badf7682da2377c5e67ab827b2dc3a06b9b (patch)
tree395664ce5cd2465cff64b72a9e3c6396ce6f815b /src/gallium
parent4185d9770f1e08f190a57547ca47a231b9c0d6d7 (diff)
r300g: add debugging options "notiling" and "noimmd" (for testing)
notiling = Disable texture tiling noimmd = Disable immediate mode (this optimization was really worth it!)
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r300/r300_debug.c16
-rw-r--r--src/gallium/drivers/r300/r300_render.c2
-rw-r--r--src/gallium/drivers/r300/r300_screen.h2
-rw-r--r--src/gallium/drivers/r300/r300_texture.c7
4 files changed, 18 insertions, 9 deletions
diff --git a/src/gallium/drivers/r300/r300_debug.c b/src/gallium/drivers/r300/r300_debug.c
index 016e8d66061..6e84bf82469 100644
--- a/src/gallium/drivers/r300/r300_debug.c
+++ b/src/gallium/drivers/r300/r300_debug.c
@@ -32,13 +32,15 @@ struct debug_option {
static struct debug_option debug_options[] = {
{ "help", DBG_HELP, "Helpful meta-information about the driver" },
- { "fp", DBG_FP, "Fragment program handling" },
- { "vp", DBG_VP, "Vertex program handling" },
- { "cs", DBG_CS, "Command submissions" },
- { "draw", DBG_DRAW, "Draw and emit" },
- { "tex", DBG_TEX, "Textures" },
- { "fall", DBG_FALL, "Fallbacks" },
- { "anisohq", DBG_ANISOHQ, "High quality anisotropic filtering (for benchmarking purposes only!)" },
+ { "fp", DBG_FP, "Fragment program handling (for debugging)" },
+ { "vp", DBG_VP, "Vertex program handling (for debugging)" },
+ { "cs", DBG_CS, "Command submissions (for debugging)" },
+ { "draw", DBG_DRAW, "Draw and emit (for debugging)" },
+ { "tex", DBG_TEX, "Textures (for debugging)" },
+ { "fall", DBG_FALL, "Fallbacks (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)" },
{ "all", ~0, "Convenience option that enables all debug flags" },
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 751a7e6d5bd..fa7b70b0846 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -138,7 +138,7 @@ static boolean immd_is_good_idea(struct r300_context *r300,
unsigned vertex_element_count = r300->velems->count;
unsigned i, vbi;
- if (count > 10) {
+ if (count > 10 || DBG_ON(r300, DBG_NO_IMMD)) {
return FALSE;
}
diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h
index 2f951c7097c..4077424e549 100644
--- a/src/gallium/drivers/r300/r300_screen.h
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -69,6 +69,8 @@ static INLINE struct r300_screen* r300_screen(struct pipe_screen* screen) {
#define DBG_TEX 0x0000020
#define DBG_FALL 0x0000040
#define DBG_ANISOHQ 0x0000080
+#define DBG_NO_TILING 0x0000100
+#define DBG_NO_IMMD 0x0000200
/*@}*/
static INLINE boolean SCREEN_DBG_ON(struct r300_screen * screen, unsigned flags)
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index a37b33edf29..0c3502ff936 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -836,13 +836,14 @@ static void r300_setup_tiling(struct pipe_screen *screen,
enum pipe_format format = tex->b.b.format;
boolean rv350_mode = r300_screen(screen)->caps.family >= CHIP_FAMILY_RV350;
boolean is_zb = util_format_is_depth_or_stencil(format);
+ boolean dbg_no_tiling = SCREEN_DBG_ON(r300_screen(screen), DBG_NO_TILING);
if (!r300_format_is_plain(format)) {
return;
}
/* If height == 1, disable microtiling except for zbuffer. */
- if (!is_zb && tex->b.b.height0 == 1) {
+ if (!is_zb && (tex->b.b.height0 == 1 || dbg_no_tiling)) {
return;
}
@@ -861,6 +862,10 @@ static void r300_setup_tiling(struct pipe_screen *screen,
break;
}
+ if (dbg_no_tiling) {
+ return;
+ }
+
/* Set macrotiling. */
if (r300_texture_macro_switch(tex, 0, rv350_mode, TILE_WIDTH) &&
r300_texture_macro_switch(tex, 0, rv350_mode, TILE_HEIGHT)) {