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
99bb367d
Commit
99bb367d
authored
Sep 09, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Sep 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement d3d11_rendertarget_view_GetResource().
parent
b5b5b381
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
20 deletions
+35
-20
d3d11_private.h
dlls/d3d11/d3d11_private.h
+2
-2
device.c
dlls/d3d11/device.c
+12
-1
view.c
dlls/d3d11/view.c
+21
-17
No files found.
dlls/d3d11/d3d11_private.h
View file @
99bb367d
...
...
@@ -180,12 +180,12 @@ struct d3d_rendertarget_view
struct
wined3d_private_store
private_store
;
struct
wined3d_rendertarget_view
*
wined3d_view
;
D3D10_RENDER_TARGET_VIEW_DESC
desc
;
ID3D1
0
Resource
*
resource
;
ID3D1
1
Resource
*
resource
;
ID3D10Device1
*
device
;
};
HRESULT
d3d_rendertarget_view_init
(
struct
d3d_rendertarget_view
*
view
,
struct
d3d_device
*
device
,
ID3D1
0
Resource
*
resource
,
const
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
)
DECLSPEC_HIDDEN
;
ID3D1
1
Resource
*
resource
,
const
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
)
DECLSPEC_HIDDEN
;
struct
d3d_rendertarget_view
*
unsafe_impl_from_ID3D10RenderTargetView
(
ID3D10RenderTargetView
*
iface
)
DECLSPEC_HIDDEN
;
/* ID3D10ShaderResourceView */
...
...
dlls/d3d11/device.c
View file @
99bb367d
...
...
@@ -2123,6 +2123,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Devic
{
struct
d3d_device
*
device
=
impl_from_ID3D10Device
(
iface
);
struct
d3d_rendertarget_view
*
object
;
ID3D11Resource
*
d3d11_resource
;
HRESULT
hr
;
TRACE
(
"iface %p, resource %p, desc %p, view %p.
\n
"
,
iface
,
resource
,
desc
,
view
);
...
...
@@ -2130,13 +2131,23 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Devic
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d3d_rendertarget_view_init
(
object
,
device
,
resource
,
desc
)))
if
(
FAILED
(
hr
=
ID3D10Resource_QueryInterface
(
resource
,
&
IID_ID3D11Resource
,
(
void
**
)
&
d3d11_resource
)))
{
ERR
(
"Resource does not implement ID3D11Resource.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
d3d_rendertarget_view_init
(
object
,
device
,
d3d11_resource
,
desc
)))
{
WARN
(
"Failed to initialize rendertarget view, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
ID3D11Resource_Release
(
d3d11_resource
);
return
hr
;
}
ID3D11Resource_Release
(
d3d11_resource
);
TRACE
(
"Created rendertarget view %p.
\n
"
,
object
);
*
view
=
&
object
->
ID3D10RenderTargetView_iface
;
...
...
dlls/d3d11/view.c
View file @
99bb367d
...
...
@@ -121,21 +121,21 @@ static HRESULT set_dsdesc_from_resource(D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3
}
}
static
HRESULT
set_rtdesc_from_resource
(
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
,
ID3D1
0
Resource
*
resource
)
static
HRESULT
set_rtdesc_from_resource
(
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
,
ID3D1
1
Resource
*
resource
)
{
D3D1
0
_RESOURCE_DIMENSION
dimension
;
D3D1
1
_RESOURCE_DIMENSION
dimension
;
HRESULT
hr
;
ID3D1
0
Resource_GetType
(
resource
,
&
dimension
);
ID3D1
1
Resource_GetType
(
resource
,
&
dimension
);
switch
(
dimension
)
{
case
D3D1
0
_RESOURCE_DIMENSION_TEXTURE1D
:
case
D3D1
1
_RESOURCE_DIMENSION_TEXTURE1D
:
{
ID3D10Texture1D
*
texture
;
D3D10_TEXTURE1D_DESC
texture_desc
;
hr
=
ID3D1
0
Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture1D
,
(
void
**
)
&
texture
);
hr
=
ID3D1
1
Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture1D
,
(
void
**
)
&
texture
);
if
(
FAILED
(
hr
))
{
ERR
(
"Resource of type TEXTURE1D doesn't implement ID3D10Texture1D?
\n
"
);
...
...
@@ -162,12 +162,12 @@ static HRESULT set_rtdesc_from_resource(D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3
return
S_OK
;
}
case
D3D1
0
_RESOURCE_DIMENSION_TEXTURE2D
:
case
D3D1
1
_RESOURCE_DIMENSION_TEXTURE2D
:
{
ID3D10Texture2D
*
texture
;
D3D10_TEXTURE2D_DESC
texture_desc
;
hr
=
ID3D1
0
Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture2D
,
(
void
**
)
&
texture
);
hr
=
ID3D1
1
Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture2D
,
(
void
**
)
&
texture
);
if
(
FAILED
(
hr
))
{
ERR
(
"Resource of type TEXTURE2D doesn't implement ID3D10Texture2D?
\n
"
);
...
...
@@ -210,12 +210,12 @@ static HRESULT set_rtdesc_from_resource(D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3
return
S_OK
;
}
case
D3D1
0
_RESOURCE_DIMENSION_TEXTURE3D
:
case
D3D1
1
_RESOURCE_DIMENSION_TEXTURE3D
:
{
ID3D10Texture3D
*
texture
;
D3D10_TEXTURE3D_DESC
texture_desc
;
hr
=
ID3D1
0
Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture3D
,
(
void
**
)
&
texture
);
hr
=
ID3D1
1
Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture3D
,
(
void
**
)
&
texture
);
if
(
FAILED
(
hr
))
{
ERR
(
"Resource of type TEXTURE3D doesn't implement ID3D10Texture3D?
\n
"
);
...
...
@@ -826,7 +826,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTarge
{
wined3d_mutex_lock
();
wined3d_rendertarget_view_decref
(
view
->
wined3d_view
);
ID3D1
0
Resource_Release
(
view
->
resource
);
ID3D1
1
Resource_Release
(
view
->
resource
);
ID3D10Device1_Release
(
view
->
device
);
wined3d_private_store_cleanup
(
&
view
->
private_store
);
wined3d_mutex_unlock
();
...
...
@@ -875,7 +875,12 @@ static HRESULT STDMETHODCALLTYPE d3d11_rendertarget_view_SetPrivateDataInterface
static
void
STDMETHODCALLTYPE
d3d11_rendertarget_view_GetResource
(
ID3D11RenderTargetView
*
iface
,
ID3D11Resource
**
resource
)
{
FIXME
(
"iface %p, resource %p stub!
\n
"
,
iface
,
resource
);
struct
d3d_rendertarget_view
*
view
=
impl_from_ID3D11RenderTargetView
(
iface
);
TRACE
(
"iface %p, resource %p.
\n
"
,
iface
,
resource
);
*
resource
=
view
->
resource
;
ID3D11Resource_AddRef
(
*
resource
);
}
static
void
STDMETHODCALLTYPE
d3d11_rendertarget_view_GetDesc
(
ID3D11RenderTargetView
*
iface
,
...
...
@@ -991,8 +996,7 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetResource(ID3D10RenderTa
TRACE
(
"iface %p, resource %p
\n
"
,
iface
,
resource
);
*
resource
=
view
->
resource
;
ID3D10Resource_AddRef
(
*
resource
);
ID3D11Resource_QueryInterface
(
view
->
resource
,
&
IID_ID3D10Resource
,
(
void
**
)
resource
);
}
/* ID3D10RenderTargetView methods */
...
...
@@ -1088,7 +1092,7 @@ static void wined3d_rendertarget_view_desc_from_d3d10core(struct wined3d_rendert
}
HRESULT
d3d_rendertarget_view_init
(
struct
d3d_rendertarget_view
*
view
,
struct
d3d_device
*
device
,
ID3D1
0
Resource
*
resource
,
const
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
)
ID3D1
1
Resource
*
resource
,
const
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
)
{
struct
wined3d_rendertarget_view_desc
wined3d_desc
;
struct
wined3d_resource
*
wined3d_resource
;
...
...
@@ -1109,10 +1113,10 @@ HRESULT d3d_rendertarget_view_init(struct d3d_rendertarget_view *view, struct d3
}
wined3d_mutex_lock
();
if
(
!
(
wined3d_resource
=
wined3d_resource_from_d3d1
0
_resource
(
resource
)))
if
(
!
(
wined3d_resource
=
wined3d_resource_from_d3d1
1
_resource
(
resource
)))
{
wined3d_mutex_unlock
();
ERR
(
"Failed to get wined3d resource for d3d1
0
resource %p.
\n
"
,
resource
);
ERR
(
"Failed to get wined3d resource for d3d1
1
resource %p.
\n
"
,
resource
);
return
E_FAIL
;
}
...
...
@@ -1128,7 +1132,7 @@ HRESULT d3d_rendertarget_view_init(struct d3d_rendertarget_view *view, struct d3
wined3d_private_store_init
(
&
view
->
private_store
);
wined3d_mutex_unlock
();
view
->
resource
=
resource
;
ID3D1
0
Resource_AddRef
(
resource
);
ID3D1
1
Resource_AddRef
(
resource
);
view
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
view
->
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