panfrost: Add RT conversion sysval

Contains the InternalConversionDescriptor corresponding to the selected
render target, ready to be fed into LD_TILE.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>
This commit is contained in:
Alyssa Rosenzweig 2021-02-16 18:11:07 -05:00 committed by Marge Bot
parent 7dc60fc3c8
commit fa9046b262
2 changed files with 22 additions and 0 deletions

View file

@ -36,6 +36,7 @@
#include "pan_job.h"
#include "pan_shader.h"
#include "pan_texture.h"
#include "pan_blend_shaders.h"
/* If a BO is accessed for a particular shader stage, will it be in the primary
* batch (vertex/tiler) or the secondary batch (fragment)? Anything but
@ -965,6 +966,22 @@ panfrost_upload_multisampled_sysval(struct panfrost_batch *batch,
uniform->u[0] = samples > 1;
}
static void
panfrost_upload_rt_conversion_sysval(struct panfrost_batch *batch, unsigned rt,
struct sysval_uniform *uniform)
{
struct panfrost_context *ctx = batch->ctx;
struct panfrost_device *dev = pan_device(ctx->base.screen);
if (rt < batch->key.nr_cbufs) {
enum pipe_format format = batch->key.cbufs[rt]->format;
uniform->u[0] = bifrost_get_blend_desc(dev, format, rt, 32) >> 32;
} else {
pan_pack(&uniform->u[0], BIFROST_INTERNAL_CONVERSION, cfg)
cfg.memory_format = dev->formats[PIPE_FORMAT_NONE].hw;
}
}
static void
panfrost_upload_sysvals(struct panfrost_batch *batch, void *buf,
struct panfrost_shader_state *ss,
@ -1024,6 +1041,10 @@ panfrost_upload_sysvals(struct panfrost_batch *batch, void *buf,
panfrost_upload_multisampled_sysval(batch,
&uniforms[i]);
break;
case PAN_SYSVAL_RT_CONVERSION:
panfrost_upload_rt_conversion_sysval(batch,
PAN_SYSVAL_ID(sysval), &uniforms[i]);
break;
default:
assert(0);
}

View file

@ -55,6 +55,7 @@ enum {
PAN_SYSVAL_IMAGE_SIZE = 10,
PAN_SYSVAL_SAMPLE_POSITIONS = 11,
PAN_SYSVAL_MULTISAMPLED = 12,
PAN_SYSVAL_RT_CONVERSION = 13,
};
#define PAN_TXS_SYSVAL_ID(texidx, dim, is_array) \