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
06ca9e22
Commit
06ca9e22
authored
Aug 26, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Add ID3D11Texture2D stub interface.
parent
7f2ebb33
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
159 additions
and
39 deletions
+159
-39
d3d11_private.h
dlls/d3d11/d3d11_private.h
+6
-0
device.c
dlls/d3d11/device.c
+5
-2
texture.c
dlls/d3d11/texture.c
+148
-37
No files found.
dlls/d3d11/d3d11_private.h
View file @
06ca9e22
...
...
@@ -87,6 +87,7 @@ HRESULT parse_dxbc(const char *data, SIZE_T data_size,
/* ID3D10Texture2D */
struct
d3d10_texture2d
{
ID3D11Texture2D
ID3D11Texture2D_iface
;
ID3D10Texture2D
ID3D10Texture2D_iface
;
LONG
refcount
;
...
...
@@ -97,6 +98,11 @@ struct d3d10_texture2d
ID3D10Device1
*
device
;
};
static
inline
struct
d3d10_texture2d
*
impl_from_ID3D10Texture2D
(
ID3D10Texture2D
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_texture2d
,
ID3D10Texture2D_iface
);
}
HRESULT
d3d10_texture2d_init
(
struct
d3d10_texture2d
*
texture
,
struct
d3d_device
*
device
,
const
D3D10_TEXTURE2D_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
initial_data
)
DECLSPEC_HIDDEN
;
struct
d3d10_texture2d
*
unsafe_impl_from_ID3D10Texture2D
(
ID3D10Texture2D
*
iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3d11/device.c
View file @
06ca9e22
...
...
@@ -2888,6 +2888,7 @@ static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_devic
struct
d3d_device
*
device
=
device_from_wined3d_device_parent
(
device_parent
);
struct
wined3d_resource
*
sub_resource
;
struct
d3d10_texture2d
*
texture
;
ID3D10Texture2D
*
texture_iface
;
D3D10_TEXTURE2D_DESC
desc
;
HRESULT
hr
;
...
...
@@ -2909,16 +2910,18 @@ static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_devic
desc
.
MiscFlags
=
0
;
if
(
FAILED
(
hr
=
d3d10_device_CreateTexture2D
(
&
device
->
ID3D10Device1_iface
,
&
desc
,
NULL
,
(
ID3D10Texture2D
**
)
&
textur
e
)))
&
desc
,
NULL
,
&
texture_ifac
e
)))
{
ERR
(
"CreateTexture2D failed, returning %#x
\n
"
,
hr
);
return
hr
;
}
texture
=
impl_from_ID3D10Texture2D
(
texture_iface
);
sub_resource
=
wined3d_texture_get_sub_resource
(
texture
->
wined3d_texture
,
0
);
*
surface
=
wined3d_surface_from_resource
(
sub_resource
);
wined3d_surface_incref
(
*
surface
);
ID3D10Texture2D_Release
(
&
texture
->
ID3D10Texture2D
_iface
);
ID3D10Texture2D_Release
(
texture
_iface
);
return
S_OK
;
}
...
...
dlls/d3d11/texture.c
View file @
06ca9e22
...
...
@@ -24,81 +24,80 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d11
);
static
inline
struct
d3d10_texture2d
*
impl_from_ID3D10Texture2D
(
ID3D10Texture2D
*
iface
)
/* ID3D11Texture2D methods */
static
inline
struct
d3d10_texture2d
*
impl_from_ID3D11Texture2D
(
ID3D11Texture2D
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_texture2d
,
ID3D1
0
Texture2D_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_texture2d
,
ID3D1
1
Texture2D_iface
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_texture2d_QueryInterface
(
ID3D10Texture2D
*
iface
,
REFIID
riid
,
void
**
object
)
static
HRESULT
STDMETHODCALLTYPE
d3d11_texture2d_QueryInterface
(
ID3D11Texture2D
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
d3d10_texture2d
*
This
=
impl_from_ID3D10
Texture2D
(
iface
);
struct
d3d10_texture2d
*
texture
=
impl_from_ID3D11
Texture2D
(
iface
);
TRACE
(
"iface %p, riid %s, object %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
TRACE
(
"iface %p, riid %s, object %p
.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D1
0
Texture2D
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D1
0
Resource
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D1
0
DeviceChild
)
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D1
1
Texture2D
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D1
1
Resource
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D1
1
DeviceChild
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IUnknown_AddRef
(
iface
);
*
object
=
iface
;
*
object
=
&
texture
->
ID3D11Texture2D_iface
;
IUnknown_AddRef
((
IUnknown
*
)
*
object
);
return
S_OK
;
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D10Texture2D
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10Resource
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10DeviceChild
))
{
*
object
=
&
texture
->
ID3D10Texture2D_iface
;
IUnknown_AddRef
((
IUnknown
*
)
*
object
);
return
S_OK
;
}
if
(
This
->
dxgi_surface
)
if
(
texture
->
dxgi_surface
)
{
TRACE
(
"Forwarding to dxgi surface
\n
"
);
return
IUnknown_QueryInterface
(
This
->
dxgi_surface
,
riid
,
object
);
TRACE
(
"Forwarding to dxgi surface
.
\n
"
);
return
IUnknown_QueryInterface
(
texture
->
dxgi_surface
,
riid
,
object
);
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
WARN
(
"%s not implemented, returning E_NOINTERFACE
.
\n
"
,
debugstr_guid
(
riid
));
*
object
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
d3d1
0_texture2d_AddRef
(
ID3D10
Texture2D
*
iface
)
static
ULONG
STDMETHODCALLTYPE
d3d1
1_texture2d_AddRef
(
ID3D11
Texture2D
*
iface
)
{
struct
d3d10_texture2d
*
This
=
impl_from_ID3D10
Texture2D
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
struct
d3d10_texture2d
*
texture
=
impl_from_ID3D11
Texture2D
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
texture
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p increasing refcount to %u
.
\n
"
,
texture
,
refcount
);
if
(
refcount
==
1
)
{
ID3D10Device1_AddRef
(
This
->
device
);
ID3D10Device1_AddRef
(
texture
->
device
);
wined3d_mutex_lock
();
wined3d_texture_incref
(
This
->
wined3d_texture
);
wined3d_texture_incref
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
}
return
refcount
;
}
static
void
STDMETHODCALLTYPE
d3d10_texture2d_wined3d_object_released
(
void
*
parent
)
static
ULONG
STDMETHODCALLTYPE
d3d11_texture2d_Release
(
ID3D11Texture2D
*
iface
)
{
struct
d3d10_texture2d
*
This
=
parent
;
if
(
This
->
dxgi_surface
)
IUnknown_Release
(
This
->
dxgi_surface
);
wined3d_private_store_cleanup
(
&
This
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_texture2d_Release
(
ID3D10Texture2D
*
iface
)
{
struct
d3d10_texture2d
*
This
=
impl_from_ID3D10Texture2D
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
struct
d3d10_texture2d
*
texture
=
impl_from_ID3D11Texture2D
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
texture
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p decreasing refcount to %u
.
\n
"
,
texture
,
refcount
);
if
(
!
refcount
)
{
ID3D10Device1
*
device
=
This
->
device
;
ID3D10Device1
*
device
=
texture
->
device
;
wined3d_mutex_lock
();
wined3d_texture_decref
(
This
->
wined3d_texture
);
wined3d_texture_decref
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
...
...
@@ -108,6 +107,117 @@ static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface)
return
refcount
;
}
static
void
STDMETHODCALLTYPE
d3d11_texture2d_GetDevice
(
ID3D11Texture2D
*
iface
,
ID3D11Device
**
device
)
{
FIXME
(
"iface %p, device %p stub!
\n
"
,
iface
,
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_texture2d_GetPrivateData
(
ID3D11Texture2D
*
iface
,
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
{
FIXME
(
"iface %p, guid %s, data_size %p, data %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_texture2d_SetPrivateData
(
ID3D11Texture2D
*
iface
,
REFGUID
guid
,
UINT
data_size
,
const
void
*
data
)
{
FIXME
(
"iface %p, guid %s, data_size %u, data %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_texture2d_SetPrivateDataInterface
(
ID3D11Texture2D
*
iface
,
REFGUID
guid
,
const
IUnknown
*
data
)
{
FIXME
(
"iface %p, guid %s, data %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
data
);
return
E_NOTIMPL
;
}
static
void
STDMETHODCALLTYPE
d3d11_texture2d_GetType
(
ID3D11Texture2D
*
iface
,
D3D11_RESOURCE_DIMENSION
*
resource_dimension
)
{
TRACE
(
"iface %p, resource_dimension %p.
\n
"
,
iface
,
resource_dimension
);
*
resource_dimension
=
D3D11_RESOURCE_DIMENSION_TEXTURE2D
;
}
static
void
STDMETHODCALLTYPE
d3d11_texture2d_SetEvictionPriority
(
ID3D11Texture2D
*
iface
,
UINT
eviction_priority
)
{
FIXME
(
"iface %p, eviction_priority %#x stub!
\n
"
,
iface
,
eviction_priority
);
}
static
UINT
STDMETHODCALLTYPE
d3d11_texture2d_GetEvictionPriority
(
ID3D11Texture2D
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
0
;
}
static
void
STDMETHODCALLTYPE
d3d11_texture2d_GetDesc
(
ID3D11Texture2D
*
iface
,
D3D11_TEXTURE2D_DESC
*
desc
)
{
FIXME
(
"iface %p, desc %p stub!
\n
"
,
iface
,
desc
);
}
static
const
struct
ID3D11Texture2DVtbl
d3d11_texture2d_vtbl
=
{
/* IUnknown methods */
d3d11_texture2d_QueryInterface
,
d3d11_texture2d_AddRef
,
d3d11_texture2d_Release
,
/* ID3D11DeviceChild methods */
d3d11_texture2d_GetDevice
,
d3d11_texture2d_GetPrivateData
,
d3d11_texture2d_SetPrivateData
,
d3d11_texture2d_SetPrivateDataInterface
,
/* ID3D11Resource methods */
d3d11_texture2d_GetType
,
d3d11_texture2d_SetEvictionPriority
,
d3d11_texture2d_GetEvictionPriority
,
/* ID3D11Texture2D methods */
d3d11_texture2d_GetDesc
,
};
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_texture2d_QueryInterface
(
ID3D10Texture2D
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
d3d10_texture2d
*
texture
=
impl_from_ID3D10Texture2D
(
iface
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
return
d3d11_texture2d_QueryInterface
(
&
texture
->
ID3D11Texture2D_iface
,
riid
,
object
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_texture2d_AddRef
(
ID3D10Texture2D
*
iface
)
{
struct
d3d10_texture2d
*
texture
=
impl_from_ID3D10Texture2D
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
d3d11_texture2d_AddRef
(
&
texture
->
ID3D11Texture2D_iface
);
}
static
void
STDMETHODCALLTYPE
d3d10_texture2d_wined3d_object_released
(
void
*
parent
)
{
struct
d3d10_texture2d
*
This
=
parent
;
if
(
This
->
dxgi_surface
)
IUnknown_Release
(
This
->
dxgi_surface
);
wined3d_private_store_cleanup
(
&
This
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
static
ULONG
STDMETHODCALLTYPE
d3d10_texture2d_Release
(
ID3D10Texture2D
*
iface
)
{
struct
d3d10_texture2d
*
texture
=
impl_from_ID3D10Texture2D
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
d3d11_texture2d_Release
(
&
texture
->
ID3D11Texture2D_iface
);
}
/* ID3D10DeviceChild methods */
static
void
STDMETHODCALLTYPE
d3d10_texture2d_GetDevice
(
ID3D10Texture2D
*
iface
,
ID3D10Device
**
device
)
...
...
@@ -317,6 +427,7 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d_device
unsigned
int
levels
;
HRESULT
hr
;
texture
->
ID3D11Texture2D_iface
.
lpVtbl
=
&
d3d11_texture2d_vtbl
;
texture
->
ID3D10Texture2D_iface
.
lpVtbl
=
&
d3d10_texture2d_vtbl
;
texture
->
refcount
=
1
;
wined3d_mutex_lock
();
...
...
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