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
387f65ba
Commit
387f65ba
authored
Feb 13, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Implement d3d10_texture2d_GetDevice().
parent
b22ee99f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
7 deletions
+48
-7
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+1
-0
device.c
dlls/d3d10core/tests/device.c
+28
-2
texture.c
dlls/d3d10core/texture.c
+19
-1
surface.c
dlls/dxgi/surface.c
+0
-4
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
387f65ba
...
...
@@ -81,6 +81,7 @@ struct d3d10_texture2d
IUnknown
*
dxgi_surface
;
struct
wined3d_texture
*
wined3d_texture
;
D3D10_TEXTURE2D_DESC
desc
;
ID3D10Device1
*
device
;
};
HRESULT
d3d10_texture2d_init
(
struct
d3d10_texture2d
*
texture
,
struct
d3d10_device
*
device
,
...
...
dlls/d3d10core/tests/device.c
View file @
387f65ba
...
...
@@ -21,6 +21,12 @@
#include "d3d10.h"
#include "wine/test.h"
static
ULONG
get_refcount
(
IUnknown
*
iface
)
{
IUnknown_AddRef
(
iface
);
return
IUnknown_Release
(
iface
);
}
static
ID3D10Device
*
create_device
(
void
)
{
ID3D10Device
*
device
;
...
...
@@ -37,11 +43,11 @@ static ID3D10Device *create_device(void)
static
void
test_create_texture2d
(
void
)
{
ULONG
refcount
,
expected_refcount
;
ID3D10Device
*
device
,
*
tmp
;
D3D10_TEXTURE2D_DESC
desc
;
ID3D10Texture2D
*
texture
;
IDXGISurface
*
surface
;
ID3D10Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
...
...
@@ -62,8 +68,18 @@ static void test_create_texture2d(void)
desc
.
CPUAccessFlags
=
0
;
desc
.
MiscFlags
=
0
;
expected_refcount
=
get_refcount
((
IUnknown
*
)
device
)
+
1
;
hr
=
ID3D10Device_CreateTexture2D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a 2d texture, hr %#x
\n
"
,
hr
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
>=
expected_refcount
,
"Got unexpected refcount %u, expected >= %u.
\n
"
,
refcount
,
expected_refcount
);
tmp
=
NULL
;
expected_refcount
=
refcount
+
1
;
ID3D10Texture2D_GetDevice
(
texture
,
&
tmp
);
ok
(
tmp
==
device
,
"Got unexpected device %p, expected %p.
\n
"
,
tmp
,
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ID3D10Device_Release
(
tmp
);
hr
=
ID3D10Texture2D_QueryInterface
(
texture
,
&
IID_IDXGISurface
,
(
void
**
)
&
surface
);
ok
(
SUCCEEDED
(
hr
),
"Texture should implement IDXGISurface
\n
"
);
...
...
@@ -71,8 +87,18 @@ static void test_create_texture2d(void)
ID3D10Texture2D_Release
(
texture
);
desc
.
MipLevels
=
0
;
expected_refcount
=
get_refcount
((
IUnknown
*
)
device
)
+
1
;
hr
=
ID3D10Device_CreateTexture2D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a 2d texture, hr %#x
\n
"
,
hr
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
>=
expected_refcount
,
"Got unexpected refcount %u, expected >= %u.
\n
"
,
refcount
,
expected_refcount
);
tmp
=
NULL
;
expected_refcount
=
refcount
+
1
;
ID3D10Texture2D_GetDevice
(
texture
,
&
tmp
);
ok
(
tmp
==
device
,
"Got unexpected device %p, expected %p.
\n
"
,
tmp
,
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ID3D10Device_Release
(
tmp
);
ID3D10Texture2D_GetDesc
(
texture
,
&
desc
);
ok
(
desc
.
Width
==
512
,
"Got unexpected Width %u.
\n
"
,
desc
.
Width
);
...
...
dlls/d3d10core/texture.c
View file @
387f65ba
...
...
@@ -67,7 +67,10 @@ static ULONG STDMETHODCALLTYPE d3d10_texture2d_AddRef(ID3D10Texture2D *iface)
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
if
(
refcount
==
1
)
{
ID3D10Device1_AddRef
(
This
->
device
);
wined3d_texture_incref
(
This
->
wined3d_texture
);
}
return
refcount
;
}
...
...
@@ -88,7 +91,14 @@ static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface)
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
if
(
!
refcount
)
{
ID3D10Device1
*
device
=
This
->
device
;
wined3d_texture_decref
(
This
->
wined3d_texture
);
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D10Device1_Release
(
device
);
}
return
refcount
;
}
...
...
@@ -97,7 +107,12 @@ static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface)
static
void
STDMETHODCALLTYPE
d3d10_texture2d_GetDevice
(
ID3D10Texture2D
*
iface
,
ID3D10Device
**
device
)
{
FIXME
(
"iface %p, device %p stub!
\n
"
,
iface
,
device
);
struct
d3d10_texture2d
*
texture
=
impl_from_ID3D10Texture2D
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
ID3D10Device
*
)
texture
->
device
;
ID3D10Device_AddRef
(
*
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_texture2d_GetPrivateData
(
ID3D10Texture2D
*
iface
,
...
...
@@ -283,6 +298,9 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
}
texture
->
desc
.
MipLevels
=
wined3d_texture_get_level_count
(
texture
->
wined3d_texture
);
texture
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
texture
->
device
);
return
S_OK
;
}
...
...
dlls/dxgi/surface.c
View file @
387f65ba
...
...
@@ -71,10 +71,7 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_inner_Release(IUnknown *iface)
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
surface
,
refcount
);
if
(
!
refcount
)
{
IDXGIDevice_Release
(
surface
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
return
refcount
;
}
...
...
@@ -210,7 +207,6 @@ HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUn
surface
->
refcount
=
1
;
surface
->
outer_unknown
=
outer
?
outer
:
&
surface
->
IUnknown_iface
;
surface
->
device
=
device
;
IDXGIDevice_AddRef
(
device
);
return
S_OK
;
}
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