From: Rob Clark Date: Thu, 8 Oct 2015 22:19:00 +0000 (-0400) Subject: glsl: move shader_enums into nir X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c9b982b72d443b138cfbded2f40350771c0bb321;p=mesa.git glsl: move shader_enums into nir First step towards inverting the dependency between glsl and nir (so nir can be used without glsl). Also solves this issue with 'make distclean' Making distclean in mesa make[2]: Entering directory '/mnt/sdb1/Src64/Mesa-git/mesa/src/mesa' Makefile:2486: ../glsl/.deps/shader_enums.Plo: No such file or directory make[2]: *** No rule to make target '../glsl/.deps/shader_enums.Plo'. Stop. make[2]: Leaving directory '/mnt/sdb1/Src64/Mesa-git/mesa/src/mesa' Makefile:684: recipe for target 'distclean-recursive' failed make[1]: *** [distclean-recursive] Error 1 make[1]: Leaving directory '/mnt/sdb1/Src64/Mesa-git/mesa/src' Makefile:615: recipe for target 'distclean-recursive' failed make: *** [distclean-recursive] Error 1 Reported-by: Andy Furniss Reviewed-by: Emil Velikov Signed-off-by: Rob Clark --- diff --git a/src/Makefile.am b/src/Makefile.am index 9e15cca5ea4..0d49bcd19ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,7 +62,6 @@ AM_CPPFLAGS = \ noinst_LTLIBRARIES = libglsl_util.la libglsl_util_la_SOURCES = \ - glsl/shader_enums.c \ mesa/main/imports.c \ mesa/program/prog_hash_table.c \ mesa/program/symbol_table.c \ diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index cf43ef2506f..0539cfc16a1 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -27,7 +27,7 @@ #include "glsl/nir/nir_control_flow.h" #include "glsl/nir/nir_builder.h" #include "glsl/list.h" -#include "glsl/shader_enums.h" +#include "glsl/nir/shader_enums.h" #include "nir/tgsi_to_nir.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c index 7eddbdd3825..8c9234b3847 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c @@ -36,7 +36,6 @@ #include "tgsi/tgsi_strings.h" #include "nir/tgsi_to_nir.h" -#include "glsl/shader_enums.h" #include "freedreno_util.h" diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.h b/src/gallium/drivers/freedreno/ir3/ir3_nir.h index f3d3075e6a6..9950782dc38 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_nir.h +++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.h @@ -30,6 +30,7 @@ #define IR3_NIR_H_ #include "glsl/nir/nir.h" +#include "glsl/nir/shader_enums.h" bool ir3_nir_lower_if_else(nir_shader *shader); diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.h b/src/gallium/drivers/freedreno/ir3/ir3_shader.h index 6dc0ce1133f..7e2c27d9765 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.h +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.h @@ -30,7 +30,7 @@ #define IR3_SHADER_H_ #include "pipe/p_state.h" -#include "glsl/shader_enums.h" +#include "glsl/nir/shader_enums.h" #include "ir3.h" #include "disasm.h" diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources index bb8bddc69af..436949cd760 100644 --- a/src/glsl/Makefile.sources +++ b/src/glsl/Makefile.sources @@ -80,7 +80,9 @@ NIR_FILES = \ nir/nir_vla.h \ nir/nir_worklist.c \ nir/nir_worklist.h \ - nir/nir_types.cpp + nir/nir_types.cpp \ + nir/shader_enums.h \ + nir/shader_enums.c # libglsl @@ -204,8 +206,7 @@ LIBGLSL_FILES = \ opt_vectorize.cpp \ program.h \ s_expression.cpp \ - s_expression.h \ - shader_enums.h + s_expression.h # glsl_compiler diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index befc7fce724..112c6b5412a 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -35,7 +35,7 @@ #include "util/set.h" #include "util/bitset.h" #include "nir_types.h" -#include "glsl/shader_enums.h" +#include "shader_enums.h" #include #include "nir_opcodes.h" diff --git a/src/glsl/nir/shader_enums.c b/src/glsl/nir/shader_enums.c new file mode 100644 index 00000000000..3722475731b --- /dev/null +++ b/src/glsl/nir/shader_enums.c @@ -0,0 +1,205 @@ +/* + * Mesa 3-D graphics library + * + * Copyright © 2015 Red Hat + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Rob Clark + */ + +#include "shader_enums.h" +#include "util/macros.h" + +#define ENUM(x) [x] = #x +#define NAME(val) ((((val) < ARRAY_SIZE(names)) && names[(val)]) ? names[(val)] : "UNKNOWN") + +const char * gl_shader_stage_name(gl_shader_stage stage) +{ + static const char *names[] = { + ENUM(MESA_SHADER_VERTEX), + ENUM(MESA_SHADER_TESS_CTRL), + ENUM(MESA_SHADER_TESS_EVAL), + ENUM(MESA_SHADER_GEOMETRY), + ENUM(MESA_SHADER_FRAGMENT), + ENUM(MESA_SHADER_COMPUTE), + }; + return NAME(stage); +} + +const char * gl_vert_attrib_name(gl_vert_attrib attrib) +{ + static const char *names[] = { + ENUM(VERT_ATTRIB_POS), + ENUM(VERT_ATTRIB_WEIGHT), + ENUM(VERT_ATTRIB_NORMAL), + ENUM(VERT_ATTRIB_COLOR0), + ENUM(VERT_ATTRIB_COLOR1), + ENUM(VERT_ATTRIB_FOG), + ENUM(VERT_ATTRIB_COLOR_INDEX), + ENUM(VERT_ATTRIB_EDGEFLAG), + ENUM(VERT_ATTRIB_TEX0), + ENUM(VERT_ATTRIB_TEX1), + ENUM(VERT_ATTRIB_TEX2), + ENUM(VERT_ATTRIB_TEX3), + ENUM(VERT_ATTRIB_TEX4), + ENUM(VERT_ATTRIB_TEX5), + ENUM(VERT_ATTRIB_TEX6), + ENUM(VERT_ATTRIB_TEX7), + ENUM(VERT_ATTRIB_POINT_SIZE), + ENUM(VERT_ATTRIB_GENERIC0), + ENUM(VERT_ATTRIB_GENERIC1), + ENUM(VERT_ATTRIB_GENERIC2), + ENUM(VERT_ATTRIB_GENERIC3), + ENUM(VERT_ATTRIB_GENERIC4), + ENUM(VERT_ATTRIB_GENERIC5), + ENUM(VERT_ATTRIB_GENERIC6), + ENUM(VERT_ATTRIB_GENERIC7), + ENUM(VERT_ATTRIB_GENERIC8), + ENUM(VERT_ATTRIB_GENERIC9), + ENUM(VERT_ATTRIB_GENERIC10), + ENUM(VERT_ATTRIB_GENERIC11), + ENUM(VERT_ATTRIB_GENERIC12), + ENUM(VERT_ATTRIB_GENERIC13), + ENUM(VERT_ATTRIB_GENERIC14), + ENUM(VERT_ATTRIB_GENERIC15), + }; + return NAME(attrib); +} + +const char * gl_varying_slot_name(gl_varying_slot slot) +{ + static const char *names[] = { + ENUM(VARYING_SLOT_POS), + ENUM(VARYING_SLOT_COL0), + ENUM(VARYING_SLOT_COL1), + ENUM(VARYING_SLOT_FOGC), + ENUM(VARYING_SLOT_TEX0), + ENUM(VARYING_SLOT_TEX1), + ENUM(VARYING_SLOT_TEX2), + ENUM(VARYING_SLOT_TEX3), + ENUM(VARYING_SLOT_TEX4), + ENUM(VARYING_SLOT_TEX5), + ENUM(VARYING_SLOT_TEX6), + ENUM(VARYING_SLOT_TEX7), + ENUM(VARYING_SLOT_PSIZ), + ENUM(VARYING_SLOT_BFC0), + ENUM(VARYING_SLOT_BFC1), + ENUM(VARYING_SLOT_EDGE), + ENUM(VARYING_SLOT_CLIP_VERTEX), + ENUM(VARYING_SLOT_CLIP_DIST0), + ENUM(VARYING_SLOT_CLIP_DIST1), + ENUM(VARYING_SLOT_PRIMITIVE_ID), + ENUM(VARYING_SLOT_LAYER), + ENUM(VARYING_SLOT_VIEWPORT), + ENUM(VARYING_SLOT_FACE), + ENUM(VARYING_SLOT_PNTC), + ENUM(VARYING_SLOT_TESS_LEVEL_OUTER), + ENUM(VARYING_SLOT_TESS_LEVEL_INNER), + ENUM(VARYING_SLOT_VAR0), + ENUM(VARYING_SLOT_VAR1), + ENUM(VARYING_SLOT_VAR2), + ENUM(VARYING_SLOT_VAR3), + ENUM(VARYING_SLOT_VAR4), + ENUM(VARYING_SLOT_VAR5), + ENUM(VARYING_SLOT_VAR6), + ENUM(VARYING_SLOT_VAR7), + ENUM(VARYING_SLOT_VAR8), + ENUM(VARYING_SLOT_VAR9), + ENUM(VARYING_SLOT_VAR10), + ENUM(VARYING_SLOT_VAR11), + ENUM(VARYING_SLOT_VAR12), + ENUM(VARYING_SLOT_VAR13), + ENUM(VARYING_SLOT_VAR14), + ENUM(VARYING_SLOT_VAR15), + ENUM(VARYING_SLOT_VAR16), + ENUM(VARYING_SLOT_VAR17), + ENUM(VARYING_SLOT_VAR18), + ENUM(VARYING_SLOT_VAR19), + ENUM(VARYING_SLOT_VAR20), + ENUM(VARYING_SLOT_VAR21), + ENUM(VARYING_SLOT_VAR22), + ENUM(VARYING_SLOT_VAR23), + ENUM(VARYING_SLOT_VAR24), + ENUM(VARYING_SLOT_VAR25), + ENUM(VARYING_SLOT_VAR26), + ENUM(VARYING_SLOT_VAR27), + ENUM(VARYING_SLOT_VAR28), + ENUM(VARYING_SLOT_VAR29), + ENUM(VARYING_SLOT_VAR30), + ENUM(VARYING_SLOT_VAR31), + }; + return NAME(slot); +} + +const char * gl_system_value_name(gl_system_value sysval) +{ + static const char *names[] = { + ENUM(SYSTEM_VALUE_VERTEX_ID), + ENUM(SYSTEM_VALUE_INSTANCE_ID), + ENUM(SYSTEM_VALUE_VERTEX_ID_ZERO_BASE), + ENUM(SYSTEM_VALUE_BASE_VERTEX), + ENUM(SYSTEM_VALUE_INVOCATION_ID), + ENUM(SYSTEM_VALUE_FRONT_FACE), + ENUM(SYSTEM_VALUE_SAMPLE_ID), + ENUM(SYSTEM_VALUE_SAMPLE_POS), + ENUM(SYSTEM_VALUE_SAMPLE_MASK_IN), + ENUM(SYSTEM_VALUE_TESS_COORD), + ENUM(SYSTEM_VALUE_VERTICES_IN), + ENUM(SYSTEM_VALUE_PRIMITIVE_ID), + ENUM(SYSTEM_VALUE_TESS_LEVEL_OUTER), + ENUM(SYSTEM_VALUE_TESS_LEVEL_INNER), + ENUM(SYSTEM_VALUE_LOCAL_INVOCATION_ID), + ENUM(SYSTEM_VALUE_WORK_GROUP_ID), + ENUM(SYSTEM_VALUE_VERTEX_CNT), + }; + return NAME(sysval); +} + +const char * glsl_interp_qualifier_name(enum glsl_interp_qualifier qual) +{ + static const char *names[] = { + ENUM(INTERP_QUALIFIER_NONE), + ENUM(INTERP_QUALIFIER_SMOOTH), + ENUM(INTERP_QUALIFIER_FLAT), + ENUM(INTERP_QUALIFIER_NOPERSPECTIVE), + }; + return NAME(qual); +} + +const char * gl_frag_result_name(gl_frag_result result) +{ + static const char *names[] = { + ENUM(FRAG_RESULT_DEPTH), + ENUM(FRAG_RESULT_STENCIL), + ENUM(FRAG_RESULT_COLOR), + ENUM(FRAG_RESULT_SAMPLE_MASK), + ENUM(FRAG_RESULT_DATA0), + ENUM(FRAG_RESULT_DATA1), + ENUM(FRAG_RESULT_DATA2), + ENUM(FRAG_RESULT_DATA3), + ENUM(FRAG_RESULT_DATA4), + ENUM(FRAG_RESULT_DATA5), + ENUM(FRAG_RESULT_DATA6), + ENUM(FRAG_RESULT_DATA7), + }; + return NAME(result); +} diff --git a/src/glsl/nir/shader_enums.h b/src/glsl/nir/shader_enums.h new file mode 100644 index 00000000000..2a5d2c5bfa7 --- /dev/null +++ b/src/glsl/nir/shader_enums.h @@ -0,0 +1,476 @@ +/* + * Mesa 3-D graphics library + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef SHADER_ENUMS_H +#define SHADER_ENUMS_H + +/** + * Shader stages. Note that these will become 5 with tessellation. + * + * The order must match how shaders are ordered in the pipeline. + * The GLSL linker assumes that if i - */ - -#include "glsl/shader_enums.h" -#include "util/macros.h" - -#define ENUM(x) [x] = #x -#define NAME(val) ((((val) < ARRAY_SIZE(names)) && names[(val)]) ? names[(val)] : "UNKNOWN") - -const char * gl_shader_stage_name(gl_shader_stage stage) -{ - static const char *names[] = { - ENUM(MESA_SHADER_VERTEX), - ENUM(MESA_SHADER_TESS_CTRL), - ENUM(MESA_SHADER_TESS_EVAL), - ENUM(MESA_SHADER_GEOMETRY), - ENUM(MESA_SHADER_FRAGMENT), - ENUM(MESA_SHADER_COMPUTE), - }; - return NAME(stage); -} - -const char * gl_vert_attrib_name(gl_vert_attrib attrib) -{ - static const char *names[] = { - ENUM(VERT_ATTRIB_POS), - ENUM(VERT_ATTRIB_WEIGHT), - ENUM(VERT_ATTRIB_NORMAL), - ENUM(VERT_ATTRIB_COLOR0), - ENUM(VERT_ATTRIB_COLOR1), - ENUM(VERT_ATTRIB_FOG), - ENUM(VERT_ATTRIB_COLOR_INDEX), - ENUM(VERT_ATTRIB_EDGEFLAG), - ENUM(VERT_ATTRIB_TEX0), - ENUM(VERT_ATTRIB_TEX1), - ENUM(VERT_ATTRIB_TEX2), - ENUM(VERT_ATTRIB_TEX3), - ENUM(VERT_ATTRIB_TEX4), - ENUM(VERT_ATTRIB_TEX5), - ENUM(VERT_ATTRIB_TEX6), - ENUM(VERT_ATTRIB_TEX7), - ENUM(VERT_ATTRIB_POINT_SIZE), - ENUM(VERT_ATTRIB_GENERIC0), - ENUM(VERT_ATTRIB_GENERIC1), - ENUM(VERT_ATTRIB_GENERIC2), - ENUM(VERT_ATTRIB_GENERIC3), - ENUM(VERT_ATTRIB_GENERIC4), - ENUM(VERT_ATTRIB_GENERIC5), - ENUM(VERT_ATTRIB_GENERIC6), - ENUM(VERT_ATTRIB_GENERIC7), - ENUM(VERT_ATTRIB_GENERIC8), - ENUM(VERT_ATTRIB_GENERIC9), - ENUM(VERT_ATTRIB_GENERIC10), - ENUM(VERT_ATTRIB_GENERIC11), - ENUM(VERT_ATTRIB_GENERIC12), - ENUM(VERT_ATTRIB_GENERIC13), - ENUM(VERT_ATTRIB_GENERIC14), - ENUM(VERT_ATTRIB_GENERIC15), - }; - return NAME(attrib); -} - -const char * gl_varying_slot_name(gl_varying_slot slot) -{ - static const char *names[] = { - ENUM(VARYING_SLOT_POS), - ENUM(VARYING_SLOT_COL0), - ENUM(VARYING_SLOT_COL1), - ENUM(VARYING_SLOT_FOGC), - ENUM(VARYING_SLOT_TEX0), - ENUM(VARYING_SLOT_TEX1), - ENUM(VARYING_SLOT_TEX2), - ENUM(VARYING_SLOT_TEX3), - ENUM(VARYING_SLOT_TEX4), - ENUM(VARYING_SLOT_TEX5), - ENUM(VARYING_SLOT_TEX6), - ENUM(VARYING_SLOT_TEX7), - ENUM(VARYING_SLOT_PSIZ), - ENUM(VARYING_SLOT_BFC0), - ENUM(VARYING_SLOT_BFC1), - ENUM(VARYING_SLOT_EDGE), - ENUM(VARYING_SLOT_CLIP_VERTEX), - ENUM(VARYING_SLOT_CLIP_DIST0), - ENUM(VARYING_SLOT_CLIP_DIST1), - ENUM(VARYING_SLOT_PRIMITIVE_ID), - ENUM(VARYING_SLOT_LAYER), - ENUM(VARYING_SLOT_VIEWPORT), - ENUM(VARYING_SLOT_FACE), - ENUM(VARYING_SLOT_PNTC), - ENUM(VARYING_SLOT_TESS_LEVEL_OUTER), - ENUM(VARYING_SLOT_TESS_LEVEL_INNER), - ENUM(VARYING_SLOT_VAR0), - ENUM(VARYING_SLOT_VAR1), - ENUM(VARYING_SLOT_VAR2), - ENUM(VARYING_SLOT_VAR3), - ENUM(VARYING_SLOT_VAR4), - ENUM(VARYING_SLOT_VAR5), - ENUM(VARYING_SLOT_VAR6), - ENUM(VARYING_SLOT_VAR7), - ENUM(VARYING_SLOT_VAR8), - ENUM(VARYING_SLOT_VAR9), - ENUM(VARYING_SLOT_VAR10), - ENUM(VARYING_SLOT_VAR11), - ENUM(VARYING_SLOT_VAR12), - ENUM(VARYING_SLOT_VAR13), - ENUM(VARYING_SLOT_VAR14), - ENUM(VARYING_SLOT_VAR15), - ENUM(VARYING_SLOT_VAR16), - ENUM(VARYING_SLOT_VAR17), - ENUM(VARYING_SLOT_VAR18), - ENUM(VARYING_SLOT_VAR19), - ENUM(VARYING_SLOT_VAR20), - ENUM(VARYING_SLOT_VAR21), - ENUM(VARYING_SLOT_VAR22), - ENUM(VARYING_SLOT_VAR23), - ENUM(VARYING_SLOT_VAR24), - ENUM(VARYING_SLOT_VAR25), - ENUM(VARYING_SLOT_VAR26), - ENUM(VARYING_SLOT_VAR27), - ENUM(VARYING_SLOT_VAR28), - ENUM(VARYING_SLOT_VAR29), - ENUM(VARYING_SLOT_VAR30), - ENUM(VARYING_SLOT_VAR31), - }; - return NAME(slot); -} - -const char * gl_system_value_name(gl_system_value sysval) -{ - static const char *names[] = { - ENUM(SYSTEM_VALUE_VERTEX_ID), - ENUM(SYSTEM_VALUE_INSTANCE_ID), - ENUM(SYSTEM_VALUE_VERTEX_ID_ZERO_BASE), - ENUM(SYSTEM_VALUE_BASE_VERTEX), - ENUM(SYSTEM_VALUE_INVOCATION_ID), - ENUM(SYSTEM_VALUE_FRONT_FACE), - ENUM(SYSTEM_VALUE_SAMPLE_ID), - ENUM(SYSTEM_VALUE_SAMPLE_POS), - ENUM(SYSTEM_VALUE_SAMPLE_MASK_IN), - ENUM(SYSTEM_VALUE_TESS_COORD), - ENUM(SYSTEM_VALUE_VERTICES_IN), - ENUM(SYSTEM_VALUE_PRIMITIVE_ID), - ENUM(SYSTEM_VALUE_TESS_LEVEL_OUTER), - ENUM(SYSTEM_VALUE_TESS_LEVEL_INNER), - ENUM(SYSTEM_VALUE_LOCAL_INVOCATION_ID), - ENUM(SYSTEM_VALUE_WORK_GROUP_ID), - ENUM(SYSTEM_VALUE_VERTEX_CNT), - }; - return NAME(sysval); -} - -const char * glsl_interp_qualifier_name(enum glsl_interp_qualifier qual) -{ - static const char *names[] = { - ENUM(INTERP_QUALIFIER_NONE), - ENUM(INTERP_QUALIFIER_SMOOTH), - ENUM(INTERP_QUALIFIER_FLAT), - ENUM(INTERP_QUALIFIER_NOPERSPECTIVE), - }; - return NAME(qual); -} - -const char * gl_frag_result_name(gl_frag_result result) -{ - static const char *names[] = { - ENUM(FRAG_RESULT_DEPTH), - ENUM(FRAG_RESULT_STENCIL), - ENUM(FRAG_RESULT_COLOR), - ENUM(FRAG_RESULT_SAMPLE_MASK), - ENUM(FRAG_RESULT_DATA0), - ENUM(FRAG_RESULT_DATA1), - ENUM(FRAG_RESULT_DATA2), - ENUM(FRAG_RESULT_DATA3), - ENUM(FRAG_RESULT_DATA4), - ENUM(FRAG_RESULT_DATA5), - ENUM(FRAG_RESULT_DATA6), - ENUM(FRAG_RESULT_DATA7), - }; - return NAME(result); -} diff --git a/src/glsl/shader_enums.h b/src/glsl/shader_enums.h deleted file mode 100644 index 2a5d2c5bfa7..00000000000 --- a/src/glsl/shader_enums.h +++ /dev/null @@ -1,476 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef SHADER_ENUMS_H -#define SHADER_ENUMS_H - -/** - * Shader stages. Note that these will become 5 with tessellation. - * - * The order must match how shaders are ordered in the pipeline. - * The GLSL linker assumes that if i