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
674af501
Commit
674af501
authored
Sep 23, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Stop fixing up a VBO if the declaration changes too often.
parent
615db2b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
vertexbuffer.c
dlls/wined3d/vertexbuffer.c
+36
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/vertexbuffer.c
View file @
674af501
...
...
@@ -26,6 +26,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
#define GLINFO_LOCATION ((IWineD3DImpl *)(((IWineD3DDeviceImpl *)This->resource.wineD3DDevice)->wineD3D))->gl_info
#define VB_MAXDECLCHANGES 100
/* After that number we stop converting */
#define VB_RESETDECLCHANGE 1000
/* Reset the changecount after that number of draws */
/* *******************************************
IWineD3DVertexBuffer IUnknown parts follow
******************************************* */
...
...
@@ -278,6 +281,39 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if
}
declChanged
=
IWineD3DVertexBufferImpl_FindDecl
(
This
);
/* If applications change the declaration over and over, reconverting all the time is a huge
* performance hit. So count the declaration changes and release the VBO if there are too much
* of them(and thus stop converting)
*/
if
(
declChanged
)
{
This
->
declChanges
++
;
This
->
draws
=
0
;
if
(
This
->
declChanges
>
VB_MAXDECLCHANGES
)
{
if
(
This
->
resource
.
allocatedMemory
)
{
FIXME
(
"Too much declaration changes, stopping converting
\n
"
);
ENTER_GL
();
GL_EXTCALL
(
glDeleteBuffersARB
(
1
,
&
This
->
vbo
));
checkGLcall
(
"glDeleteBuffersARB"
);
LEAVE_GL
();
This
->
vbo
=
0
;
return
;
}
/* Otherwise do not bother to release the VBO. If we're doing direct locking now,
* and the declarations changed the code below will fetch the VBO's contents, convert
* and on the next decl change the data will be in sysmem too and we can just release the VBO
*/
}
}
else
{
/* However, it is perfectly fine to change the declaration every now and then. We don't want a game that
* 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
->
draws
++
;
if
(
This
->
draws
>
VB_RESETDECLCHANGE
)
This
->
declChanges
=
0
;
}
if
(
declChanged
)
{
/* The declaration changed, reload the whole buffer */
WARN
(
"Reloading buffer because of decl change
\n
"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
674af501
...
...
@@ -655,6 +655,7 @@ typedef struct IWineD3DVertexBufferImpl
UINT
dirtystart
,
dirtyend
;
LONG
lockcount
;
LONG
declChanges
,
draws
;
/* Last description of the buffer */
WineDirect3DVertexStridedData
strided
;
}
IWineD3DVertexBufferImpl
;
...
...
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