spirv: fix OpBitcast when the src and dst bitsize are different (v3)
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 7 Jun 2017 21:12:05 +0000 (14:12 -0700)
committerConnor Abbott <cwabbott0@gmail.com>
Mon, 3 Jul 2017 18:58:50 +0000 (11:58 -0700)
commit196e6b60b1e392c5e55c07a9f9b4e85dad52fb66
treef0eaa840cd4953069bd3a27d71a5796c6ee7980a
parent6158c0b5d8b6367a46acbe2fe20357210422c96f
spirv: fix OpBitcast when the src and dst bitsize are different (v3)

Before, we were just implementing it with a move, which is incorrect
when the source and destination have different bitsizes. To implement
it properly, we need to use the 64-bit pack/unpack opcodes. Since
glslang uses OpBitcast to implement packInt2x32 and unpackInt2x32, this
should fix them on anv (and radv once we enable the int64 capability).

v2: make supporting non-32/64 bit easier (Jason)
v3: add another assert (Jason)

Fixes: b3135c3c ("anv: Advertise shaderInt64 on Broadwell and above")
Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/spirv/vtn_alu.c