aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-07-01 19:49:51 -0700
committerAlyssa Rosenzweig <[email protected]>2019-07-10 06:12:05 -0700
commit64df54d8944276687685d6d1261dd5448608b0f3 (patch)
tree82264fbae1532cda62bcd405c8650daf84263127
parentf8b18a4277cc96b2048c9b74fb0d39e2112bb4c1 (diff)
panfrost/midgard: Fix fp16 embedded constants
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_schedule.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_schedule.c b/src/gallium/drivers/panfrost/midgard/midgard_schedule.c
index caa29b7a2e4..ebbabae10bf 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_schedule.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_schedule.c
@@ -272,6 +272,25 @@ schedule_bundle(compiler_context *ctx, midgard_block *block, midgard_instruction
bundle.has_blend_constant = 1;
bundle.has_embedded_constants = 1;
+ } else if (ains->has_constants && ains->alu.reg_mode == midgard_reg_mode_16) {
+ /* TODO: DRY with the analysis pass */
+
+ if (bundle.has_blend_constant)
+ break;
+
+ if (constant_count)
+ break;
+
+ /* TODO: Fix packing XXX */
+ uint16_t *bundles = (uint16_t *) bundle.constants;
+ uint32_t *constants = (uint32_t *) ains->constants;
+
+ /* Copy them wholesale */
+ for (unsigned i = 0; i < 4; ++i)
+ bundles[i] = constants[i];
+
+ bundle.has_embedded_constants = true;
+ constant_count = 4;
} else if (ains->has_constants) {
/* By definition, blend constants conflict with
* everything, so if there are already