gsdx glsl: add basic support of GL_ARB_enhanced_layouts (GL4.4)

Hardcode location of interface to the location 0. If I understand the
spec correctly (unlikely), variable in interface will get successive
location.

Goal is to reduce driver work. Instead to compute some location based on
name matching approach (and silly validation), the driver can now use
static allocation.

Tests on future Mesa 13 are welcome
This commit is contained in:
Gregory Hainaut 2016-10-19 23:03:39 +02:00
parent b1f2d27ddf
commit 8fdf973e66
3 changed files with 24 additions and 0 deletions

View File

@ -26,6 +26,9 @@
#ifdef FRAGMENT_SHADER
#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts
layout(location = 0)
#endif
in SHADER
{
vec4 t_float;

View File

@ -9,6 +9,9 @@ layout(location = 5) in uint i_z;
layout(location = 6) in uvec2 i_uv;
layout(location = 7) in vec4 i_f;
#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts
layout(location = 0)
#endif
out SHADER
{
vec4 t_float;
@ -61,6 +64,9 @@ void vs_main()
#ifdef GEOMETRY_SHADER
#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts
layout(location = 0)
#endif
in SHADER
{
vec4 t_float;
@ -69,6 +75,9 @@ in SHADER
flat vec4 fc;
} GSin[];
#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts
layout(location = 0)
#endif
out SHADER
{
vec4 t_float;

View File

@ -749,6 +749,9 @@ static const char* const tfx_vgs_glsl =
"layout(location = 6) in uvec2 i_uv;\n"
"layout(location = 7) in vec4 i_f;\n"
"\n"
"#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n"
"layout(location = 0)\n"
"#endif\n"
"out SHADER\n"
"{\n"
" vec4 t_float;\n"
@ -801,6 +804,9 @@ static const char* const tfx_vgs_glsl =
"\n"
"#ifdef GEOMETRY_SHADER\n"
"\n"
"#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n"
"layout(location = 0)\n"
"#endif\n"
"in SHADER\n"
"{\n"
" vec4 t_float;\n"
@ -809,6 +815,9 @@ static const char* const tfx_vgs_glsl =
" flat vec4 fc;\n"
"} GSin[];\n"
"\n"
"#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n"
"layout(location = 0)\n"
"#endif\n"
"out SHADER\n"
"{\n"
" vec4 t_float;\n"
@ -1016,6 +1025,9 @@ static const char* const tfx_fs_all_glsl =
"\n"
"#ifdef FRAGMENT_SHADER\n"
"\n"
"#if defined(GL_ARB_enhanced_layouts) && GL_ARB_enhanced_layouts\n"
"layout(location = 0)\n"
"#endif\n"
"in SHADER\n"
"{\n"
" vec4 t_float;\n"