glsl: Restore Mesa-style to shader_enums.c/h.
This commit is contained in:
@@ -33,7 +33,8 @@
|
|||||||
#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")
|
||||||
|
|
||||||
const char * gl_shader_stage_name(gl_shader_stage stage)
|
const char *
|
||||||
|
gl_shader_stage_name(gl_shader_stage stage)
|
||||||
{
|
{
|
||||||
static const char *names[] = {
|
static const char *names[] = {
|
||||||
ENUM(MESA_SHADER_VERTEX),
|
ENUM(MESA_SHADER_VERTEX),
|
||||||
@@ -51,7 +52,8 @@ const char * gl_shader_stage_name(gl_shader_stage stage)
|
|||||||
* Translate a gl_shader_stage to a short shader stage name for debug
|
* Translate a gl_shader_stage to a short shader stage name for debug
|
||||||
* printouts and error messages.
|
* printouts and error messages.
|
||||||
*/
|
*/
|
||||||
const char * _mesa_shader_stage_to_string(unsigned stage)
|
const char *
|
||||||
|
_mesa_shader_stage_to_string(unsigned stage)
|
||||||
{
|
{
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case MESA_SHADER_VERTEX: return "vertex";
|
case MESA_SHADER_VERTEX: return "vertex";
|
||||||
@@ -69,7 +71,8 @@ const char * _mesa_shader_stage_to_string(unsigned stage)
|
|||||||
* Translate a gl_shader_stage to a shader stage abbreviation (VS, GS, FS)
|
* Translate a gl_shader_stage to a shader stage abbreviation (VS, GS, FS)
|
||||||
* for debug printouts and error messages.
|
* for debug printouts and error messages.
|
||||||
*/
|
*/
|
||||||
const char * _mesa_shader_stage_to_abbrev(unsigned stage)
|
const char *
|
||||||
|
_mesa_shader_stage_to_abbrev(unsigned stage)
|
||||||
{
|
{
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case MESA_SHADER_VERTEX: return "VS";
|
case MESA_SHADER_VERTEX: return "VS";
|
||||||
@@ -83,7 +86,8 @@ const char * _mesa_shader_stage_to_abbrev(unsigned stage)
|
|||||||
unreachable("Unknown shader stage.");
|
unreachable("Unknown shader stage.");
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * gl_vert_attrib_name(gl_vert_attrib attrib)
|
const char *
|
||||||
|
gl_vert_attrib_name(gl_vert_attrib attrib)
|
||||||
{
|
{
|
||||||
static const char *names[] = {
|
static const char *names[] = {
|
||||||
ENUM(VERT_ATTRIB_POS),
|
ENUM(VERT_ATTRIB_POS),
|
||||||
@@ -124,7 +128,8 @@ const char * gl_vert_attrib_name(gl_vert_attrib attrib)
|
|||||||
return NAME(attrib);
|
return NAME(attrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * gl_varying_slot_name(gl_varying_slot slot)
|
const char *
|
||||||
|
gl_varying_slot_name(gl_varying_slot slot)
|
||||||
{
|
{
|
||||||
static const char *names[] = {
|
static const char *names[] = {
|
||||||
ENUM(VARYING_SLOT_POS),
|
ENUM(VARYING_SLOT_POS),
|
||||||
@@ -190,7 +195,8 @@ const char * gl_varying_slot_name(gl_varying_slot slot)
|
|||||||
return NAME(slot);
|
return NAME(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * gl_system_value_name(gl_system_value sysval)
|
const char *
|
||||||
|
gl_system_value_name(gl_system_value sysval)
|
||||||
{
|
{
|
||||||
static const char *names[] = {
|
static const char *names[] = {
|
||||||
ENUM(SYSTEM_VALUE_VERTEX_ID),
|
ENUM(SYSTEM_VALUE_VERTEX_ID),
|
||||||
@@ -216,7 +222,8 @@ const char * gl_system_value_name(gl_system_value sysval)
|
|||||||
return NAME(sysval);
|
return NAME(sysval);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * glsl_interp_qualifier_name(enum glsl_interp_qualifier qual)
|
const char *
|
||||||
|
glsl_interp_qualifier_name(enum glsl_interp_qualifier qual)
|
||||||
{
|
{
|
||||||
static const char *names[] = {
|
static const char *names[] = {
|
||||||
ENUM(INTERP_QUALIFIER_NONE),
|
ENUM(INTERP_QUALIFIER_NONE),
|
||||||
@@ -228,7 +235,8 @@ const char * glsl_interp_qualifier_name(enum glsl_interp_qualifier qual)
|
|||||||
return NAME(qual);
|
return NAME(qual);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * gl_frag_result_name(gl_frag_result result)
|
const char *
|
||||||
|
gl_frag_result_name(gl_frag_result result)
|
||||||
{
|
{
|
||||||
static const char *names[] = {
|
static const char *names[] = {
|
||||||
ENUM(FRAG_RESULT_DEPTH),
|
ENUM(FRAG_RESULT_DEPTH),
|
||||||
|
@@ -47,19 +47,19 @@ typedef enum
|
|||||||
MESA_SHADER_COMPUTE = 5,
|
MESA_SHADER_COMPUTE = 5,
|
||||||
} gl_shader_stage;
|
} gl_shader_stage;
|
||||||
|
|
||||||
const char * gl_shader_stage_name(gl_shader_stage stage);
|
const char *gl_shader_stage_name(gl_shader_stage stage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translate a gl_shader_stage to a short shader stage name for debug
|
* Translate a gl_shader_stage to a short shader stage name for debug
|
||||||
* printouts and error messages.
|
* printouts and error messages.
|
||||||
*/
|
*/
|
||||||
const char * _mesa_shader_stage_to_string(unsigned stage);
|
const char *_mesa_shader_stage_to_string(unsigned stage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translate a gl_shader_stage to a shader stage abbreviation (VS, GS, FS)
|
* Translate a gl_shader_stage to a shader stage abbreviation (VS, GS, FS)
|
||||||
* for debug printouts and error messages.
|
* for debug printouts and error messages.
|
||||||
*/
|
*/
|
||||||
const char * _mesa_shader_stage_to_abbrev(unsigned stage);
|
const char *_mesa_shader_stage_to_abbrev(unsigned stage);
|
||||||
|
|
||||||
#define MESA_SHADER_STAGES (MESA_SHADER_COMPUTE + 1)
|
#define MESA_SHADER_STAGES (MESA_SHADER_COMPUTE + 1)
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ typedef enum
|
|||||||
VERT_ATTRIB_MAX = 33
|
VERT_ATTRIB_MAX = 33
|
||||||
} gl_vert_attrib;
|
} gl_vert_attrib;
|
||||||
|
|
||||||
const char * gl_vert_attrib_name(gl_vert_attrib attrib);
|
const char *gl_vert_attrib_name(gl_vert_attrib attrib);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Symbolic constats to help iterating over
|
* Symbolic constats to help iterating over
|
||||||
@@ -254,7 +254,7 @@ typedef enum
|
|||||||
#define VARYING_SLOT_PATCH0 (VARYING_SLOT_MAX)
|
#define VARYING_SLOT_PATCH0 (VARYING_SLOT_MAX)
|
||||||
#define VARYING_SLOT_TESS_MAX (VARYING_SLOT_PATCH0 + MAX_VARYING)
|
#define VARYING_SLOT_TESS_MAX (VARYING_SLOT_PATCH0 + MAX_VARYING)
|
||||||
|
|
||||||
const char * gl_varying_slot_name(gl_varying_slot slot);
|
const char *gl_varying_slot_name(gl_varying_slot slot);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bitflags for varying slots.
|
* Bitflags for varying slots.
|
||||||
@@ -465,7 +465,7 @@ typedef enum
|
|||||||
SYSTEM_VALUE_MAX /**< Number of values */
|
SYSTEM_VALUE_MAX /**< Number of values */
|
||||||
} gl_system_value;
|
} gl_system_value;
|
||||||
|
|
||||||
const char * gl_system_value_name(gl_system_value sysval);
|
const char *gl_system_value_name(gl_system_value sysval);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The possible interpolation qualifiers that can be applied to a fragment
|
* The possible interpolation qualifiers that can be applied to a fragment
|
||||||
@@ -483,7 +483,7 @@ enum glsl_interp_qualifier
|
|||||||
INTERP_QUALIFIER_COUNT /**< Number of interpolation qualifiers */
|
INTERP_QUALIFIER_COUNT /**< Number of interpolation qualifiers */
|
||||||
};
|
};
|
||||||
|
|
||||||
const char * glsl_interp_qualifier_name(enum glsl_interp_qualifier qual);
|
const char *glsl_interp_qualifier_name(enum glsl_interp_qualifier qual);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fragment program results
|
* Fragment program results
|
||||||
@@ -514,7 +514,7 @@ typedef enum
|
|||||||
FRAG_RESULT_DATA7,
|
FRAG_RESULT_DATA7,
|
||||||
} gl_frag_result;
|
} gl_frag_result;
|
||||||
|
|
||||||
const char * gl_frag_result_name(gl_frag_result result);
|
const char *gl_frag_result_name(gl_frag_result result);
|
||||||
|
|
||||||
#define FRAG_RESULT_MAX (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS)
|
#define FRAG_RESULT_MAX (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user