From 9e8135e9361d83934d1a1979df497b8760fd1384 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sun, 4 Jun 2023 07:31:56 +0800 Subject: [PATCH] compiler: Remove the need include "util/glheader.h" and "util/ralloc.h" in glsl_types.h These includes can be moved into .cpp files and down-stream headers Reviewed-by: Caio Oliveira Signed-off-by: Yonggang Luo Part-of: --- src/compiler/glsl/ir.h | 1 + src/compiler/glsl_types.cpp | 6 ++++-- src/compiler/glsl_types.h | 11 +++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h index d3b83f5..ded5656 100644 --- a/src/compiler/glsl/ir.h +++ b/src/compiler/glsl/ir.h @@ -35,6 +35,7 @@ #include "list.h" #include "ir_visitor.h" #include "ir_hierarchical_visitor.h" +#include "util/glheader.h" #ifdef __cplusplus diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index 03bb16b..d639aa3 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -24,8 +24,10 @@ #include #include "glsl_types.h" #include "util/compiler.h" +#include "util/glheader.h" #include "util/hash_table.h" #include "util/macros.h" +#include "util/ralloc.h" #include "util/u_math.h" #include "util/u_string.h" @@ -44,7 +46,7 @@ hash_table *glsl_type::subroutine_types = NULL; */ static uint32_t glsl_type_users = 0; -glsl_type::glsl_type(GLenum gl_type, +glsl_type::glsl_type(uint32_t gl_type, glsl_base_type base_type, unsigned vector_elements, unsigned matrix_columns, const char *name, unsigned explicit_stride, bool row_major, @@ -82,7 +84,7 @@ glsl_type::glsl_type(GLenum gl_type, memset(& fields, 0, sizeof(fields)); } -glsl_type::glsl_type(GLenum gl_type, glsl_base_type base_type, +glsl_type::glsl_type(uint32_t gl_type, glsl_base_type base_type, enum glsl_sampler_dim dim, bool shadow, bool array, glsl_base_type type, const char *name) : gl_type(gl_type), diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h index 9173325..3454078 100644 --- a/src/compiler/glsl_types.h +++ b/src/compiler/glsl_types.h @@ -36,11 +36,6 @@ #include "util/macros.h" #include "util/simple_mtx.h" -#ifdef __cplusplus -#include "util/glheader.h" -#include "util/ralloc.h" -#endif - struct glsl_type; #ifdef __cplusplus @@ -306,7 +301,7 @@ is_gl_identifier(const char *s) #ifdef __cplusplus struct glsl_type { - GLenum gl_type; + uint32_t gl_type; glsl_base_type base_type:8; glsl_base_type sampled_type:8; /**< Type of data returned using this @@ -1268,14 +1263,14 @@ private: void *mem_ctx; /** Constructor for vector and matrix types */ - glsl_type(GLenum gl_type, + glsl_type(uint32_t gl_type, glsl_base_type base_type, unsigned vector_elements, unsigned matrix_columns, const char *name, unsigned explicit_stride = 0, bool row_major = false, unsigned explicit_alignment = 0); /** Constructor for sampler or image types */ - glsl_type(GLenum gl_type, glsl_base_type base_type, + glsl_type(uint32_t gl_type, glsl_base_type base_type, enum glsl_sampler_dim dim, bool shadow, bool array, glsl_base_type type, const char *name); -- 2.7.4