asahi: Calculate tilebuffer layout per batch

It won't be fixed soon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19871>
This commit is contained in:
Alyssa Rosenzweig
2022-11-18 22:59:42 -05:00
committed by Marge Bot
parent b1f5004ee7
commit 03dc4bc3e8
2 changed files with 16 additions and 0 deletions
+13
View File
@@ -1559,6 +1559,19 @@ agx_batch_init_state(struct agx_batch *batch)
agx_ppp_fini(&out, &ppp);
batch->encoder_current = out;
/* Choose a tilebuffer layout given the framebuffer key */
enum pipe_format formats[PIPE_MAX_COLOR_BUFS] = { 0 };
for (unsigned i = 0; i < batch->key.nr_cbufs; ++i) {
struct pipe_surface *surf = batch->key.cbufs[i];
if (surf)
formats[i] = surf->format;
}
batch->tilebuffer_layout =
agx_build_tilebuffer_layout(formats, batch->key.nr_cbufs,
util_framebuffer_get_num_samples(&batch->key));
}
static enum agx_object_type
+3
View File
@@ -33,6 +33,7 @@
#include "asahi/lib/agx_bo.h"
#include "asahi/lib/agx_device.h"
#include "asahi/lib/pool.h"
#include "asahi/lib/agx_tilebuffer.h"
#include "asahi/compiler/agx_compile.h"
#include "asahi/layout/layout.h"
#include "compiler/nir/nir_lower_blend.h"
@@ -97,6 +98,8 @@ struct agx_batch {
struct pipe_framebuffer_state key;
uint64_t seqnum;
struct agx_tilebuffer_layout tilebuffer_layout;
/* PIPE_CLEAR_* bitmask */
uint32_t clear, draw, load;