Skip to content
  • Karol Herbst's avatar
    nir: add support for gather offsets · 71c66c25
    Karol Herbst authored and Karol Herbst's avatar Karol Herbst committed
    
    
    Values inside the offsets parameter of textureGatherOffsets are required to be
    constants in the range of [GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET,
    GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET].
    
    As this range is never outside [-32, 31] for all existing drivers inside mesa,
    we can simply store the offsets as a int8_t[4][2] array inside nir_tex_instr.
    
    Right now only Nvidia hardware supports this in hardware, so we can turn this
    on inside Nouveau for the NIR path as it is already enabled with the TGSI one.
    
    v2: use memcpy instead of for loops
        add missing bits to nir_instr_set
        don't show offsets if they are all 0
    v3: default offsets aren't all 0
    v4: rename offsets -> tg4_offsets
        rename nir_tex_instr_has_explicit_offsets -> nir_tex_instr_has_explicit_tg4_offsets
    
    Signed-off-by: Karol Herbst's avatarKarol Herbst <kherbst@redhat.com>
    71c66c25