[Mesa-dev] [PATCH 1/8] meta: Fix blit shader compile on non-glsl-130 drivers.

Ian Romanick idr at freedesktop.org
Fri Feb 14 19:04:32 PST 2014


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

On 02/14/2014 05:09 PM, Kenneth Graunke wrote:
> On 02/14/2014 03:00 PM, Eric Anholt wrote:
>> Compare this VS to the one for the post-130 case.  Fixes piglit 
>> glsl-lod-bias, and presumably tons of other code (I haven't done
>> a full piglit run on swrast).
>> 
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74911 --- 
>> src/mesa/drivers/common/meta.c | 2 +- 1 file changed, 1
>> insertion(+), 1 deletion(-)
>> 
>> diff --git a/src/mesa/drivers/common/meta.c
>> b/src/mesa/drivers/common/meta.c index d3ca3b7..dd905dd 100644 
>> --- a/src/mesa/drivers/common/meta.c +++
>> b/src/mesa/drivers/common/meta.c @@ -193,7 +193,7 @@
>> _mesa_meta_setup_blit_shader(struct gl_context *ctx, ||
>> ctx->Const.GLSLVersion < 130) { vs_source = "attribute vec2
>> position;\n" -         "attribute vec3 textureCoords;\n" +
>> "attribute vec4 textureCoords;\n" "varying vec4 texCoords;\n" 
>> "void main()\n" "{\n"
>> 
> 
> This is obviously: Reviewed-by: Kenneth Graunke
> <kenneth at whitecape.org>
> 
> But I wonder, would it be terribly harmful to just override 
> ctx->Const.GLSLVersion to 130 in Meta so #version 130 works?

ctx->Const.GLSLVersion is already (proably) 130 or greater.  There are
checks in the compiler against API to validate the version in the
shader.  Otherwise applications with an OpenGL ES 3.0 context could
compile desktop GLSL 1.30 shaders, and that seems bad. :)

> Sure, you could get into trouble if you tried to use things like 
> ClipDistance and they weren't supported, but I don't see us needing
> that.
> 
> We would need integer, but I don't know of any drivers that allow
> you to make integer textures that can't handle integers.  (Gen4-5
> expose EXT_texture_integer without GLSL 1.30, but they can do GLSL
> 1.30...we just never finished advertising it...)
> 
> Just an idea; I'm not suggesting altering any of these patches.
> 
> 
> 
> _______________________________________________ mesa-dev mailing
> list mesa-dev at lists.freedesktop.org 
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iEYEARECAAYFAlL+2UAACgkQX1gOwKyEAw9KrwCeO2qnkBmcSsYniCyQFBwa+man
RoQAoINS3RZReZs9PlT+q1IASpMzGoGg
=mVCJ
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list