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
07fad29c
Commit
07fad29c
authored
Nov 15, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Nov 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Show that the implicit surfaces are not freed if refcount reaches 0.
parent
b7b28e33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
device.c
dlls/d3d8/tests/device.c
+19
-3
No files found.
dlls/d3d8/tests/device.c
View file @
07fad29c
...
...
@@ -265,6 +265,8 @@ static void test_refcount(void)
IDirect3DSurface8
*
pStencilSurface
=
NULL
;
IDirect3DSurface8
*
pImageSurface
=
NULL
;
IDirect3DSurface8
*
pRenderTarget
=
NULL
;
IDirect3DSurface8
*
pRenderTarget2
=
NULL
;
IDirect3DSurface8
*
pRenderTarget3
=
NULL
;
IDirect3DSurface8
*
pTextureLevel
=
NULL
;
IDirect3DSurface8
*
pBackBuffer
=
NULL
;
DWORD
dStateBlock
=
-
1
;
...
...
@@ -323,6 +325,7 @@ static void test_refcount(void)
* - the container is the device
* - they hold a refernce to the device
* - they are created with a refcount of 0 (Get/Release returns orignial refcount)
* - they are not freed if refcount reaches 0.
* - the refcount is not forwarded to the container.
*/
hr
=
IDirect3DDevice8_GetRenderTarget
(
pDevice
,
&
pRenderTarget
);
...
...
@@ -362,7 +365,6 @@ static void test_refcount(void)
pBackBuffer
=
NULL
;
}
CHECK_REFCOUNT
(
pDevice
,
--
refcount
);
pRenderTarget
=
NULL
;
hr
=
IDirect3DDevice8_GetDepthStencilSurface
(
pDevice
,
&
pStencilSurface
);
todo_wine
CHECK_CALL
(
hr
,
"GetDepthStencilSurface"
,
pDevice
,
++
refcount
);
...
...
@@ -476,7 +478,7 @@ static void test_refcount(void)
CHECK_CALL
(
hr
,
"CreateDepthStencilSurface"
,
pDevice
,
++
refcount
);
hr
=
IDirect3DDevice8_CreateImageSurface
(
pDevice
,
32
,
32
,
D3DFMT_X8R8G8B8
,
&
pImageSurface
);
CHECK_CALL
(
hr
,
"CreateImageSurface"
,
pDevice
,
++
refcount
);
hr
=
IDirect3DDevice8_CreateRenderTarget
(
pDevice
,
32
,
32
,
D3DFMT_X8R8G8B8
,
D3DMULTISAMPLE_NONE
,
TRUE
,
&
pRenderTarget
);
hr
=
IDirect3DDevice8_CreateRenderTarget
(
pDevice
,
32
,
32
,
D3DFMT_X8R8G8B8
,
D3DMULTISAMPLE_NONE
,
TRUE
,
&
pRenderTarget
3
);
CHECK_CALL
(
hr
,
"CreateRenderTarget"
,
pDevice
,
++
refcount
);
/* Misc */
hr
=
IDirect3DDevice8_CreateStateBlock
(
pDevice
,
D3DSBT_ALL
,
&
dStateBlock
);
...
...
@@ -520,6 +522,20 @@ static void test_refcount(void)
ok
(
hr
==
D3D_OK
,
"IDirect3DVertexBuffer8::Unlock failed with %08x
\n
"
,
hr
);
}
/* The implicit render target is not freed if refcount reaches 0.
* Otherwise GetRenderTarget would re-allocate it and the pointer would change.*/
hr
=
IDirect3DDevice8_GetRenderTarget
(
pDevice
,
&
pRenderTarget2
);
todo_wine
CHECK_CALL
(
hr
,
"GetRenderTarget"
,
pDevice
,
++
refcount
);
if
(
pRenderTarget2
)
{
todo_wine
CHECK_RELEASE_REFCOUNT
(
pRenderTarget2
,
0
);
ok
(
pRenderTarget
==
pRenderTarget2
,
"RenderTarget=%p and RenderTarget2=%p should be the same.
\n
"
,
pRenderTarget
,
pRenderTarget2
);
CHECK_REFCOUNT
(
pDevice
,
--
refcount
);
pRenderTarget2
=
NULL
;
}
pRenderTarget
=
NULL
;
cleanup:
CHECK_RELEASE
(
pDevice
,
pDevice
,
--
refcount
);
...
...
@@ -536,7 +552,7 @@ cleanup:
/* Surfaces */
CHECK_RELEASE
(
pStencilSurface
,
pDevice
,
--
refcount
);
CHECK_RELEASE
(
pImageSurface
,
pDevice
,
--
refcount
);
CHECK_RELEASE
(
pRenderTarget
,
pDevice
,
--
refcount
);
CHECK_RELEASE
(
pRenderTarget
3
,
pDevice
,
--
refcount
);
/* Misc */
if
(
dStateBlock
!=
-
1
)
IDirect3DDevice8_DeleteStateBlock
(
pDevice
,
dStateBlock
);
/* This will destroy device - cannot check the refcount here */
...
...
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