mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
Add EXT_texture_array support.
This commit is contained in:
parent
cc249f79e7
commit
0d80f71867
3 changed files with 29 additions and 0 deletions
|
|
@ -244,6 +244,18 @@ static const struct glsl_type builtin_ARB_texture_rectangle_types[] = {
|
|||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name Sampler types added by GL_EXT_texture_array
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
static const struct glsl_type builtin_EXT_texture_array_types[] = {
|
||||
glsl_type( GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT, "sampler1DArray"),
|
||||
glsl_type( GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"),
|
||||
glsl_type( GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT, "sampler1DArrayShadow"),
|
||||
glsl_type( GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT, "sampler2DArrayShadow"),
|
||||
};
|
||||
/*@}*/
|
||||
|
||||
/** \name Sampler types added by GL_EXT_texture_buffer_object
|
||||
*/
|
||||
/*@{*/
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ struct _mesa_glsl_parse_state {
|
|||
unsigned ARB_draw_buffers_warn:1;
|
||||
unsigned ARB_texture_rectangle_enable:1;
|
||||
unsigned ARB_texture_rectangle_warn:1;
|
||||
unsigned EXT_texture_array_enable:1;
|
||||
unsigned EXT_texture_array_warn:1;
|
||||
/*@}*/
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -90,6 +90,15 @@ generate_ARB_texture_rectangle_types(glsl_symbol_table *symtab, bool warn)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
generate_EXT_texture_array_types(glsl_symbol_table *symtab, bool warn)
|
||||
{
|
||||
add_types_to_symbol_table(symtab, builtin_EXT_texture_array_types,
|
||||
Elements(builtin_EXT_texture_array_types),
|
||||
warn);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
|
|
@ -112,6 +121,12 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
|
|||
generate_ARB_texture_rectangle_types(state->symbols,
|
||||
state->ARB_texture_rectangle_warn);
|
||||
}
|
||||
|
||||
if (state->EXT_texture_array_enable && state->language_version < 130) {
|
||||
// These are already included in 130; don't create twice.
|
||||
generate_EXT_texture_array_types(state->symbols,
|
||||
state->EXT_texture_array_warn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue