• Jason Ekstrand's avatar
    nir: Add an LOD parameter to image_*_size · 5604c310
    Jason Ekstrand authored
    The OpenCL image_width/height/depth functions have variants which can
    take an LOD parameter.  More importantly, LLVM-SPIRV-Translator always
    generates OpImageQuerySizeLod even if the LOD is guaranteed to be zero.
    Given that over half the hardware out there has an LOD field for image
    size queries (based on a rudimentary scan through their NIR -> whatever
    code), we may as well just add the source to the NIR intrinsic.  If this
    is ever a problem for anyone, the lowering is pretty trivial.
    I've also added asserts to everyone's drivers that should alert them if
    they ever see an LOD other than zero.  This will never happen with GL or
    Vulkan so there's no need for panic.
    Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
brw_fs_nir.cpp 218 KB