Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4f594777
Commit
4f594777
authored
Dec 24, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Drop the VBO if too many full buffer conversions occur.
parent
9750cca9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
9 deletions
+30
-9
buffer.c
dlls/wined3d/buffer.c
+29
-8
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/buffer.c
View file @
4f594777
...
...
@@ -31,8 +31,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define GLINFO_LOCATION This->resource.device->adapter->gl_info
#define VB_MAXDECLCHANGES 100
/* After that number we stop converting */
#define VB_RESETDECLCHANGE 1000
/* Reset the changecount after that number of draws */
#define VB_MAXDECLCHANGES 100
/* After that number of decl changes we stop converting */
#define VB_RESETDECLCHANGE 1000
/* Reset the decl changecount after that number of draws */
#define VB_MAXFULLCONVERSIONS 5
/* Number of full conversions before we stop converting */
#define VB_RESETFULLCONVS 20
/* Reset full conversion counts after that number of draws */
/* Context activation is done by the caller. */
static
void
buffer_create_buffer_object
(
struct
wined3d_buffer
*
This
)
...
...
@@ -711,8 +713,8 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
}
else
{
context_release
(
context
);
return
;
/* Not doing any conversion */
/* Not doing any conversion */
goto
end
;
}
}
...
...
@@ -728,6 +730,7 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
context_release
(
context
);
++
This
->
draw_count
;
if
(
This
->
draw_count
>
VB_RESETDECLCHANGE
)
This
->
decl_change_count
=
0
;
if
(
This
->
draw_count
>
VB_RESETFULLCONVS
)
This
->
full_conversion_count
=
0
;
return
;
}
...
...
@@ -753,8 +756,7 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
* rarely
*/
IWineD3DDeviceImpl_MarkStateDirty
(
device
,
STATE_STREAMSRC
);
context_release
(
context
);
return
;
goto
end
;
}
buffer_check_buffer_object_size
(
This
);
}
...
...
@@ -764,8 +766,24 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
* changes it every minute drop the VBO after VB_MAX_DECL_CHANGES minutes. So count draws without
* decl changes and reset the decl change count after a specific number of them
*/
++
This
->
draw_count
;
if
(
This
->
draw_count
>
VB_RESETDECLCHANGE
)
This
->
decl_change_count
=
0
;
if
(
This
->
dirty_start
==
0
&&
This
->
dirty_end
==
This
->
resource
.
size
)
{
++
This
->
full_conversion_count
;
if
(
This
->
full_conversion_count
>
VB_MAXFULLCONVERSIONS
)
{
FIXME
(
"Too many full buffer conversions, stopping converting
\n
"
);
IWineD3DBuffer_UnLoad
(
iface
);
This
->
flags
&=
~
WINED3D_BUFFER_CREATEBO
;
IWineD3DDeviceImpl_MarkStateDirty
(
device
,
STATE_STREAMSRC
);
goto
end
;
}
}
else
{
++
This
->
draw_count
;
if
(
This
->
draw_count
>
VB_RESETDECLCHANGE
)
This
->
decl_change_count
=
0
;
if
(
This
->
draw_count
>
VB_RESETFULLCONVS
)
This
->
full_conversion_count
=
0
;
}
}
if
(
decl_changed
)
...
...
@@ -915,7 +933,10 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
}
HeapFree
(
GetProcessHeap
(),
0
,
data
);
end:
context_release
(
context
);
return
;
}
static
WINED3DRESOURCETYPE
STDMETHODCALLTYPE
buffer_GetType
(
IWineD3DBuffer
*
iface
)
...
...
dlls/wined3d/wined3d_private.h
View file @
4f594777
...
...
@@ -2373,7 +2373,7 @@ struct wined3d_buffer
LONG
lock_count
;
/* conversion stuff */
UINT
decl_change_count
;
UINT
decl_change_count
,
full_conversion_count
;
UINT
draw_count
;
UINT
stride
;
/* 0 if no conversion */
UINT
conversion_stride
;
/* 0 if no shifted conversion */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment