summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-12-15 12:37:42 -0800
committerEric Anholt <[email protected]>2014-12-15 14:33:05 -0800
commit1b486b52aca79d388bd453b6966a6ecf9e80bc0b (patch)
treea2fe56fdb0c58c44d098813a76c7c6feae167a01 /src/gallium/drivers/vc4
parent48a2154520351a22fc860efcdaa4329a51d29c8d (diff)
vc4: Add support for 32-bit signed norm/scaled vertex attrs.
32-bit unsigned would require some adjustments to handle values >= 0x80000000.
Diffstat (limited to 'src/gallium/drivers/vc4')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c10
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c8
2 files changed, 18 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)) {
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index 62912d84eb6..3d5370b4764 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -346,6 +346,14 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen,
case PIPE_FORMAT_R32G32B32_FLOAT:
case PIPE_FORMAT_R32G32_FLOAT:
case PIPE_FORMAT_R32_FLOAT:
+ case PIPE_FORMAT_R32G32B32A32_SNORM:
+ case PIPE_FORMAT_R32G32B32_SNORM:
+ case PIPE_FORMAT_R32G32_SNORM:
+ case PIPE_FORMAT_R32_SNORM:
+ case PIPE_FORMAT_R32G32B32A32_SSCALED:
+ case PIPE_FORMAT_R32G32B32_SSCALED:
+ case PIPE_FORMAT_R32G32_SSCALED:
+ case PIPE_FORMAT_R32_SSCALED:
case PIPE_FORMAT_R16G16B16A16_UNORM:
case PIPE_FORMAT_R16G16B16_UNORM:
case PIPE_FORMAT_R16G16_UNORM: