wined3d: Fix ATI dx10 cards max varying quirk

Stefan Dösinger stefandoesinger at gmx.at
Mon May 11 04:59:48 CDT 2009


Am Montag, 11. Mai 2009 02:51:29 schrieb Robert Key:
> Changelog:
> * This adds a quirk to change the default max varying value from
>    68 to 48 on ATI dx10 cards that use fglrx because a declaration
>    of 17 varying vec4s causes shaders not to render and using
>    48 (12 varyings vec4s) works for HD2000 to HD4000 ATI cards.
>
>    Fixes bug #17437

I'm fine with putting the quirk in until fglrx is fixed. The ATI developers 
confirmed the bug and recommended this workaround for now. (I somewhere heard 
that their driver shipping latency is > 3 months for some reason)

Looking at the code again I saw a few details I don't like though:


+static BOOL match_fglrx_r600_to_700(const WineD3D_GL_Info *gl_info) {
+    if(gl_info->gl_vendor != VENDOR_ATI) return FALSE;
+    if(strstr(gl_info->gl_renderer, "DRI")) return FALSE;
+    if(gl_info->max_glsl_varyings == 68) return TRUE;
+    return FALSE;
+}

Maybe its better to compare max_glsl_varyings to > 44. 44 is the amount 
advertised on dx9 cards(and I think we fix this up somewhere already). The 
main question is if we want this quirk to disable itself as soon as the 
driver is fixed, or if we want to disable it manually.

The other thing that bothers me is the replacement value 48 or 52: According 
to an ATI dev[1] the correct value is 64, which would match the dx10 limit of 
16 varyings. Assuming we subtract 8 for the builtin primary and secondary 
color we're still at 56, not 52 or even 48. There's probably the fog color or 
the gl_ClipVertex "varying", but we're not using the clip vertex position 
currently. I think we should figure out where the 48 comes from. Can you play 
a bit with the attached program and see how many varyings you can declare, 
and if the builtin color varyings, fog coord or gl_ClipPos change anything?

1: http://ati.cchtml.com/show_bug.cgi?id=1462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: varying.c
Type: text/x-csrc
Size: 2116 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090511/771b2e59/attachment.c>


More information about the wine-devel mailing list