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
9c676e6c
Commit
9c676e6c
authored
Oct 27, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Oct 27, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed index and vertex buffer so that internal references are
counted separately to external ones.
parent
defdb25d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
6 deletions
+72
-6
d3d8_private.h
dlls/d3d8/d3d8_private.h
+10
-0
device.c
dlls/d3d8/device.c
+4
-4
indexbuffer.c
dlls/d3d8/indexbuffer.c
+30
-1
vertexbuffer.c
dlls/d3d8/vertexbuffer.c
+28
-1
No files found.
dlls/d3d8/d3d8_private.h
View file @
9c676e6c
...
...
@@ -790,6 +790,7 @@ struct IDirect3DVertexBuffer8Impl
/* IUnknown fields */
const
IDirect3DVertexBuffer8Vtbl
*
lpVtbl
;
LONG
ref
;
LONG
refInt
;
/* IDirect3DResource8 fields */
IDirect3DDevice8Impl
*
Device
;
...
...
@@ -805,6 +806,10 @@ extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT
extern
ULONG
WINAPI
IDirect3DVertexBuffer8Impl_AddRef
(
LPDIRECT3DVERTEXBUFFER8
iface
);
extern
ULONG
WINAPI
IDirect3DVertexBuffer8Impl_Release
(
LPDIRECT3DVERTEXBUFFER8
iface
);
/* Internal */
extern
ULONG
WINAPI
IDirect3DVertexBuffer8Impl_AddRefInt
(
LPDIRECT3DVERTEXBUFFER8
iface
);
extern
ULONG
WINAPI
IDirect3DVertexBuffer8Impl_ReleaseInt
(
LPDIRECT3DVERTEXBUFFER8
iface
);
/* IDirect3DVertexBuffer8: (Inherited from IDirect3DResource8) */
extern
HRESULT
WINAPI
IDirect3DVertexBuffer8Impl_GetDevice
(
LPDIRECT3DVERTEXBUFFER8
iface
,
IDirect3DDevice8
**
ppDevice
);
extern
HRESULT
WINAPI
IDirect3DVertexBuffer8Impl_SetPrivateData
(
LPDIRECT3DVERTEXBUFFER8
iface
,
REFGUID
refguid
,
CONST
void
*
pData
,
DWORD
SizeOfData
,
DWORD
Flags
);
...
...
@@ -838,6 +843,7 @@ struct IDirect3DIndexBuffer8Impl
/* IUnknown fields */
const
IDirect3DIndexBuffer8Vtbl
*
lpVtbl
;
LONG
ref
;
LONG
refInt
;
/* IDirect3DResource8 fields */
IDirect3DDevice8Impl
*
Device
;
...
...
@@ -853,6 +859,10 @@ extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3
extern
ULONG
WINAPI
IDirect3DIndexBuffer8Impl_AddRef
(
LPDIRECT3DINDEXBUFFER8
iface
);
extern
ULONG
WINAPI
IDirect3DIndexBuffer8Impl_Release
(
LPDIRECT3DINDEXBUFFER8
iface
);
/* Internal */
extern
ULONG
WINAPI
IDirect3DIndexBuffer8Impl_AddRefInt
(
LPDIRECT3DINDEXBUFFER8
iface
);
extern
ULONG
WINAPI
IDirect3DIndexBuffer8Impl_ReleaseInt
(
LPDIRECT3DINDEXBUFFER8
iface
);
/* IDirect3DIndexBuffer8: (Inherited from IDirect3DResource8) */
extern
HRESULT
WINAPI
IDirect3DIndexBuffer8Impl_GetDevice
(
LPDIRECT3DINDEXBUFFER8
iface
,
IDirect3DDevice8
**
ppDevice
);
extern
HRESULT
WINAPI
IDirect3DIndexBuffer8Impl_SetPrivateData
(
LPDIRECT3DINDEXBUFFER8
iface
,
REFGUID
refguid
,
CONST
void
*
pData
,
DWORD
SizeOfData
,
DWORD
Flags
);
...
...
dlls/d3d8/device.c
View file @
9c676e6c
...
...
@@ -4164,8 +4164,8 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, IDirec
return
D3D_OK
;
}
if
(
oldIdxs
)
IDirect3DIndexBuffer8Impl_Release
(
oldIdxs
);
if
(
pIndexData
)
IDirect3DIndexBuffer8Impl_AddRef
(
This
->
StateBlock
->
pIndexData
);
if
(
pIndexData
)
IDirect3DIndexBuffer8Impl_AddRefInt
(
This
->
StateBlock
->
pIndexData
);
if
(
oldIdxs
)
IDirect3DIndexBuffer8Impl_ReleaseInt
(
oldIdxs
);
return
D3D_OK
;
}
HRESULT
WINAPI
IDirect3DDevice8Impl_GetIndices
(
LPDIRECT3DDEVICE8
iface
,
IDirect3DIndexBuffer8
**
ppIndexData
,
UINT
*
pBaseVertexIndex
)
{
...
...
@@ -4337,8 +4337,8 @@ HRESULT WINAPI IDirect3DDevice8Impl_SetStreamSource(LPDIRECT3DDEVICE8 iface, U
return
D3D_OK
;
}
if
(
oldSrc
!=
NULL
)
IDirect3DVertexBuffer8Impl_Release
(
oldSrc
);
if
(
pStreamData
!=
NULL
)
IDirect3DVertexBuffer8Impl_AddRef
(
pStreamData
);
if
(
pStreamData
!=
NULL
)
IDirect3DVertexBuffer8Impl_AddRefInt
(
pStreamData
);
if
(
oldSrc
!=
NULL
)
IDirect3DVertexBuffer8Impl_ReleaseInt
(
oldSrc
);
return
D3D_OK
;
}
HRESULT
WINAPI
IDirect3DDevice8Impl_GetStreamSource
(
LPDIRECT3DDEVICE8
iface
,
UINT
StreamNumber
,
IDirect3DVertexBuffer8
**
pStream
,
UINT
*
pStride
)
{
...
...
dlls/d3d8/indexbuffer.c
View file @
9c676e6c
...
...
@@ -64,13 +64,42 @@ ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface) {
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
if
(
ref
==
0
&&
0
==
This
->
refInt
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
allocatedMemory
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
else
if
(
0
==
ref
)
{
WARN
(
"(%p) : The application failed to set indicies NULL before releasing the index buffer, leak
\n
"
,
This
);
}
return
ref
;
}
ULONG
WINAPI
IDirect3DIndexBuffer8Impl_AddRefInt
(
LPDIRECT3DINDEXBUFFER8
iface
)
{
IDirect3DIndexBuffer8Impl
*
This
=
(
IDirect3DIndexBuffer8Impl
*
)
iface
;
ULONG
refInt
=
InterlockedIncrement
(
&
This
->
refInt
);
TRACE
(
"(%p) : AddRefInt from %ld
\n
"
,
This
,
refInt
-
1
);
return
refInt
;
}
ULONG
WINAPI
IDirect3DIndexBuffer8Impl_ReleaseInt
(
LPDIRECT3DINDEXBUFFER8
iface
)
{
IDirect3DIndexBuffer8Impl
*
This
=
(
IDirect3DIndexBuffer8Impl
*
)
iface
;
ULONG
refInt
=
InterlockedDecrement
(
&
This
->
refInt
);
TRACE
(
"(%p) : ReleaseRefInt to %ld
\n
"
,
This
,
refInt
);
if
(
0
==
This
->
ref
&&
0
==
refInt
)
{
WARN
(
"(%p) : Cleaning up after the calling application failed to release the indicies properly
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
allocatedMemory
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
refInt
;
}
/* IDirect3DResource Interface follow: */
HRESULT
WINAPI
IDirect3DIndexBuffer8Impl_GetDevice
(
LPDIRECT3DINDEXBUFFER8
iface
,
IDirect3DDevice8
**
ppDevice
)
{
IDirect3DIndexBuffer8Impl
*
This
=
(
IDirect3DIndexBuffer8Impl
*
)
iface
;
...
...
dlls/d3d8/vertexbuffer.c
View file @
9c676e6c
...
...
@@ -64,13 +64,40 @@ ULONG WINAPI IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface) {
TRACE
(
"(%p) : ReleaseRef to %ld
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
if
(
ref
==
0
&&
0
==
This
->
refInt
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
allocatedMemory
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
else
if
(
0
==
ref
)
{
WARN
(
"(%p) : The application failed to set Stream source to NULL before releasing the vertex shader, leak
\n
"
,
This
);
}
return
ref
;
}
ULONG
WINAPI
IDirect3DVertexBuffer8Impl_AddRefInt
(
LPDIRECT3DVERTEXBUFFER8
iface
)
{
IDirect3DVertexBuffer8Impl
*
This
=
(
IDirect3DVertexBuffer8Impl
*
)
iface
;
ULONG
refInt
=
InterlockedIncrement
(
&
This
->
refInt
);
TRACE
(
"(%p) : AddRefInt from %ld
\n
"
,
This
,
refInt
-
1
);
return
refInt
;
}
ULONG
WINAPI
IDirect3DVertexBuffer8Impl_ReleaseInt
(
LPDIRECT3DVERTEXBUFFER8
iface
)
{
IDirect3DVertexBuffer8Impl
*
This
=
(
IDirect3DVertexBuffer8Impl
*
)
iface
;
ULONG
refInt
=
InterlockedDecrement
(
&
This
->
refInt
);
TRACE
(
"(%p) : ReleaseRefInt to %ld
\n
"
,
This
,
refInt
);
if
(
0
==
This
->
ref
&&
0
==
refInt
)
{
WARN
(
"(%p) : Cleaning up after the calling application failed to release the stream source properly
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
allocatedMemory
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
refInt
;
}
/* IDirect3DResource Interface follow: */
HRESULT
WINAPI
IDirect3DVertexBuffer8Impl_GetDevice
(
LPDIRECT3DVERTEXBUFFER8
iface
,
IDirect3DDevice8
**
ppDevice
)
{
IDirect3DVertexBuffer8Impl
*
This
=
(
IDirect3DVertexBuffer8Impl
*
)
iface
;
...
...
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