From: Ilia Mirkin Date: Wed, 2 Jul 2014 16:12:51 +0000 (-0400) Subject: glsl: add support for AMD_vertex_shader_viewport_index X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df61553070319660bd6a74f1ae6b251700dd17db;p=mesa.git glsl: add support for AMD_vertex_shader_viewport_index Signed-off-by: Ilia Mirkin Reviewed-by: Kenneth Graunke Reviewed-by: Chris Forbes Tested-by: Tobias Droste --- diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp index 9f9571619ba..34973023fe9 100644 --- a/src/glsl/builtin_variables.cpp +++ b/src/glsl/builtin_variables.cpp @@ -815,6 +815,8 @@ builtin_variable_generator::generate_vs_special_vars() add_system_value(SYSTEM_VALUE_INSTANCE_ID, int_t, "gl_InstanceID"); if (state->AMD_vertex_shader_layer_enable) add_output(VARYING_SLOT_LAYER, int_t, "gl_Layer"); + if (state->AMD_vertex_shader_viewport_index_enable) + add_output(VARYING_SLOT_VIEWPORT, int_t, "gl_ViewportIndex"); if (compatibility) { add_input(VERT_ATTRIB_POS, vec4_t, "gl_Vertex"); add_input(VERT_ATTRIB_NORMAL, vec3_t, "gl_Normal"); diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index d8c395778ab..ccf8105597b 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -2133,6 +2133,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio if (extensions->AMD_vertex_shader_layer) add_builtin_define(parser, "GL_AMD_vertex_shader_layer", 1); + if (extensions->AMD_vertex_shader_viewport_index) + add_builtin_define(parser, "GL_AMD_vertex_shader_viewport_index", 1); + if (extensions->ARB_shading_language_420pack) add_builtin_define(parser, "GL_ARB_shading_language_420pack", 1); diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index 0d993397e40..b327c2b4319 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -552,6 +552,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(AMD_shader_stencil_export, true, false, ARB_shader_stencil_export), EXT(AMD_shader_trinary_minmax, true, false, dummy_true), EXT(AMD_vertex_shader_layer, true, false, AMD_vertex_shader_layer), + EXT(AMD_vertex_shader_viewport_index, true, false, AMD_vertex_shader_viewport_index), EXT(EXT_separate_shader_objects, false, true, dummy_true), EXT(EXT_shader_integer_mix, true, true, EXT_shader_integer_mix), EXT(EXT_texture_array, true, false, EXT_texture_array), diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index a0af965fd23..17918163e31 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -461,6 +461,8 @@ struct _mesa_glsl_parse_state { bool AMD_shader_trinary_minmax_warn; bool AMD_vertex_shader_layer_enable; bool AMD_vertex_shader_layer_warn; + bool AMD_vertex_shader_viewport_index_enable; + bool AMD_vertex_shader_viewport_index_warn; bool EXT_separate_shader_objects_enable; bool EXT_separate_shader_objects_warn; bool EXT_shader_integer_mix_enable;