panfrost: Set rt_count

This doesn't quite work yet, but it illustrates how MRT is implemented
in the MFBD: rt_count is set appropriately based on the number of render
targets, while additional render target descriptors are appended on with
an index variable in them (not quite decoded since there's some aspects
we don't understand there, but conceptually this should be right).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-07-18 12:43:39 -07:00
parent 871ad7789f
commit 0395b58c92
2 changed files with 11 additions and 8 deletions

View File

@ -165,8 +165,7 @@ panfrost_emit_mfbd(struct panfrost_context *ctx, unsigned vertex_count)
.unk1 = 0x1080,
/* TODO: MRT */
.rt_count_1 = MALI_POSITIVE(1),
.rt_count_1 = MALI_POSITIVE(ctx->pipe_framebuffer.nr_cbufs),
.rt_count_2 = 4,
.unknown2 = 0x1f,

View File

@ -394,17 +394,18 @@ panfrost_mfbd_fragment(struct panfrost_context *ctx, bool has_draws)
struct bifrost_fb_extra fbx = {};
struct bifrost_render_target rts[4] = {};
/* XXX: MRT case */
fb.rt_count_2 = 1;
/* We always upload at least one dummy GL_NONE render target */
unsigned rt_descriptors =
MAX2(ctx->pipe_framebuffer.nr_cbufs, 1);
fb.rt_count_1 = MALI_POSITIVE(rt_descriptors);
fb.rt_count_2 = rt_descriptors;
fb.mfbd_flags = 0x100;
/* TODO: MRT clear */
panfrost_mfbd_clear(job, &fb, &fbx, rts, fb.rt_count_2);
/* We always upload at least one dummy GL_NONE render target */
unsigned rt_descriptors =
MAX2(ctx->pipe_framebuffer.nr_cbufs, 1);
/* Upload either the render target or a dummy GL_NONE target */
@ -430,6 +431,9 @@ panfrost_mfbd_fragment(struct panfrost_context *ctx, bool has_draws)
rts[cb].framebuffer = 0;
rts[cb].framebuffer_stride = 0;
}
/* TODO: Break out the field */
rts[cb].format.unk1 |= (cb * 0x400);
}
if (ctx->pipe_framebuffer.zsbuf) {