[Bug 32096] drawStridedSlow can be more efficient

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Oct 30 05:41:32 CDT 2012


http://bugs.winehq.org/show_bug.cgi?id=32096

--- Comment #5 from Matteo Bruni <matteo.mystral at gmail.com> 2012-10-30 05:41:32 CDT ---
Which GPU and Nvidia driver version are you using? GL_ARB_vertex_array_bgra is
reported on my GTX 470 with current drivers (and I think it has been since a
long time).

> This part of the WoW code appears to use *main memory buffer* (ie: vertex array
> in GL).

I never debugged WoW so I don't know, but is it really going through
Draw[Indexed]PrimitiveUP?

> By doing a more subtle change:
> 
> Always enable ARB_VERTEX_ARRAY_BGRA:
> ------------------------------------------------------
> diff -r 69f3e069092b src/wine/dlls/wined3d/directx.c
> --- a/src/wine/dlls/wined3d/directx.c    Tue Oct 30 08:31:01 2012 +0100
> +++ b/src/wine/dlls/wined3d/directx.c    Tue Oct 30 08:37:39 2012 +0100
> @@ -2737,6 +2737,7 @@
>          TRACE(" IMPLIED: ARB_vertex_array_bgra support (by
> EXT_vertex_array_bgra).\n");
>          gl_info->supported[ARB_VERTEX_ARRAY_BGRA] = TRUE;
>      }
> +    gl_info->supported[ARB_VERTEX_ARRAY_BGRA] = TRUE;
>      if (!gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC] &&
> gl_info->supported[EXT_TEXTURE_COMPRESSION_RGTC])
>      {
>          TRACE(" IMPLIED: ARB_texture_compression_rgtc support (by
> EXT_texture_compression_rgtc).\n");
> -------------------------------------------------------
> 
> Change the call to glColorPointer:
> 
> ----------------------------------------------------------
> diff -r 69f3e069092b src/wine/dlls/wined3d/utils.c
> --- a/src/wine/dlls/wined3d/utils.c    Tue Oct 30 08:31:01 2012 +0100
> +++ b/src/wine/dlls/wined3d/utils.c    Tue Oct 30 08:37:39 2012 +0100
> @@ -1601,8 +1601,9 @@
> 
>      if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA])
>      {
> +        printf("conversion to GL_BGRA, forced to 4\n");
>          idx = getFmtIdx(WINED3DFMT_B8G8R8A8_UNORM);
> -        gl_info->formats[idx].gl_vtx_format = GL_BGRA;
> +        gl_info->formats[idx].gl_vtx_format = 4;
>      }
> 
>      if (gl_info->supported[ARB_HALF_FLOAT_VERTEX])
> -----------------------------------------------------------
> 
> Works the same, with the swap between R and B component. I'm surprised, because
> the debug (printf("conversion to GL_BGRA, forced to 4\n") is only called a few
> time. Does that mean that this part of the code is only called when declaring
> *vertex stream* (ie: VAO ?).
> 

Wine does not currently use VAOs (I guess caching vertex streams configurations
in VAOs may be a performance optimization, but that's unrelated anyway). That
piece of code is in apply_format_fixups(), which is called only on wined3d
initialization.

> I propose the following changes:
> 
> a) in device.c, removes the test which fallbacks to drawPrimitiveSlow if
> ARB_VERTEX_ARRAY_BGRA is not available
> b) somewhere just before the glColorPointer call, convert the array with a
> simple loop
> 

I'm not saying that the fallback can't be improved, but I'd not expect it to be
useful all that much. I mean, I thought GL_ARB_vertex_array_bgra support would
be widespread.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list