[Mesa-dev] [PATCH] glsl: permit explicit locations on fragment shader outputs, not inputs

Ian Romanick idr at freedesktop.org
Tue Jun 28 13:40:43 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/28/2011 10:50 AM, Paul Berry wrote:
> From the OpenGL docs for GL_ARB_explicit_attrib_location:
> 
>     This extension provides a method to pre-assign attribute locations to
>     named vertex shader inputs and color numbers to named fragment shader
>     outputs.
> 
> This was accidentally implemented for fragment shader inputs.  This
> patch fixes it to apply to fragment shader outputs.

I was just about to submit the same patch!  This is clearly a
cut-and-paste bug by me.  I have a follow-on commit that I'll send
momentarily.

In addition to my Reviewed-by, add the following to the end of the
commit message:

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624

These lines help ensure that the patch gets correctly cherry picked over
to the stable branches.

> Fixes piglit tests
> spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag
> 
> Breaks piglit tests
> spec/ARB_explicit_attrib_location/1.{10,20}/compiler/in-04.frag, which
> appear to be incorrect (they specify "expect_result: pass", but
> comments in the tests make it clear that they are expected to fail).
> 
> I'll submit a patch to piglit to correct the two broken tests.

I already fixed those and the two tests that expect the 'index' layout
qualifier to be available without ARB_blend_func_extended.

> ---
>  src/glsl/ast_to_hir.cpp |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
> index 3b87f0d..35cb206 100644
> --- a/src/glsl/ast_to_hir.cpp
> +++ b/src/glsl/ast_to_hir.cpp
> @@ -1940,7 +1940,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
>  	 break;
>  
>        case fragment_shader:
> -	 if (!global_scope || (var->mode != ir_var_in)) {
> +	 if (!global_scope || (var->mode != ir_var_out)) {
>  	    fail = true;
>  	    string = "output";
>  	 }
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk4KPEsACgkQX1gOwKyEAw91vgCdHMwZESScBF6w7IfWLTLWnTHP
YFsAmwZr743IBclEtXdLEFnYGISgTW6h
=7gC7
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list