From 5169dfd1fdeb8dee2f621b45ca73093b88f0296d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 28 Oct 2020 12:59:24 +0100 Subject: [PATCH] nir/lower_tex: clarify nir_lower_tex_options indexing This doesn't matter too much on OpenGL as texture id and sampler id are the same, but become relevant if using the lowering for Vulkan. Reviewed-by: Iago Toral Quiroga Part-of: --- src/compiler/nir/nir.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 7cf6a85eefe..397e4f0a41a 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -4739,10 +4739,16 @@ typedef struct nir_lower_tex_options { /* A swizzle for each texture. Values 0-3 represent x, y, z, or w swizzles * while 4 and 5 represent 0 and 1 respectively. + * + * Indexed by texture-id. */ uint8_t swizzles[32][4]; - /* Can be used to scale sampled values in range required by the format. */ + /* Can be used to scale sampled values in range required by the + * format. + * + * Indexed by texture-id. + */ float scale_factors[32]; /** @@ -4828,6 +4834,11 @@ typedef struct nir_lower_tex_options { */ bool lower_tg4_offsets; + /** + * To lower packed sampler return formats. + * + * Indexed by sampler-id. + */ enum nir_lower_tex_packing lower_tex_packing[32]; } nir_lower_tex_options;