mesa, compiler: Move gl_texture_index to glsl_types.h

This move is done for decouple glsl_types.h from src/mesa/*

This is achieved by move gl_texture_index from src/mesa/main/menums.h to src/compiler/shader_enums.h
And move ATOMIC_COUNTER_SIZE,MAX_VERTEX_STREAMS from src/mesa/main/config.h to src/compiler/shader_enums.h

Move include main/[config|menums].h into glsl/glsl_parser_extras.h from glsl_types.h
As now glsl_types.h should not include headers from src/mesa/*

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23420>
This commit is contained in:
Yonggang Luo
2023-06-04 06:48:50 +08:00
committed by Marge Bot
parent ab73f717d9
commit 1b836a52ea
7 changed files with 28 additions and 29 deletions

View File

@@ -32,6 +32,8 @@
#include <stdlib.h>
#include "glsl_symbol_table.h"
#include "main/config.h"
#include "main/menums.h"
/* THIS is a macro defined somewhere deep in the Windows MSVC header files.
* Undefine it here to avoid collision with the lexer's THIS token.

View File

@@ -37,8 +37,6 @@
#include "util/simple_mtx.h"
#ifdef __cplusplus
#include "mesa/main/config.h"
#include "mesa/main/menums.h" /* for gl_texture_index, C++'s enum rules are broken */
#include "util/glheader.h"
#include "util/ralloc.h"
#endif

View File

@@ -27,7 +27,6 @@
#include "nir_types.h"
#include "nir_gl_types.h"
#include "compiler/glsl/ir.h"
const char *
glsl_get_type_name(const glsl_type *type)

View File

@@ -28,7 +28,6 @@
#include "shader_enums.h"
#include "util/macros.h"
#include "mesa/main/config.h"
#define ENUM(x) [x] = #x
#define NAME(val) ((((val) < ARRAY_SIZE(names)) && names[(val)]) ? names[(val)] : "UNKNOWN")

View File

@@ -32,6 +32,10 @@
/* Project-wide (GL and Vulkan) maximum. */
#define MAX_DRAW_BUFFERS 8
/* Size of an atomic counter in bytes according to ARB_shader_atomic_counters */
#define ATOMIC_COUNTER_SIZE 4
/** For GL_ARB_gpu_shader5 */
#define MAX_VERTEX_STREAMS 4
#ifdef __cplusplus
extern "C" {
@@ -1350,6 +1354,28 @@ enum PACKED gl_subgroup_size
SUBGROUP_SIZE_REQUIRE_128 = 128, /**< VK_EXT_subgroup_size_control */
};
/**
* An index for each type of texture object. These correspond to the GL
* texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc.
* Note: the order is from highest priority to lowest priority.
*/
typedef enum
{
TEXTURE_2D_MULTISAMPLE_INDEX,
TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX,
TEXTURE_CUBE_ARRAY_INDEX,
TEXTURE_BUFFER_INDEX,
TEXTURE_2D_ARRAY_INDEX,
TEXTURE_1D_ARRAY_INDEX,
TEXTURE_EXTERNAL_INDEX,
TEXTURE_CUBE_INDEX,
TEXTURE_3D_INDEX,
TEXTURE_RECT_INDEX,
TEXTURE_2D_INDEX,
TEXTURE_1D_INDEX,
NUM_TEXTURE_TARGETS
} gl_texture_index;
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@@ -168,8 +168,6 @@
#define MAX_ATOMIC_COUNTERS 4096
/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
#define MAX_COMBINED_ATOMIC_BUFFERS (MAX_UNIFORM_BUFFERS * 6)
/* Size of an atomic counter in bytes according to ARB_shader_atomic_counters */
#define ATOMIC_COUNTER_SIZE 4
#define MAX_IMAGE_UNIFORMS 32
/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
#define MAX_IMAGE_UNITS (MAX_IMAGE_UNIFORMS * 6)
@@ -253,7 +251,6 @@
#define MIN_FRAGMENT_INTERPOLATION_OFFSET -0.5
#define MAX_FRAGMENT_INTERPOLATION_OFFSET 0.5
#define FRAGMENT_INTERPOLATION_OFFSET_BITS 4
#define MAX_VERTEX_STREAMS 4
/*@}*/
/** For GL_ARB_shader_subroutine */

View File

@@ -63,28 +63,6 @@ _mesa_is_api_gles2(gl_api api)
#endif
}
/**
* An index for each type of texture object. These correspond to the GL
* texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc.
* Note: the order is from highest priority to lowest priority.
*/
typedef enum
{
TEXTURE_2D_MULTISAMPLE_INDEX,
TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX,
TEXTURE_CUBE_ARRAY_INDEX,
TEXTURE_BUFFER_INDEX,
TEXTURE_2D_ARRAY_INDEX,
TEXTURE_1D_ARRAY_INDEX,
TEXTURE_EXTERNAL_INDEX,
TEXTURE_CUBE_INDEX,
TEXTURE_3D_INDEX,
TEXTURE_RECT_INDEX,
TEXTURE_2D_INDEX,
TEXTURE_1D_INDEX,
NUM_TEXTURE_TARGETS
} gl_texture_index;
/**
* Remapped color logical operations
*