summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2021-02-16 18:11:07 -0500
committerMarge Bot <eric+marge@anholt.net>2021-02-18 21:48:22 +0000
commitfa9046b262522a3c54d49f5d2605a59f16578810 (patch)
treeec13cf990912b7599b085371156bf746ea17b150
parent7dc60fc3c8bf528ac166664477f7bb3cc7eb760f (diff)
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>
-rw-r--r--src/gallium/drivers/panfrost/pan_cmdstream.c21
-rw-r--r--src/panfrost/util/pan_ir.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index f95e6abd3ab..4dc34204d0a 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -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
@@ -966,6 +967,22 @@ 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)
+{
+ 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,
enum pipe_shader_type st)
@@ -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);
}
diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h
index 0cdd0a1bad4..5705d3b4121 100644
--- a/src/panfrost/util/pan_ir.h
+++ b/src/panfrost/util/pan_ir.h
@@ -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) \