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
91e4ec57
Commit
91e4ec57
authored
Feb 24, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Add a wined3d rendertarget view to the d3d10 rendertarget view.
parent
c796f764
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
6 deletions
+61
-6
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+1
-1
device.c
dlls/d3d10core/device.c
+31
-2
view.c
dlls/d3d10core/view.c
+29
-3
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
91e4ec57
...
...
@@ -85,7 +85,7 @@ struct d3d10_rendertarget_view
const
struct
ID3D10RenderTargetViewVtbl
*
vtbl
;
LONG
refcount
;
I
D3D10Resource
*
resource
;
I
WineD3DRendertargetView
*
wined3d_view
;
D3D10_RENDER_TARGET_VIEW_DESC
desc
;
};
...
...
dlls/d3d10core/device.c
View file @
91e4ec57
...
...
@@ -689,6 +689,26 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Dev
return
E_NOTIMPL
;
}
static
IWineD3DResource
*
d3d10_device_wined3d_resource_from_resource
(
ID3D10Resource
*
resource
)
{
D3D10_RESOURCE_DIMENSION
dimension
;
ID3D10Resource_GetType
(
resource
,
&
dimension
);
switch
(
dimension
)
{
case
D3D10_RESOURCE_DIMENSION_BUFFER
:
return
(
IWineD3DResource
*
)((
struct
d3d10_buffer
*
)
resource
)
->
wined3d_buffer
;
case
D3D10_RESOURCE_DIMENSION_TEXTURE2D
:
return
(
IWineD3DResource
*
)((
struct
d3d10_texture2d
*
)
resource
)
->
wined3d_surface
;
default:
FIXME
(
"Unhandled resource dimension %#x
\n
"
,
dimension
);
return
NULL
;
}
}
static
HRESULT
d3d10_device_set_rtdesc_from_resource
(
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
,
ID3D10Resource
*
resource
)
{
D3D10_RESOURCE_DIMENSION
dimension
;
...
...
@@ -811,7 +831,9 @@ static HRESULT d3d10_device_set_rtdesc_from_resource(D3D10_RENDER_TARGET_VIEW_DE
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreateRenderTargetView
(
ID3D10Device
*
iface
,
ID3D10Resource
*
resource
,
const
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
,
ID3D10RenderTargetView
**
view
)
{
struct
d3d10_device
*
This
=
(
struct
d3d10_device
*
)
iface
;
struct
d3d10_rendertarget_view
*
object
;
IWineD3DResource
*
wined3d_resource
;
TRACE
(
"iface %p, resource %p, desc %p, view %p stub!
\n
"
,
iface
,
resource
,
desc
,
view
);
...
...
@@ -839,8 +861,15 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Devic
object
->
desc
=
*
desc
;
}
object
->
resource
=
resource
;
ID3D10Resource_AddRef
(
resource
);
wined3d_resource
=
d3d10_device_wined3d_resource_from_resource
(
resource
);
if
(
!
wined3d_resource
)
{
FIXME
(
"Failed to get wined3d resource for d3d10 resource %p
\n
"
,
resource
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
E_FAIL
;
}
IWineD3DDevice_CreateRendertargetView
(
This
->
wined3d_device
,
wined3d_resource
,
(
IUnknown
*
)
object
,
&
object
->
wined3d_view
);
*
view
=
(
ID3D10RenderTargetView
*
)
object
;
...
...
dlls/d3d10core/view.c
View file @
91e4ec57
...
...
@@ -66,7 +66,7 @@ static ULONG STDMETHODCALLTYPE d3d10_rendertarget_view_Release(ID3D10RenderTarge
if
(
!
refcount
)
{
I
D3D10Resource_Release
(
This
->
resource
);
I
WineD3DRendertargetView_Release
(
This
->
wined3d_view
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -112,11 +112,37 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetResource(ID3D10RenderTa
ID3D10Resource
**
resource
)
{
struct
d3d10_rendertarget_view
*
This
=
(
struct
d3d10_rendertarget_view
*
)
iface
;
IWineD3DResource
*
wined3d_resource
;
IUnknown
*
parent
;
HRESULT
hr
;
TRACE
(
"iface %p, resource %p
\n
"
,
iface
,
resource
);
ID3D10Resource_AddRef
(
This
->
resource
);
*
resource
=
This
->
resource
;
hr
=
IWineD3DRendertargetView_GetResource
(
This
->
wined3d_view
,
&
wined3d_resource
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to get wined3d resource, hr %#x
\n
"
,
hr
);
*
resource
=
NULL
;
return
;
}
hr
=
IWineD3DResource_GetParent
(
wined3d_resource
,
&
parent
);
IWineD3DResource_Release
(
wined3d_resource
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to get wined3d resource parent, hr %#x
\n
"
,
hr
);
*
resource
=
NULL
;
return
;
}
hr
=
IUnknown_QueryInterface
(
parent
,
&
IID_ID3D10Resource
,
(
void
**
)
&
resource
);
IUnknown_Release
(
parent
);
if
(
FAILED
(
hr
))
{
ERR
(
"Resource parent isn't a d3d10 resource, hr %#x
\n
"
,
hr
);
*
resource
=
NULL
;
return
;
}
}
/* ID3D10RenderTargetView methods */
...
...
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