summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-11-29 15:06:39 -0500
committerRob Clark <[email protected]>2017-12-03 14:17:41 -0500
commite6c6495d3a850da9fc04355df40fc8ab8fa80621 (patch)
tree59a40c13e74b253222661f445c3d13ed62c0681f
parentf93f2f7b1e80e838acb4ddc12f62a9a545da5194 (diff)
freedreno: add debug option to force emulated indirect
Useful mostly for debugging indirect draw. Signed-off-by: Rob Clark <[email protected]>
-rw-r--r--src/gallium/drivers/freedreno/freedreno_draw.c10
-rw-r--r--src/gallium/drivers/freedreno/freedreno_screen.c1
-rw-r--r--src/gallium/drivers/freedreno/freedreno_util.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
index 60a1180f24d..fc24776e4a9 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.c
+++ b/src/gallium/drivers/freedreno/freedreno_draw.c
@@ -27,6 +27,7 @@
*/
#include "pipe/p_state.h"
+#include "util/u_draw.h"
#include "util/u_string.h"
#include "util/u_memory.h"
#include "util/u_prim.h"
@@ -67,6 +68,15 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
struct pipe_scissor_state *scissor = fd_context_get_scissor(ctx);
unsigned i, prims, buffers = 0, restore_buffers = 0;
+ /* for debugging problems with indirect draw, it is convenient
+ * to be able to emulate it, to determine if game is feeding us
+ * bogus data:
+ */
+ if (info->indirect && (fd_mesa_debug & FD_DBG_NOINDR)) {
+ util_draw_indirect(pctx, info);
+ return;
+ }
+
if (!info->count_from_stream_output && !info->indirect &&
!info->primitive_restart &&
!u_trim_pipe_prim(info->mode, (unsigned*)&info->count))
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index aea56a180af..35433da4b9f 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -79,6 +79,7 @@ static const struct debug_named_value debug_options[] = {
{"bstat", FD_DBG_BSTAT, "Print batch stats at context destroy"},
{"nogrow", FD_DBG_NOGROW, "Disable \"growable\" cmdstream buffers, even if kernel supports it"},
{"lrz", FD_DBG_LRZ, "Enable experimental LRZ support (a5xx+)"},
+ {"noindirect",FD_DBG_NOINDR, "Disable hw indirect draws (emulate on CPU)"},
DEBUG_NAMED_VALUE_END
};
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h
index 14fcf1d6725..b6f4771390e 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -80,6 +80,7 @@ enum adreno_stencil_op fd_stencil_op(unsigned op);
#define FD_DBG_BSTAT 0x8000
#define FD_DBG_NOGROW 0x10000
#define FD_DBG_LRZ 0x20000
+#define FD_DBG_NOINDR 0x40000
extern int fd_mesa_debug;
extern bool fd_binning_enabled;