Skip to content

turnip: enable shaderInt16

Danylo Piliaiev requested to merge Danil/mesa:turnip/feature/shaderInt16 into master

16b imul is translated into 24b mul. I didn't create a new nir opcode for it, since it's just 16 imul.

Regarding the tests, it passes:

dEQP-VK.spirv_assembly.*u16*
dEQP-VK.spirv_assembly.*i16*

on a650. Unfortunately, these tests at the moment require 16b storage, so they can't run on a630. We would likely remove that requirement later on.

With nir_lower_idiv there is one discrepancy in idiv/imod between CPU and GPU, it is for (-32768, -1):

  • i16(-32768) / i16(-1) = i16(32767), on cpu it is -32768
  • i16(-32768) % i16(-1) = -1, on cpu it is 0

However this should be fine per spec GL_EXT_shader_explicit_arithmetic_types:

Division and multiplication operations resulting in overflow or underflow
will not cause any exception but will result in an undefined value.
Edited by Danylo Piliaiev

Merge request reports