Module: Mesa
Branch: main
Commit: 4024d0c196c1df2118e01ae29b3d1dc14aada145
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4024d0c196c1df2118e01ae29b3d1dc14aada145

Author: Jani Nikula <[email protected]>
Date:   Thu Aug 17 20:56:26 2023 +0300

nir: add names to some typedef'd structs/enums

In order to document "typedef struct { ... } T;" as a struct in
hawkmoth, the structs need to have names. Similar for enums.

Note: This is no longer required with Hawkmoth 0.16.0+ and Clang 16 and
later. With the next Hawkmoth release, this should be fixed also for
Clang 15 and earlier.

Reviewed-by: Erik Faye-Lund <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>

---

 src/compiler/nir/nir.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 16be72b7376..d94a070f95c 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1162,7 +1162,7 @@ nir_is_sequential_comp_swizzle(uint8_t *swiz, unsigned 
nr_comp)
    return true;
 }
 
-typedef struct {
+typedef struct nir_alu_src {
    /** Base source */
    nir_src src;
 
@@ -2115,7 +2115,7 @@ nir_intrinsic_is_ray_query(nir_intrinsic_op intrinsic)
 }
 
 /** Texture instruction source type */
-typedef enum {
+typedef enum nir_tex_src_type {
    /** Texture coordinate
     *
     * Must have nir_tex_instr::coord_components components.
@@ -2252,7 +2252,7 @@ typedef enum {
 } nir_tex_src_type;
 
 /** A texture instruction source */
-typedef struct {
+typedef struct nir_tex_src {
    /** Base source */
    nir_src src;
 
@@ -2261,7 +2261,7 @@ typedef struct {
 } nir_tex_src;
 
 /** Texture instruction opcode */
-typedef enum {
+typedef enum nir_texop {
    nir_texop_tex,                     /**< Regular texture look-up */
    nir_texop_txb,                     /**< Texture look-up with LOD bias */
    nir_texop_txl,                     /**< Texture look-up with explicit LOD */
@@ -2289,7 +2289,7 @@ typedef enum {
 } nir_texop;
 
 /** Represents a texture instruction */
-typedef struct {
+typedef struct nir_tex_instr {
    /** Base instruction */
    nir_instr instr;
 

Reply via email to