diff options
author | Eric Anholt <[email protected]> | 2014-12-15 12:37:42 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-12-15 14:33:05 -0800 |
commit | 1b486b52aca79d388bd453b6966a6ecf9e80bc0b (patch) | |
tree | a2fe56fdb0c58c44d098813a76c7c6feae167a01 /src/gallium/drivers/vc4/vc4_program.c | |
parent | 48a2154520351a22fc860efcdaa4329a51d29c8d (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/vc4_program.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 10 |
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)) { |