spirv: fix bug when OpSpecConstantOp calls a conversion
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Mon, 20 Nov 2017 12:12:12 +0000 (13:12 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Thu, 7 Dec 2017 09:19:34 +0000 (10:19 +0100)
commit392638d6b549dbed85ed2a82fa41d38336ac9938
tree2e6375f086745837fbd16aa6e53389a625e001a0
parent67ec314347ed03738cb4eece64c7b25b4ab7d3c8
spirv: fix bug when OpSpecConstantOp calls a conversion

In that case, nir_eval_const_opcode() will evaluate the conversion
but as it was using destination's bit_size, the resulting
value was just a cast of the source constant value. By passing the
source's bit size, it does the conversion properly.

Fixes:

dEQP-VK.spirv_assembly.instruction.*.opspecconstantop.*convert*

v2:
- Remove invalid conversion op cases.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/spirv/spirv_to_nir.c