mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
freedreno: add debug option to disable scissor optimization
Useful for testing and debugging. Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
parent
b2a32254d6
commit
8b167d34be
3 changed files with 22 additions and 14 deletions
|
|
@ -71,7 +71,8 @@ calculate_tiles(struct fd_context *ctx)
|
|||
{
|
||||
struct fd_gmem_stateobj *gmem = &ctx->gmem;
|
||||
struct pipe_scissor_state *scissor = &ctx->max_scissor;
|
||||
uint32_t cpp = util_format_get_blocksize(ctx->framebuffer.cbufs[0]->format);
|
||||
struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
|
||||
uint32_t cpp = util_format_get_blocksize(pfb->cbufs[0]->format);
|
||||
uint32_t gmem_size = ctx->screen->gmemsize_bytes;
|
||||
uint32_t minx, miny, width, height;
|
||||
uint32_t nbins_x = 1, nbins_y = 1;
|
||||
|
|
@ -84,10 +85,17 @@ calculate_tiles(struct fd_context *ctx)
|
|||
return;
|
||||
}
|
||||
|
||||
minx = scissor->minx & ~31; /* round down to multiple of 32 */
|
||||
miny = scissor->miny & ~31;
|
||||
width = scissor->maxx - minx;
|
||||
height = scissor->maxy - miny;
|
||||
if (fd_mesa_debug & FD_DBG_DSCIS) {
|
||||
minx = 0;
|
||||
miny = 0;
|
||||
width = pfb->width;
|
||||
height = pfb->height;
|
||||
} else {
|
||||
minx = scissor->minx & ~31; /* round down to multiple of 32 */
|
||||
miny = scissor->miny & ~31;
|
||||
width = scissor->maxx - minx;
|
||||
height = scissor->maxy - miny;
|
||||
}
|
||||
|
||||
// TODO we probably could optimize this a bit if we know that
|
||||
// Z or stencil is not enabled for any of the draw calls..
|
||||
|
|
@ -132,9 +140,7 @@ static void
|
|||
render_tiles(struct fd_context *ctx)
|
||||
{
|
||||
struct fd_gmem_stateobj *gmem = &ctx->gmem;
|
||||
uint32_t i, yoff = 0;
|
||||
|
||||
yoff= gmem->miny;
|
||||
uint32_t i, yoff = gmem->miny;
|
||||
|
||||
ctx->emit_tile_init(ctx);
|
||||
|
||||
|
|
@ -143,13 +149,13 @@ render_tiles(struct fd_context *ctx)
|
|||
uint32_t bh = gmem->bin_h;
|
||||
|
||||
/* clip bin height: */
|
||||
bh = MIN2(bh, gmem->height - yoff);
|
||||
bh = MIN2(bh, gmem->miny + gmem->height - yoff);
|
||||
|
||||
for (j = 0; j < gmem->nbins_x; j++) {
|
||||
uint32_t bw = gmem->bin_w;
|
||||
|
||||
/* clip bin width: */
|
||||
bw = MIN2(bw, gmem->width - xoff);
|
||||
bw = MIN2(bw, gmem->minx + gmem->width - xoff);
|
||||
|
||||
DBG("bin_h=%d, yoff=%d, bin_w=%d, xoff=%d",
|
||||
bh, yoff, bw, xoff);
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ static const struct debug_named_value debug_options[] = {
|
|||
{"disasm", FD_DBG_DISASM, "Dump TGSI and adreno shader disassembly"},
|
||||
{"dclear", FD_DBG_DCLEAR, "Mark all state dirty after clear"},
|
||||
{"dgmem", FD_DBG_DGMEM, "Mark all state dirty after GMEM tile pass"},
|
||||
{"dscis", FD_DBG_DSCIS, "Disable scissor optimization"},
|
||||
DEBUG_NAMED_VALUE_END
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -47,10 +47,11 @@ enum adreno_pa_su_sc_draw fd_polygon_mode(unsigned mode);
|
|||
enum adreno_stencil_op fd_stencil_op(unsigned op);
|
||||
|
||||
|
||||
#define FD_DBG_MSGS 0x1
|
||||
#define FD_DBG_DISASM 0x2
|
||||
#define FD_DBG_DCLEAR 0x4
|
||||
#define FD_DBG_DGMEM 0x8
|
||||
#define FD_DBG_MSGS 0x01
|
||||
#define FD_DBG_DISASM 0x02
|
||||
#define FD_DBG_DCLEAR 0x04
|
||||
#define FD_DBG_DGMEM 0x08
|
||||
#define FD_DBG_DSCIS 0x10
|
||||
extern int fd_mesa_debug;
|
||||
|
||||
#define DBG(fmt, ...) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue