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
3581d8e8
Commit
3581d8e8
authored
Jan 06, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Do not keep internal references on vertex buffers.
parent
467fa4e7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
20 deletions
+35
-20
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-1
device.c
dlls/ddraw/device.c
+6
-1
direct3d.c
dlls/ddraw/direct3d.c
+1
-0
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+26
-0
device.c
dlls/wined3d/device.c
+0
-11
stateblock.c
dlls/wined3d/stateblock.c
+0
-7
No files found.
dlls/ddraw/ddraw_private.h
View file @
3581d8e8
...
...
@@ -578,8 +578,9 @@ struct IDirect3DVertexBufferImpl
ICOM_VFIELD_MULTI
(
IDirect3DVertexBuffer
);
LONG
ref
;
/*** WineD3D
link
***/
/*** WineD3D
and ddraw links
***/
IWineD3DVertexBuffer
*
wineD3DVertexBuffer
;
IDirectDrawImpl
*
ddraw
;
/*** Storage for D3D7 specific things ***/
DWORD
Caps
;
...
...
dlls/ddraw/device.c
View file @
3581d8e8
...
...
@@ -288,7 +288,7 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
IParent
*
IndexBufferParent
;
DWORD
i
;
/* Free the index buffer */
/* Free the index buffer
.
*/
IWineD3DDevice_SetIndices
(
This
->
wineD3DDevice
,
NULL
,
0
);
...
...
@@ -300,6 +300,11 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
ERR
(
" (%p) Something is still holding the index buffer parent %p
\n
"
,
This
,
IndexBufferParent
);
}
/* There is no need to unset the vertex buffer here, IWineD3DDevice_Uninit3D will do that when
* destroying the primary stateblock. If a vertex buffer is destroyed while it is bound
* IDirect3DVertexBuffer::Release will unset it.
*/
/* Restore the render targets */
if
(
This
->
OffScreenTarget
)
{
...
...
dlls/ddraw/direct3d.c
View file @
3581d8e8
...
...
@@ -997,6 +997,7 @@ IDirect3DImpl_7_CreateVertexBuffer(IDirect3D7 *iface,
ICOM_INIT_INTERFACE
(
object
,
IDirect3DVertexBuffer
,
IDirect3DVertexBuffer1_Vtbl
);
object
->
Caps
=
Desc
->
dwCaps
;
object
->
ddraw
=
This
;
hr
=
IWineD3DDevice_CreateVertexBuffer
(
This
->
wineD3DDevice
,
get_flexible_vertex_size
(
Desc
->
dwFVF
)
*
Desc
->
dwNumVertices
,
...
...
dlls/ddraw/vertexbuffer.c
View file @
3581d8e8
...
...
@@ -164,6 +164,32 @@ IDirect3DVertexBufferImpl_Release(IDirect3DVertexBuffer7 *iface)
if
(
ref
==
0
)
{
IWineD3DVertexBuffer
*
curVB
=
NULL
;
UINT
offset
,
stride
;
/* D3D7 Vertex buffers don't stay bound in the device, they are passed as a parameter
* to drawPrimitiveVB. DrawPrimitiveVB sets them as the stream source in wined3d,
* and they should get unset there before they are destroyed
*/
IWineD3DDevice_GetStreamSource
(
This
->
ddraw
->
wineD3DDevice
,
0
/* Stream number */
,
&
curVB
,
&
offset
,
&
stride
);
if
(
curVB
==
This
->
wineD3DVertexBuffer
)
{
IWineD3DDevice_SetStreamSource
(
This
->
ddraw
->
wineD3DDevice
,
0
/* Steam number */
,
NULL
/* stream data */
,
0
/* Offset */
,
0
/* stride */
);
}
if
(
curVB
)
{
IWineD3DVertexBuffer_Release
(
curVB
);
/* For the GetStreamSource */
}
IWineD3DVertexBuffer_Release
(
This
->
wineD3DVertexBuffer
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
...
...
dlls/wined3d/device.c
View file @
3581d8e8
...
...
@@ -2248,11 +2248,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface,
}
vbImpl
->
stream
=
StreamNumber
;
vbImpl
->
Flags
|=
VBFLAG_STREAM
;
IWineD3DVertexBuffer_AddRef
(
pStreamData
);
}
if
(
oldSrc
!=
NULL
)
{
((
IWineD3DVertexBufferImpl
*
)
oldSrc
)
->
Flags
&=
~
VBFLAG_STREAM
;
IWineD3DVertexBuffer_Release
(
oldSrc
);
}
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_STREAMSRC
);
...
...
@@ -4731,11 +4729,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawPrimitiveUP(IWineD3DDevice *iface,
debug_d3dprimitivetype
(
PrimitiveType
),
PrimitiveCount
,
pVertexStreamZeroData
,
VertexStreamZeroStride
);
/* release the stream source */
if
(
This
->
stateBlock
->
streamSource
[
0
]
!=
NULL
)
{
IWineD3DVertexBuffer_Release
(
This
->
stateBlock
->
streamSource
[
0
]);
}
/* Note in the following, it's not this type, but that's the purpose of streamIsUP */
This
->
stateBlock
->
streamSource
[
0
]
=
(
IWineD3DVertexBuffer
*
)
pVertexStreamZeroData
;
This
->
stateBlock
->
streamStride
[
0
]
=
VertexStreamZeroStride
;
...
...
@@ -4777,10 +4770,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *
idxStride
=
4
;
}
/* release the stream and index data */
if
(
This
->
stateBlock
->
streamSource
[
0
]
!=
NULL
)
{
IWineD3DVertexBuffer_Release
(
This
->
stateBlock
->
streamSource
[
0
]);
}
if
(
This
->
stateBlock
->
pIndexData
)
{
IWineD3DIndexBuffer_Release
(
This
->
stateBlock
->
pIndexData
);
}
...
...
dlls/wined3d/stateblock.c
View file @
3581d8e8
...
...
@@ -232,13 +232,6 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
if
(
This
->
blockType
==
WINED3DSBT_INIT
)
{
int
counter
;
FIXME
(
"Releasing primary stateblock
\n
"
);
/* Free any streams still bound */
for
(
counter
=
0
;
counter
<
MAX_STREAMS
;
counter
++
)
{
if
(
This
->
streamSource
[
counter
]
!=
NULL
)
{
IWineD3DVertexBuffer_Release
(
This
->
streamSource
[
counter
]);
This
->
streamSource
[
counter
]
=
NULL
;
}
}
/* free any index data */
if
(
This
->
pIndexData
)
{
...
...
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