summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2016-08-17 10:13:24 +0100
committerIan Romanick <ian.d.romanick@intel.com>2016-08-26 15:03:15 -0700
commitef5bad09c4623892a358046b7ece4dcb273ad700 (patch)
treefc44ed29149e64972946df09771ff42c19c12b35
parentc879dbc4e4184511cb3d831b66380c087216d850 (diff)
downloadexternal_mesa3d-ef5bad09c4623892a358046b7ece4dcb273ad700.zip
external_mesa3d-ef5bad09c4623892a358046b7ece4dcb273ad700.tar.gz
external_mesa3d-ef5bad09c4623892a358046b7ece4dcb273ad700.tar.bz2
glsl: Add and use has_texture_cube_map_array helper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/compiler/glsl/builtin_functions.cpp6
-rw-r--r--src/compiler/glsl/glsl_parser_extras.h6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index db2d3e3..161c98b 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -334,15 +334,13 @@ static bool
fs_texture_cube_map_array(const _mesa_glsl_parse_state *state)
{
return state->stage == MESA_SHADER_FRAGMENT &&
- (state->is_version(400, 0) ||
- state->ARB_texture_cube_map_array_enable);
+ state->has_texture_cube_map_array();
}
static bool
texture_cube_map_array(const _mesa_glsl_parse_state *state)
{
- return state->is_version(400, 0) ||
- state->ARB_texture_cube_map_array_enable;
+ return state->has_texture_cube_map_array();
}
static bool
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index 7092281..82ce6a7 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -317,6 +317,12 @@ struct _mesa_glsl_parse_state {
MESA_shader_framebuffer_fetch_non_coherent_enable;
}
+ bool has_texture_cube_map_array() const
+ {
+ return ARB_texture_cube_map_array_enable ||
+ is_version(400, 0);
+ }
+
void process_version_directive(YYLTYPE *locp, int version,
const char *ident);