Mesa (master): nir/lower_tex: clarify nir_lower_tex_options indexing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Nov 14 16:19:06 UTC 2020


Module: Mesa
Branch: master
Commit: 5169dfd1fdeb8dee2f621b45ca73093b88f0296d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5169dfd1fdeb8dee2f621b45ca73093b88f0296d

Author: Alejandro Piñeiro <apinheiro at igalia.com>
Date:   Wed Oct 28 12:59:24 2020 +0100

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 <itoral at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7545>

---

 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;
 



More information about the mesa-commit mailing list