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:
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "glsl_symbol_table.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.
|
/* 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.
|
* Undefine it here to avoid collision with the lexer's THIS token.
|
||||||
|
@@ -37,8 +37,6 @@
|
|||||||
#include "util/simple_mtx.h"
|
#include "util/simple_mtx.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#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/glheader.h"
|
||||||
#include "util/ralloc.h"
|
#include "util/ralloc.h"
|
||||||
#endif
|
#endif
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "nir_types.h"
|
#include "nir_types.h"
|
||||||
#include "nir_gl_types.h"
|
#include "nir_gl_types.h"
|
||||||
#include "compiler/glsl/ir.h"
|
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
glsl_get_type_name(const glsl_type *type)
|
glsl_get_type_name(const glsl_type *type)
|
||||||
|
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#include "shader_enums.h"
|
#include "shader_enums.h"
|
||||||
#include "util/macros.h"
|
#include "util/macros.h"
|
||||||
#include "mesa/main/config.h"
|
|
||||||
|
|
||||||
#define ENUM(x) [x] = #x
|
#define ENUM(x) [x] = #x
|
||||||
#define NAME(val) ((((val) < ARRAY_SIZE(names)) && names[(val)]) ? names[(val)] : "UNKNOWN")
|
#define NAME(val) ((((val) < ARRAY_SIZE(names)) && names[(val)]) ? names[(val)] : "UNKNOWN")
|
||||||
|
@@ -32,6 +32,10 @@
|
|||||||
|
|
||||||
/* Project-wide (GL and Vulkan) maximum. */
|
/* Project-wide (GL and Vulkan) maximum. */
|
||||||
#define MAX_DRAW_BUFFERS 8
|
#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
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -1350,6 +1354,28 @@ enum PACKED gl_subgroup_size
|
|||||||
SUBGROUP_SIZE_REQUIRE_128 = 128, /**< VK_EXT_subgroup_size_control */
|
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
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
@@ -168,8 +168,6 @@
|
|||||||
#define MAX_ATOMIC_COUNTERS 4096
|
#define MAX_ATOMIC_COUNTERS 4096
|
||||||
/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
|
/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
|
||||||
#define MAX_COMBINED_ATOMIC_BUFFERS (MAX_UNIFORM_BUFFERS * 6)
|
#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
|
#define MAX_IMAGE_UNIFORMS 32
|
||||||
/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
|
/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
|
||||||
#define MAX_IMAGE_UNITS (MAX_IMAGE_UNIFORMS * 6)
|
#define MAX_IMAGE_UNITS (MAX_IMAGE_UNIFORMS * 6)
|
||||||
@@ -253,7 +251,6 @@
|
|||||||
#define MIN_FRAGMENT_INTERPOLATION_OFFSET -0.5
|
#define MIN_FRAGMENT_INTERPOLATION_OFFSET -0.5
|
||||||
#define MAX_FRAGMENT_INTERPOLATION_OFFSET 0.5
|
#define MAX_FRAGMENT_INTERPOLATION_OFFSET 0.5
|
||||||
#define FRAGMENT_INTERPOLATION_OFFSET_BITS 4
|
#define FRAGMENT_INTERPOLATION_OFFSET_BITS 4
|
||||||
#define MAX_VERTEX_STREAMS 4
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/** For GL_ARB_shader_subroutine */
|
/** For GL_ARB_shader_subroutine */
|
||||||
|
@@ -63,28 +63,6 @@ _mesa_is_api_gles2(gl_api api)
|
|||||||
#endif
|
#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
|
* Remapped color logical operations
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user