Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
204126ec
Commit
204126ec
authored
Jun 08, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Create dxgi resource object for 3D textures.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
9b220b80
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
18 deletions
+54
-18
d3d11_private.h
dlls/d3d11/d3d11_private.h
+1
-1
d3d11.c
dlls/d3d11/tests/d3d11.c
+0
-2
texture.c
dlls/d3d11/texture.c
+53
-15
No files found.
dlls/d3d11/d3d11_private.h
View file @
204126ec
...
...
@@ -170,7 +170,7 @@ struct d3d_texture3d
ID3D10Texture3D
ID3D10Texture3D_iface
;
LONG
refcount
;
struct
wined3d_private_store
private_stor
e
;
IUnknown
*
dxgi_resourc
e
;
struct
wined3d_texture
*
wined3d_texture
;
D3D11_TEXTURE3D_DESC
desc
;
ID3D11Device2
*
device
;
...
...
dlls/d3d11/tests/d3d11.c
View file @
204126ec
...
...
@@ -3286,9 +3286,7 @@ static void test_texture3d_interfaces(void)
hr
=
ID3D11Device_CreateTexture3D
(
device
,
&
desc
,
NULL
,
&
texture
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
check_interface
(
texture
,
&
IID_IDXGISurface
,
FALSE
,
FALSE
);
todo_wine
check_interface
(
texture
,
&
IID_IDXGIResource
,
TRUE
,
FALSE
);
todo_wine
test_dxgi_resource
(
texture
);
hr
=
check_interface
(
texture
,
&
IID_ID3D10Texture3D
,
TRUE
,
TRUE
);
/* Not available on all Windows versions. */
ID3D11Texture3D_Release
(
texture
);
dlls/d3d11/texture.c
View file @
204126ec
...
...
@@ -1044,6 +1044,7 @@ static inline struct d3d_texture3d *impl_from_ID3D11Texture3D(ID3D11Texture3D *i
static
HRESULT
STDMETHODCALLTYPE
d3d11_texture3d_QueryInterface
(
ID3D11Texture3D
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
d3d_texture3d
*
texture
=
impl_from_ID3D11Texture3D
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
...
...
@@ -1065,10 +1066,15 @@ static HRESULT STDMETHODCALLTYPE d3d11_texture3d_QueryInterface(ID3D11Texture3D
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
)
);
TRACE
(
"Forwarding to dxgi resource.
\n
"
);
if
(
FAILED
(
hr
=
IUnknown_QueryInterface
(
texture
->
dxgi_resource
,
riid
,
object
)))
{
WARN
(
"%s not implemented, returning %#lx.
\n
"
,
debugstr_guid
(
riid
),
hr
);
*
object
=
NULL
;
return
E_NOINTERFACE
;
}
return
hr
;
}
static
ULONG
STDMETHODCALLTYPE
d3d11_texture3d_AddRef
(
ID3D11Texture3D
*
iface
)
...
...
@@ -1091,7 +1097,8 @@ static void STDMETHODCALLTYPE d3d_texture3d_wined3d_object_released(void *parent
{
struct
d3d_texture3d
*
texture
=
parent
;
wined3d_private_store_cleanup
(
&
texture
->
private_store
);
if
(
texture
->
dxgi_resource
)
IUnknown_Release
(
texture
->
dxgi_resource
);
heap_free
(
parent
);
}
...
...
@@ -1129,30 +1136,54 @@ static HRESULT STDMETHODCALLTYPE d3d11_texture3d_GetPrivateData(ID3D11Texture3D
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
{
struct
d3d_texture3d
*
texture
=
impl_from_ID3D11Texture3D
(
iface
);
IDXGIResource
*
dxgi_resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, data_size %p, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d_get_private_data
(
&
texture
->
private_store
,
guid
,
data_size
,
data
);
if
(
SUCCEEDED
(
hr
=
IUnknown_QueryInterface
(
texture
->
dxgi_resource
,
&
IID_IDXGIResource
,
(
void
**
)
&
dxgi_resource
)))
{
hr
=
IDXGIResource_GetPrivateData
(
dxgi_resource
,
guid
,
data_size
,
data
);
IDXGIResource_Release
(
dxgi_resource
);
}
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_texture3d_SetPrivateData
(
ID3D11Texture3D
*
iface
,
REFGUID
guid
,
UINT
data_size
,
const
void
*
data
)
{
struct
d3d_texture3d
*
texture
=
impl_from_ID3D11Texture3D
(
iface
);
IDXGIResource
*
dxgi_resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, data_size %u, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d_set_private_data
(
&
texture
->
private_store
,
guid
,
data_size
,
data
);
if
(
SUCCEEDED
(
hr
=
IUnknown_QueryInterface
(
texture
->
dxgi_resource
,
&
IID_IDXGIResource
,
(
void
**
)
&
dxgi_resource
)))
{
hr
=
IDXGIResource_SetPrivateData
(
dxgi_resource
,
guid
,
data_size
,
data
);
IDXGIResource_Release
(
dxgi_resource
);
}
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d11_texture3d_SetPrivateDataInterface
(
ID3D11Texture3D
*
iface
,
REFGUID
guid
,
const
IUnknown
*
data
)
{
struct
d3d_texture3d
*
texture
=
impl_from_ID3D11Texture3D
(
iface
);
IDXGIResource
*
dxgi_resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data
);
return
d3d_set_private_data_interface
(
&
texture
->
private_store
,
guid
,
data
);
if
(
SUCCEEDED
(
hr
=
IUnknown_QueryInterface
(
texture
->
dxgi_resource
,
&
IID_IDXGIResource
,
(
void
**
)
&
dxgi_resource
)))
{
hr
=
IDXGIResource_SetPrivateDataInterface
(
dxgi_resource
,
guid
,
data
);
IDXGIResource_Release
(
dxgi_resource
);
}
return
hr
;
}
static
void
STDMETHODCALLTYPE
d3d11_texture3d_GetType
(
ID3D11Texture3D
*
iface
,
...
...
@@ -1251,10 +1282,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_GetPrivateData(ID3D10Texture3D
{
struct
d3d_texture3d
*
texture
=
impl_from_ID3D10Texture3D
(
iface
);
TRACE
(
"iface %p, guid %s, data_size %p, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
TRACE
(
"iface %p, guid %s, data_size %p, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d
_get_private_data
(
&
texture
->
private_stor
e
,
guid
,
data_size
,
data
);
return
d3d
11_texture3d_GetPrivateData
(
&
texture
->
ID3D11Texture3D_ifac
e
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_texture3d_SetPrivateData
(
ID3D10Texture3D
*
iface
,
...
...
@@ -1262,10 +1292,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_SetPrivateData(ID3D10Texture3D
{
struct
d3d_texture3d
*
texture
=
impl_from_ID3D10Texture3D
(
iface
);
TRACE
(
"iface %p, guid %s, data_size %u, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
TRACE
(
"iface %p, guid %s, data_size %u, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d
_set_private_data
(
&
texture
->
private_stor
e
,
guid
,
data_size
,
data
);
return
d3d
11_texture3d_SetPrivateData
(
&
texture
->
ID3D11Texture3D_ifac
e
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_texture3d_SetPrivateDataInterface
(
ID3D10Texture3D
*
iface
,
...
...
@@ -1275,7 +1304,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_SetPrivateDataInterface(ID3D10T
TRACE
(
"iface %p, guid %s, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data
);
return
d3d
_set_private_data_interface
(
&
texture
->
private_stor
e
,
guid
,
data
);
return
d3d
11_texture3d_SetPrivateDataInterface
(
&
texture
->
ID3D11Texture3D_ifac
e
,
guid
,
data
);
}
static
void
STDMETHODCALLTYPE
d3d10_texture3d_GetType
(
ID3D10Texture3D
*
iface
,
...
...
@@ -1413,7 +1442,6 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi
texture
->
ID3D10Texture3D_iface
.
lpVtbl
=
&
d3d10_texture3d_vtbl
;
texture
->
refcount
=
1
;
wined3d_mutex_lock
();
wined3d_private_store_init
(
&
texture
->
private_store
);
texture
->
desc
=
*
desc
;
wined3d_desc
.
resource_type
=
WINED3D_RTYPE_TEXTURE_3D
;
...
...
@@ -1439,12 +1467,22 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi
&
d3d_texture3d_wined3d_parent_ops
,
&
texture
->
wined3d_texture
)))
{
WARN
(
"Failed to create wined3d texture, hr %#lx.
\n
"
,
hr
);
wined3d_private_store_cleanup
(
&
texture
->
private_store
);
wined3d_mutex_unlock
();
if
(
hr
==
WINED3DERR_INVALIDCALL
)
hr
=
E_INVALIDARG
;
return
hr
;
}
hr
=
d3d_device_create_dxgi_resource
((
IUnknown
*
)
&
device
->
ID3D10Device1_iface
,
wined3d_texture_get_resource
(
texture
->
wined3d_texture
),
(
IUnknown
*
)
&
texture
->
ID3D10Texture3D_iface
,
FALSE
,
&
texture
->
dxgi_resource
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to create DXGI resource, returning %#.lx
\n
"
,
hr
);
wined3d_texture_decref
(
texture
->
wined3d_texture
);
wined3d_mutex_unlock
();
return
hr
;
}
wined3d_mutex_unlock
();
texture
->
desc
.
MipLevels
=
levels
;
...
...
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