No subject

=3D?utf-8?q?J=3DC3=3DA9r=3DC3=3DB4me=3D20Gardou?=3D jerome.gardou at la=
Tue Sep 2 11:01:37 CDT 2008


poste.net>
Date: Sun, 25 Jan 2009 02:34:03 +0100
Subject: [PATCH] wined3d: take pixel buffers in account when calculating
texture ram.

---
 dlls/wined3d/context.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index da3053a..9fad82d 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -898,6 +898,9 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This,
IWineD3DSurfaceImpl *tar
     }
     This->frag_pipe->enable_extension((IWineD3DDevice *) This, TRUE);
=20
+    if(create_pbuffer)
+        WineD3DAdapterChangeGLRam(This,
((IWineD3DSurfaceImpl*)(ret->surface))->currentDesc.Width *
((IWineD3DSurfaceImpl*)(ret->surface))->currentDesc.Height *
((IWineD3DSurfaceImpl*)(ret->surface))->bytesPerPixel) ;
+
     return ret;
=20
 out:
@@ -988,6 +991,7 @@ void DestroyContext(IWineD3DDeviceImpl *This,
WineD3DContext *context) {
     if(context->isPBuffer) {
         GL_EXTCALL(wglReleasePbufferDCARB(context->pbuffer,
context->hdc));
         GL_EXTCALL(wglDestroyPbufferARB(context->pbuffer));
+        WineD3DAdapterChangeGLRam(This,(-1) *
((IWineD3DSurfaceImpl*)(context->surface))->currentDesc.Width *
((IWineD3DSurfaceImpl*)(context->surface))->currentDesc.Height *
((IWineD3DSurfaceImpl*)(context->surface))->bytesPerPixel) ;
     } else ReleaseDC(context->win_handle, context->hdc);
     pwglDeleteContext(context->glCtx);
=20
--=20
1.6.0.6

=0A=0A=0A      
--0-405759982-1232870824=:97627
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">Jerome,<br><br>your patch must be sent to win=
e-patch, not to wine-devel.<br><br>A+<br><br>David<br><br>--- En date de&nb=
sp;: <b>Dim 25.1.09, J=C3=A9r=C3=B4me Gardou <i>&lt;jerome.gardou at gmail.com=
&gt;</i></b> a =C3=A9crit&nbsp;:<br><blockquote style=3D"border-left: 2px s=
olid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">De: J=C3=A9r=
=C3=B4me Gardou &lt;jerome.gardou at gmail.com&gt;<br>Objet: performance issue=
 when OffscreenRenderingMode =3D "pbuffer"<br>=C3=80: wine-devel at winehq.org=
<br>Date: Dimanche 25 Janvier 2009, 2h42<br><br><pre>I tried to play Suprem=
e Commander using pbuffer option instead of fbo. I was<br>quite happy with =
it, since I gained quite a bunch of performance (I mean,<br>something I rea=
lly COULD see), but after a while, the performance dropped<br>dramatically,=
 to ~4-5 fps.<br><br>I tested quite a few thing, and I finally found that p=
ixel bufers were not<br>taken in
 account when calculating available texture memory. The game then<br>alloca=
ted more textures, and good opengl didn't dare complain when putting<br>the=
m in system memory.<br><br>Attached is a patch which should solve the probl=
em.<br><br>For those who are curious, try setting VideoMemorySize to 200 in=
stead of 256.<br>It works just like a charm.<br><br></pre><pre>From 8e7b7e5=
17b15e2ddb2cdd1526dfab3dfbf856bd5 Mon Sep 17 00:00:00 2001<br>From: =3D?utf=
-8?q?J=3DC3=3DA9r=3DC3=3DB4me=3D20Gardou?=3D &lt;jerome.gardou at laposte.net&=
gt;<br>Date: Sun, 25 Jan 2009 02:34:03 +0100<br>Subject: [PATCH] wined3d: t=
ake pixel buffers in account when calculating<br>texture ram.<br><br>---<br=
> dlls/wined3d/context.c |    4 ++++<br> 1 files changed, 4 insertions(+), =
0 deletions(-)<br><br>diff --git a/dlls/wined3d/context.c b/dlls/wined3d/co=
ntext.c<br>index da3053a..9fad82d 100644<br>--- a/dlls/wined3d/context.c<br=
>+++ b/dlls/wined3d/context.c<br>@@ -898,6 +898,9 @@ WineD3DContext
 *CreateContext(IWineD3DDeviceImpl *This,<br>IWineD3DSurfaceImpl *tar<br>  =
   }<br>     This-&gt;frag_pipe-&gt;enable_extension((IWineD3DDevice *) Thi=
s, TRUE);<br> <br>+    if(create_pbuffer)<br>+        WineD3DAdapterChangeG=
LRam(This,<br>((IWineD3DSurfaceImpl*)(ret-&gt;surface))-&gt;currentDesc.Wid=
th *<br>((IWineD3DSurfaceImpl*)(ret-&gt;surface))-&gt;currentDesc.Height *<=
br>((IWineD3DSurfaceImpl*)(ret-&gt;surface))-&gt;bytesPerPixel) ;<br>+<br> =
    return ret;<br> <br> out:<br>@@ -988,6 +991,7 @@ void DestroyContext(IW=
ineD3DDeviceImpl *This,<br>WineD3DContext *context) {<br>     if(context-&g=
t;isPBuffer) {<br>         GL_EXTCALL(wglReleasePbufferDCARB(context-&gt;pb=
uffer,<br>context-&gt;hdc));<br>         GL_EXTCALL(wglDestroyPbufferARB(co=
ntext-&gt;pbuffer));<br>+        WineD3DAdapterChangeGLRam(This,(-1) *<br>(=
(IWineD3DSurfaceImpl*)(context-&gt;surface))-&gt;currentDesc.Width *<br>((I=
WineD3DSurfaceImpl*)(context-&gt;surface))-&gt;currentDesc.Height
 *<br>((IWineD3DSurfaceImpl*)(context-&gt;surface))-&gt;bytesPerPixel) ;<br=
>     } else ReleaseDC(context-&gt;win_handle, context-&gt;hdc);<br>     pw=
glDeleteContext(context-&gt;glCtx);<br> <br>-- <br>1.6.0.6<br><br></pre><pr=
e></pre></blockquote></td></tr></table><br>=0A=0A=0A=0A      
--0-405759982-1232870824=:97627--



More information about the wine-devel mailing list