Skip to content
  • Iago Toral's avatar
    i965/fs: fix pull constant load component selection for doubles · 58f1804c
    Iago Toral authored and Samuel Iglesias Gonsálvez's avatar Samuel Iglesias Gonsálvez committed
    
    
    UNIFORM_PULL_CONSTANT_LOAD is used to load a contiguous vec4 starting at a
    constant offset that is 16-byte aligned. If we need to access an unaligned
    offset we emit a load with an aligned offset and use the remaining constant
    offset to select the component into the vec4 result that we are interested
    in. This component must be computed in units of the type size, since that
    is what fs_reg::set_smear expects.
    
    This patch does this change in the two places where we use this message:
    In demote_pull_constants when we lower uniform access with constant offset
    into the pull constant buffer and in UBO loads with constant offset.
    
    v2 (Sam):
    - Fix set_smear() in fs_visitor::lower_constant_loads(), take into account
    source type instead and remove MAX2 (Curro).
    - Improve changes to nir_intrinsic_load_ubo case in nir_emit_intrinsic()
    (Curro).
    
    Signed-off-by: default avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
    Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: default avatarFrancisco Jerez <currojerez@riseup.net>
    58f1804c