summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_program.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index e37303fb69b..4b547c506f4 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1001,6 +1001,16 @@ get_channel_from_vpm(struct vc4_compile *c,
else if (chan->size == 32 &&
chan->type == UTIL_FORMAT_TYPE_FLOAT) {
return get_swizzled_channel(c, vpm_reads, swiz);
+ } else if (chan->size == 32 &&
+ chan->type == UTIL_FORMAT_TYPE_SIGNED) {
+ if (chan->normalized) {
+ return qir_FMUL(c,
+ qir_ITOF(c, vpm_reads[swiz]),
+ qir_uniform_f(c,
+ 1.0 / 0x7fffffff));
+ } else {
+ return qir_ITOF(c, vpm_reads[swiz]);
+ }
} else if (chan->size == 8 &&
(chan->type == UTIL_FORMAT_TYPE_UNSIGNED ||
chan->type == UTIL_FORMAT_TYPE_SIGNED)) {