https://bugs.freedesktop.org/show_bug.cgi?id=31827
Summary: r300g fails to link a GL program Product: Mesa Version: 7.9 Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Drivers/DRI/r300 AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: hicham.haouari@gmail.com
I have made a simple test case :
http://hicham.fedorapeople.org/lightspark/ls-testcase.tar.bz2
https://bugs.freedesktop.org/show_bug.cgi?id=31827
Hicham HAOUARI hicham.haouari@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|Drivers/DRI/r300 |Drivers/Gallium/r300
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #1 from Marek Olšák maraeo@gmail.com 2010-11-21 15:51:41 PST --- I can't reproduce this. Your test case prints "program linking succeeded".
https://bugs.freedesktop.org/show_bug.cgi?id=31827
Marek Olšák maraeo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|r300g fails to link a GL |r300g fails to link a GL |program |program (Mesa 7.9)
--- Comment #2 from Marek Olšák maraeo@gmail.com 2010-11-21 15:55:36 PST --- Now I see you're using 7.9. This issue has apparently been fixed in master. I guess the fix will find its way to the next 7.9.x version. Could you possibly bisect which commit fixed it in master?
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #3 from Da Fox da_fox@mad.scientist.com 2010-11-22 13:48:06 PST --- I can confirm this testcase fails to link with current mesa-git (51b895041c65f7ec9ecda48e79279dde29258b07), on radeon mobility 9600 m10 (rv350) and 2.6.36.
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #4 from Marek Olšák maraeo@gmail.com 2010-11-22 15:02:39 PST --- I don't have 51b895041c65f7ec9ecda48e79279dde29258b07 in my Mesa tree, which means it doesn't exist. Don't you have some patches applied locally?
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #5 from Da Fox da_fox@mad.scientist.com 2010-11-23 00:54:49 PST --- (In reply to comment #4)
I don't have 51b895041c65f7ec9ecda48e79279dde29258b07 in my Mesa tree, which means it doesn't exist. Don't you have some patches applied locally?
You are correct. I must have copy&pasted the wrong line... Gitk shows "e7c74a7dfab789496761226fe62a08f2d9fea5c7 - st/mesa: set MaxUniformComponents" for mesa.
51b895041c65f7ec9ecda48e79279dde29258b07 appears to be from libdrm.
Sorry for the mixup.
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #6 from Hydrar hydrardraconis@gmail.com 2010-11-23 11:53:46 PST --- Just updated both my computers to latest git today, the test case prints "program linking succeeded" on my RV530(X1600), but fails on my RV410(Mobility X700), with same git versions of libdrm, mesa and xf86-video-ati.
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #7 from Marek Olšák maraeo@gmail.com 2010-11-23 13:01:54 PST --- Please query GL_LINK_STATUS and post what it says.
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #8 from Hicham HAOUARI hicham.haouari@gmail.com 2010-11-23 13:07:20 PST --- (In reply to comment #7)
Please query GL_LINK_STATUS and post what it says.
I think that is what I have done in the testcase, or am I missing something ?
Anyway, I retested with Fedora rawhide, which ships mesa-7.10 snapshot from 20101118 and I still get the same failure.
kernel : 2.6.36
libdrm : 2.4.23 branch git snapshot from 20101123
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #9 from Marek Olšák maraeo@gmail.com 2010-11-24 10:18:18 PST --- Ah sorry about that. I meant this:
Could you please post what glGetProgramInfoLog returns? It should give us a clue. Thank you.
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #10 from Hicham HAOUARI hicham.haouari@gmail.com 2010-11-24 10:28:38 PST --- (In reply to comment #9)
Ah sorry about that. I meant this:
Could you please post what glGetProgramInfoLog returns? It should give us a clue. Thank you.
it gives : Couldn't flatten if statement
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #11 from Marek Olšák maraeo@gmail.com 2010-11-24 10:37:36 PST --- The if statement in the fragment shader is too complex. Could you possibly move the texture lookup in front of it and see if it helps?
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #12 from Hicham HAOUARI hicham.haouari@gmail.com 2010-11-24 11:05:53 PST --- (In reply to comment #11)
The if statement in the fragment shader is too complex. Could you possibly move the texture lookup in front of it and see if it helps?
modifying : ****************************************************************************** if(gl_Color.x==1.0 && texture2D(g_tex2,gl_TexCoord[1].xy).a==0.0) discard; ******************************************************************************
to : ****************************************************************************** bool res = ( gl_Color.x==1.0 && texture2D(g_tex2,gl_TexCoord[1].xy).a==0.0 ); if(res) discard; ******************************************************************************
gives the same error message
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #13 from Hicham HAOUARI hicham.haouari@gmail.com 2010-11-24 11:51:54 PST --- doing that :
*********************** if(false) discard; ***********************
makes the linking succeed
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #14 from Hicham HAOUARI hicham.haouari@gmail.com 2010-11-24 11:52:30 PST --- of course :
****************************************************** vec4 tex = texture2D(g_tex2,gl_TexCoord[1].xy); if(gl_Color.x==1.0 && tex.a==0.0) discard; ******************************************************
fails too
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #15 from Marek Olšák maraeo@gmail.com 2010-11-24 11:55:32 PST --- I am working on a fix.
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #16 from Marek Olšák maraeo@gmail.com 2010-11-24 14:29:35 PST --- The fix has been sent to ML: http://lists.freedesktop.org/archives/mesa-dev/2010-November/004214.html
https://bugs.freedesktop.org/show_bug.cgi?id=31827
Marek Olšák maraeo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #17 from Marek Olšák maraeo@gmail.com 2010-12-01 13:00:13 PST --- Fixed in Mesa master. The fix will eventually make its way to 7.9. Closing..
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #18 from Hicham HAOUARI hicham.haouari@gmail.com 2010-12-03 13:37:10 PST --- (In reply to comment #17)
Fixed in Mesa master. The fix will eventually make its way to 7.9. Closing..
What commit fixed this bug ?
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #19 from Marek Olšák maraeo@gmail.com 2010-12-03 14:02:33 PST --- This set of patches:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ead2ea89f42b40edc56ddf8c6ce... http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a1d063c6d679c2155f5eb80f1c... http://cgit.freedesktop.org/mesa/mesa/commit/?id=940df10100d740ef27fa39026fd... http://cgit.freedesktop.org/mesa/mesa/commit/?id=1802cb9bafc4125300870be51e8...
https://bugs.freedesktop.org/show_bug.cgi?id=31827
--- Comment #20 from Hicham HAOUARI hicham.haouari@gmail.com 2010-12-15 17:34:41 PST --- Here is an attempt to backport the fixes to 7.9 :
http://hicham.fedorapeople.org/lightspark/0001-Backport-fdbz-31827-fix-to-7....
It applies against latest mesa-7.9.
I tested it locally, and the testcase succeeds.
dri-devel@lists.freedesktop.org