mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
glsl: Split out types that are in 1.10 but not GLSL ES 1.00.
This commit is contained in:
parent
c5e74871d9
commit
76deef138e
3 changed files with 35 additions and 15 deletions
|
|
@ -51,16 +51,8 @@ const glsl_type glsl_type::builtin_core_types[] = {
|
|||
glsl_type(GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2, "mat2"),
|
||||
glsl_type(GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3, "mat3"),
|
||||
glsl_type(GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4, "mat4"),
|
||||
glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler1D"),
|
||||
glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler1DShadow"),
|
||||
glsl_type(GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler2D"),
|
||||
glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler2DShadow"),
|
||||
glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler3D"),
|
||||
glsl_type(GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"samplerCube"),
|
||||
};
|
||||
|
|
@ -178,6 +170,21 @@ const glsl_type glsl_type::builtin_110_deprecated_structure_types[] = {
|
|||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name Types in GLSL 1.10 (but not GLSL ES 1.00)
|
||||
*/
|
||||
/*@{*/
|
||||
const glsl_type glsl_type::builtin_110_types[] = {
|
||||
glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler1D"),
|
||||
glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler1DShadow"),
|
||||
glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler2DShadow"),
|
||||
glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT,
|
||||
"sampler3D"),
|
||||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name Types added in GLSL 1.20
|
||||
*/
|
||||
/*@{*/
|
||||
|
|
|
|||
|
|
@ -111,9 +111,8 @@ add_types_to_symbol_table(glsl_symbol_table *symtab,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
glsl_type::generate_110_types(glsl_symbol_table *symtab)
|
||||
glsl_type::generate_100ES_types(glsl_symbol_table *symtab)
|
||||
{
|
||||
add_types_to_symbol_table(symtab, builtin_core_types,
|
||||
Elements(builtin_core_types),
|
||||
|
|
@ -121,10 +120,20 @@ glsl_type::generate_110_types(glsl_symbol_table *symtab)
|
|||
add_types_to_symbol_table(symtab, builtin_structure_types,
|
||||
Elements(builtin_structure_types),
|
||||
false);
|
||||
add_types_to_symbol_table(symtab, &void_type, 1, false);
|
||||
}
|
||||
|
||||
void
|
||||
glsl_type::generate_110_types(glsl_symbol_table *symtab)
|
||||
{
|
||||
generate_100ES_types(symtab);
|
||||
|
||||
add_types_to_symbol_table(symtab, builtin_110_types,
|
||||
Elements(builtin_110_types),
|
||||
false);
|
||||
add_types_to_symbol_table(symtab, builtin_110_deprecated_structure_types,
|
||||
Elements(builtin_110_deprecated_structure_types),
|
||||
false);
|
||||
add_types_to_symbol_table(symtab, & void_type, 1, false);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -173,6 +182,10 @@ void
|
|||
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
switch (state->language_version) {
|
||||
case 100:
|
||||
assert(state->es_shader);
|
||||
glsl_type::generate_100ES_types(state->symbols);
|
||||
break;
|
||||
case 110:
|
||||
glsl_type::generate_110_types(state->symbols);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -430,6 +430,7 @@ private:
|
|||
static const glsl_type builtin_core_types[];
|
||||
static const glsl_type builtin_structure_types[];
|
||||
static const glsl_type builtin_110_deprecated_structure_types[];
|
||||
static const glsl_type builtin_110_types[];
|
||||
static const glsl_type builtin_120_types[];
|
||||
static const glsl_type builtin_130_types[];
|
||||
static const glsl_type builtin_ARB_texture_rectangle_types[];
|
||||
|
|
@ -446,13 +447,12 @@ private:
|
|||
* the world in a public header file.
|
||||
*/
|
||||
/*@{*/
|
||||
static void generate_100ES_types(glsl_symbol_table *);
|
||||
static void generate_110_types(glsl_symbol_table *);
|
||||
static void generate_120_types(glsl_symbol_table *);
|
||||
static void generate_130_types(glsl_symbol_table *);
|
||||
static void generate_ARB_texture_rectangle_types(glsl_symbol_table *,
|
||||
bool);
|
||||
static void generate_EXT_texture_array_types(glsl_symbol_table *,
|
||||
bool);
|
||||
static void generate_ARB_texture_rectangle_types(glsl_symbol_table *, bool);
|
||||
static void generate_EXT_texture_array_types(glsl_symbol_table *, bool);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue