On 02/14/2014 07:04 PM, Ian Romanick wrote:
> 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
>> <kenn...@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. :)

I think you misunderstand.

This patch is fixing a bug in a block of code which is:

if (ctx->Const.GLSLVersion < 130) {
   ...do version 110 shaders...
} else {
   ...do version 130 or 300 es shaders...
}

So, the duplication is precisely for drivers that don't do 1.30.  Like
Gen4-5...

--Ken

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to