summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-02-20 11:38:12 +1000
committerDave Airlie <airlied@redhat.com>2015-05-08 10:21:01 +1000
commit5d6190e496b4793b5bea667be3f8704135745b9c (patch)
treeea9edd8c336b167a2651865f4d57e38697d4e010
parentfc71ae7c5705ef1a80f4f43d113c7fb39d49b164 (diff)
downloadexternal_mesa3d-5d6190e496b4793b5bea667be3f8704135745b9c.zip
external_mesa3d-5d6190e496b4793b5bea667be3f8704135745b9c.tar.gz
external_mesa3d-5d6190e496b4793b5bea667be3f8704135745b9c.tar.bz2
glsl: add ARB_vertex_attrib_64bit support. (v2)
Just more boilerplate stuff. v2: bad fallthrough on versioning, this is my ugly but self contained solution (Ian) Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/glsl/ast_to_hir.cpp3
-rw-r--r--src/glsl/glcpp/glcpp-parse.y3
-rw-r--r--src/glsl/glsl_parser_extras.cpp1
-rw-r--r--src/glsl/glsl_parser_extras.h2
4 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 7051d93..14e6309 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -3574,6 +3574,9 @@ ast_declarator_list::hir(exec_list *instructions,
case GLSL_TYPE_INT:
if (state->is_version(120, 300))
break;
+ case GLSL_TYPE_DOUBLE:
+ if (check_type->base_type == GLSL_TYPE_DOUBLE && (state->is_version(410, 0) || state->ARB_vertex_attrib_64bit_enable))
+ break;
/* FALLTHROUGH */
default:
_mesa_glsl_error(& loc, state,
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index cfceca6..a11b6b2 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -2448,6 +2448,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
if (extensions->ARB_gpu_shader_fp64)
add_builtin_define(parser, "GL_ARB_gpu_shader_fp64", 1);
+ if (extensions->ARB_vertex_attrib_64bit)
+ add_builtin_define(parser, "GL_ARB_vertex_attrib_64bit", 1);
+
if (extensions->AMD_vertex_shader_layer)
add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1);
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index c14481d..be6713c 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -580,6 +580,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT(ARB_texture_query_lod, true, false, ARB_texture_query_lod),
EXT(ARB_texture_rectangle, true, false, dummy_true),
EXT(ARB_uniform_buffer_object, true, false, ARB_uniform_buffer_object),
+ EXT(ARB_vertex_attrib_64bit, true, false, ARB_vertex_attrib_64bit),
EXT(ARB_viewport_array, true, false, ARB_viewport_array),
/* KHR extensions go here, sorted alphabetically.
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 4612071..9a0c24e 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -482,6 +482,8 @@ struct _mesa_glsl_parse_state {
bool ARB_texture_rectangle_warn;
bool ARB_uniform_buffer_object_enable;
bool ARB_uniform_buffer_object_warn;
+ bool ARB_vertex_attrib_64bit_enable;
+ bool ARB_vertex_attrib_64bit_warn;
bool ARB_viewport_array_enable;
bool ARB_viewport_array_warn;