Skip to content
  • Iago Toral's avatar
    i965/fs: support doubles with UBO loads · b86d4780
    Iago Toral authored and Samuel Iglesias Gonsálvez's avatar Samuel Iglesias Gonsálvez committed
    
    
    UBO loads with constant offset use the UNIFORM_PULL_CONSTANT_LOAD
    instruction, which reads 16 bytes (a vec4) of data from memory. For dvec
    types this only provides components x and y. Thus, if we are reading
    more than 2 components we need to issue a second load at offset+16 to
    read the next 16-byte chunk with components w and z.
    
    UBO loads with non-constant offset emit a load for each component
    in the vector (and rely in CSE to fix redundant loads), so we only
    need to consider the size of the data type when computing the offset
    of each element in a vector.
    
    v2 (Sam):
    - Adapt the code to use component() (Curro).
    
    v3 (Sam):
    - Use type_sz(dest.type) in VARYING_PULL_CONSTANT_LOAD() call (Curro).
    - Add asserts to ensure std140 vector alignment rules are followed
      (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>
    b86d4780