pan/bi: Handle different sizes of LD_TILE
v2: Fix overflow. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
This commit is contained in:
committed by
Marge Bot
parent
f412801768
commit
ba17342a1f
@@ -990,16 +990,18 @@ panfrost_upload_multisampled_sysval(struct panfrost_batch *batch,
|
||||
}
|
||||
|
||||
static void
|
||||
panfrost_upload_rt_conversion_sysval(struct panfrost_batch *batch, unsigned rt,
|
||||
struct sysval_uniform *uniform)
|
||||
panfrost_upload_rt_conversion_sysval(struct panfrost_batch *batch,
|
||||
unsigned size_and_rt, struct sysval_uniform *uniform)
|
||||
{
|
||||
struct panfrost_context *ctx = batch->ctx;
|
||||
struct panfrost_device *dev = pan_device(ctx->base.screen);
|
||||
unsigned rt = size_and_rt & 0xF;
|
||||
unsigned size = size_and_rt >> 4;
|
||||
|
||||
if (rt < batch->key.nr_cbufs && batch->key.cbufs[rt]) {
|
||||
enum pipe_format format = batch->key.cbufs[rt]->format;
|
||||
uniform->u[0] =
|
||||
pan_blend_get_bifrost_desc(dev, format, rt, 32) >> 32;
|
||||
pan_blend_get_bifrost_desc(dev, format, rt, size) >> 32;
|
||||
} else {
|
||||
pan_pack(&uniform->u[0], BIFROST_INTERNAL_CONVERSION, cfg)
|
||||
cfg.memory_format = dev->formats[PIPE_FORMAT_NONE].hw;
|
||||
|
||||
@@ -920,6 +920,7 @@ static void
|
||||
bi_emit_ld_tile(bi_builder *b, nir_intrinsic_instr *instr)
|
||||
{
|
||||
unsigned rt = b->shader->inputs->blend.rt;
|
||||
unsigned size = nir_dest_bit_size(instr->dest);
|
||||
|
||||
/* Get the render target */
|
||||
if (!b->shader->inputs->is_blend) {
|
||||
@@ -943,7 +944,7 @@ bi_emit_ld_tile(bi_builder *b, nir_intrinsic_instr *instr)
|
||||
|
||||
bi_index desc = b->shader->inputs->is_blend ?
|
||||
bi_imm_u32(b->shader->inputs->blend.bifrost_blend_desc >> 32) :
|
||||
bi_load_sysval(b, PAN_SYSVAL(RT_CONVERSION, rt), 1, 0);
|
||||
bi_load_sysval(b, PAN_SYSVAL(RT_CONVERSION, rt | (size << 4)), 1, 0);
|
||||
|
||||
uint32_t indices = 0;
|
||||
memcpy(&indices, &pix, sizeof(indices));
|
||||
|
||||
Reference in New Issue
Block a user