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
5beba20e
Commit
5beba20e
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 objects for buffers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
204126ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
15 deletions
+53
-15
buffer.c
dlls/d3d11/buffer.c
+49
-12
d3d11_private.h
dlls/d3d11/d3d11_private.h
+3
-1
d3d11.c
dlls/d3d11/tests/d3d11.c
+0
-1
texture.c
dlls/d3d11/texture.c
+1
-1
No files found.
dlls/d3d11/buffer.c
View file @
5beba20e
...
...
@@ -31,6 +31,7 @@ static inline struct d3d_buffer *impl_from_ID3D11Buffer(ID3D11Buffer *iface)
static
HRESULT
STDMETHODCALLTYPE
d3d11_buffer_QueryInterface
(
ID3D11Buffer
*
iface
,
REFIID
riid
,
void
**
out
)
{
struct
d3d_buffer
*
buffer
=
impl_from_ID3D11Buffer
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, riid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
...
...
@@ -53,10 +54,13 @@ static HRESULT STDMETHODCALLTYPE d3d11_buffer_QueryInterface(ID3D11Buffer *iface
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
if
(
FAILED
(
hr
=
IUnknown_QueryInterface
(
buffer
->
dxgi_resource
,
riid
,
out
)))
{
WARN
(
"%s not implemented, returning %#lx.
\n
"
,
debugstr_guid
(
riid
),
hr
);
*
out
=
NULL
;
}
*
out
=
NULL
;
return
E_NOINTERFACE
;
return
hr
;
}
static
ULONG
STDMETHODCALLTYPE
d3d11_buffer_AddRef
(
ID3D11Buffer
*
iface
)
...
...
@@ -109,30 +113,54 @@ static HRESULT STDMETHODCALLTYPE d3d11_buffer_GetPrivateData(ID3D11Buffer *iface
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
{
struct
d3d_buffer
*
buffer
=
impl_from_ID3D11Buffer
(
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
(
&
buffer
->
private_store
,
guid
,
data_size
,
data
);
if
(
SUCCEEDED
(
hr
=
IUnknown_QueryInterface
(
buffer
->
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_buffer_SetPrivateData
(
ID3D11Buffer
*
iface
,
REFGUID
guid
,
UINT
data_size
,
const
void
*
data
)
{
struct
d3d_buffer
*
buffer
=
impl_from_ID3D11Buffer
(
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
(
&
buffer
->
private_store
,
guid
,
data_size
,
data
);
if
(
SUCCEEDED
(
hr
=
IUnknown_QueryInterface
(
buffer
->
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_buffer_SetPrivateDataInterface
(
ID3D11Buffer
*
iface
,
REFGUID
guid
,
const
IUnknown
*
data
)
{
struct
d3d_buffer
*
buffer
=
impl_from_ID3D11Buffer
(
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
(
&
buffer
->
private_store
,
guid
,
data
);
if
(
SUCCEEDED
(
hr
=
IUnknown_QueryInterface
(
buffer
->
dxgi_resource
,
&
IID_IDXGIResource
,
(
void
**
)
&
dxgi_resource
)))
{
hr
=
IDXGIResource_SetPrivateDataInterface
(
dxgi_resource
,
guid
,
data
);
IDXGIResource_Release
(
dxgi_resource
);
}
return
hr
;
}
static
void
STDMETHODCALLTYPE
d3d11_buffer_GetType
(
ID3D11Buffer
*
iface
,
...
...
@@ -246,7 +274,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface
TRACE
(
"iface %p, guid %s, data_size %p, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d
_get_private_data
(
&
buffer
->
private_stor
e
,
guid
,
data_size
,
data
);
return
d3d
11_buffer_GetPrivateData
(
&
buffer
->
ID3D11Buffer_ifac
e
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_buffer_SetPrivateData
(
ID3D10Buffer
*
iface
,
...
...
@@ -257,7 +285,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateData(ID3D10Buffer *iface
TRACE
(
"iface %p, guid %s, data_size %u, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
d3d
_set_private_data
(
&
buffer
->
private_stor
e
,
guid
,
data_size
,
data
);
return
d3d
11_buffer_SetPrivateData
(
&
buffer
->
ID3D11Buffer_ifac
e
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_buffer_SetPrivateDataInterface
(
ID3D10Buffer
*
iface
,
...
...
@@ -267,7 +295,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateDataInterface(ID3D10Buff
TRACE
(
"iface %p, guid %s, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data
);
return
d3d
_set_private_data_interface
(
&
buffer
->
private_stor
e
,
guid
,
data
);
return
d3d
11_buffer_SetPrivateDataInterface
(
&
buffer
->
ID3D11Buffer_ifac
e
,
guid
,
data
);
}
/* ID3D10Resource methods */
...
...
@@ -367,7 +395,7 @@ static void STDMETHODCALLTYPE d3d_buffer_wined3d_object_released(void *parent)
{
struct
d3d_buffer
*
buffer
=
parent
;
wined3d_private_store_cleanup
(
&
buffer
->
private_stor
e
);
if
(
buffer
->
dxgi_resource
)
IUnknown_Release
(
buffer
->
dxgi_resourc
e
);
heap_free
(
parent
);
}
...
...
@@ -446,14 +474,23 @@ static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *dev
wined3d_desc
.
structure_byte_stride
=
buffer
->
desc
.
StructureByteStride
;
wined3d_mutex_lock
();
wined3d_private_store_init
(
&
buffer
->
private_store
);
if
(
FAILED
(
hr
=
wined3d_buffer_create
(
device
->
wined3d_device
,
&
wined3d_desc
,
(
const
struct
wined3d_sub_resource_data
*
)
data
,
buffer
,
&
d3d_buffer_wined3d_parent_ops
,
&
buffer
->
wined3d_buffer
)))
{
WARN
(
"Failed to create wined3d buffer, hr %#lx.
\n
"
,
hr
);
wined3d_private_store_cleanup
(
&
buffer
->
private_store
);
wined3d_mutex_unlock
();
return
hr
;
}
hr
=
d3d_device_create_dxgi_resource
((
IUnknown
*
)
&
device
->
ID3D10Device1_iface
,
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
),
(
IUnknown
*
)
&
buffer
->
ID3D10Buffer_iface
,
FALSE
,
&
buffer
->
dxgi_resource
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to create DXGI resource, returning %#.lx
\n
"
,
hr
);
wined3d_buffer_decref
(
buffer
->
wined3d_buffer
);
wined3d_mutex_unlock
();
return
hr
;
}
...
...
dlls/d3d11/d3d11_private.h
View file @
5beba20e
...
...
@@ -72,6 +72,8 @@ DWORD wined3d_map_flags_from_d3d11_map_type(D3D11_MAP map_type) DECLSPEC_HIDDEN;
DWORD
wined3d_map_flags_from_d3d10_map_type
(
D3D10_MAP
map_type
)
DECLSPEC_HIDDEN
;
DWORD
wined3d_clear_flags_from_d3d11_clear_flags
(
UINT
clear_flags
)
DECLSPEC_HIDDEN
;
unsigned
int
wined3d_access_from_d3d11
(
D3D11_USAGE
usage
,
UINT
cpu_access
)
DECLSPEC_HIDDEN
;
HRESULT
d3d_device_create_dxgi_resource
(
IUnknown
*
device
,
struct
wined3d_resource
*
wined3d_resource
,
IUnknown
*
outer
,
BOOL
needs_surface
,
IUnknown
**
dxgi_resource
)
DECLSPEC_HIDDEN
;
enum
D3D11_USAGE
d3d11_usage_from_d3d10_usage
(
enum
D3D10_USAGE
usage
)
DECLSPEC_HIDDEN
;
enum
D3D10_USAGE
d3d10_usage_from_d3d11_usage
(
enum
D3D11_USAGE
usage
)
DECLSPEC_HIDDEN
;
...
...
@@ -188,7 +190,7 @@ struct d3d_buffer
ID3D10Buffer
ID3D10Buffer_iface
;
LONG
refcount
;
struct
wined3d_private_store
private_stor
e
;
IUnknown
*
dxgi_resourc
e
;
struct
wined3d_buffer
*
wined3d_buffer
;
D3D11_BUFFER_DESC
desc
;
ID3D11Device2
*
device
;
...
...
dlls/d3d11/tests/d3d11.c
View file @
5beba20e
...
...
@@ -3603,7 +3603,6 @@ static void test_create_buffer(void)
continue
;
}
todo_wine
check_interface
(
buffer
,
&
IID_IDXGIResource
,
TRUE
,
FALSE
);
if
(
!
(
desc
.
MiscFlags
&
D3D11_RESOURCE_MISC_BUFFER_STRUCTURED
))
dlls/d3d11/texture.c
View file @
5beba20e
...
...
@@ -413,7 +413,7 @@ static const struct wined3d_parent_ops d3d_texture1d_wined3d_parent_ops =
d3d_texture1d_wined3d_object_released
,
};
static
HRESULT
d3d_device_create_dxgi_resource
(
IUnknown
*
device
,
struct
wined3d_resource
*
wined3d_resource
,
HRESULT
d3d_device_create_dxgi_resource
(
IUnknown
*
device
,
struct
wined3d_resource
*
wined3d_resource
,
IUnknown
*
outer
,
BOOL
needs_surface
,
IUnknown
**
dxgi_resource
)
{
IWineDXGIDevice
*
wine_device
;
...
...
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