Revert "mesa, compiler: Move gl_texture_index to glsl_types.h"

This reverts commit 1b836a52ea.  This
patch, while claiming to decouple things, actually increases coupling
because it leaks two OpenGL state tracker limits and an OpenGL state
tracker fixed binding enum into the entire compiler.  Nothing wants to
know these outside the OpenGL state tracker and the GL-specific compiler
passes.  Put them back where they were.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24491>
This commit is contained in:
Faith Ekstrand
2023-08-04 06:02:57 -05:00
committed by Marge Bot
parent e331245541
commit b89a48e00d
5 changed files with 30 additions and 28 deletions
-2
View File
@@ -32,8 +32,6 @@
#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.
+5
View File
@@ -36,6 +36,11 @@
#include "util/macros.h"
#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 */
#endif
struct glsl_type;
#ifdef __cplusplus
-26
View File
@@ -32,10 +32,6 @@
/* 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" {
@@ -1352,28 +1348,6 @@ enum 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;
/* Ordered from narrower to wider scope. */
typedef enum {
SCOPE_NONE,
+3
View File
@@ -168,6 +168,8 @@
#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)
@@ -251,6 +253,7 @@
#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 */
+22
View File
@@ -63,6 +63,28 @@ _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
*