panfrost: Add util_draw_indirect() debug path

Useful for finding problems with the GPU indirect path.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
This commit is contained in:
Alyssa Rosenzweig 2021-06-03 14:09:18 -04:00 committed by Marge Bot
parent d61162af50
commit 1760511e02
3 changed files with 10 additions and 0 deletions

View file

@ -44,6 +44,7 @@
#include "util/format/u_format.h"
#include "util/u_prim.h"
#include "util/u_prim_restart.h"
#include "util/u_draw.h"
#include "indices/u_primconvert.h"
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_from_mesa.h"
@ -739,6 +740,13 @@ panfrost_draw_vbo(struct pipe_context *pipe,
if (!panfrost_render_condition_check(ctx))
return;
/* Emulate indirect draws when debugging */
if (dev->debug & PAN_DBG_NOINDIRECT && indirect && indirect->buffer) {
assert(num_draws == 1);
util_draw_indirect(pipe, info, indirect);
return;
}
/* Do some common setup */
struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);

View file

@ -69,6 +69,7 @@ static const struct debug_named_value panfrost_debug_options[] = {
{"nocrc", PAN_DBG_NO_CRC, "Disable transaction elimination"},
{"msaa16", PAN_DBG_MSAA16, "Enable MSAA 8x and 16x support"},
{"panblit", PAN_DBG_PANBLIT, "Use pan_blitter instead of u_blitter"},
{"noindirect", PAN_DBG_NOINDIRECT, "Emulate indirect draws on the CPU"},
DEBUG_NAMED_VALUE_END
};

View file

@ -40,5 +40,6 @@
#define PAN_DBG_NO_AFBC 0x0200
#define PAN_DBG_MSAA16 0x0400
#define PAN_DBG_PANBLIT 0x0800
#define PAN_DBG_NOINDIRECT 0x1000
#endif /* PAN_UTIL_H */