From c3ea2f8d20f0bc3371ee0886fe353b8ee2f27cb7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 18 May 2023 21:45:45 -0400 Subject: [PATCH] nir: Document extra image source I was scratching my head about this for a few minutes until I found the answer in spirv_to_nir. Hopefully this saves someone else some head scratching in turn. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Faith Ekstrand Part-of: --- src/compiler/nir/nir_intrinsics.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index b88ab97..aca5d95 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -641,6 +641,9 @@ atomic3("atomic_counter_comp_swap") # argument with the value to be written, and image atomic operations take # either one or two additional scalar arguments with the same meaning as in # the ARB_shader_image_load_store specification. +# +# The last source of many image intrinsics is the LOD. This source is zero +# unless e.g. SPV_AMD_shader_image_load_store_lod is supported. def image(name, src_comp=[], extra_indices=[], **kwargs): intrinsic("image_deref_" + name, src_comp=[-1] + src_comp, indices=[IMAGE_DIM, IMAGE_ARRAY, FORMAT, ACCESS] + extra_indices, **kwargs) -- 2.7.4