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
2953d814
Commit
2953d814
authored
Jan 26, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Handle a NULL view desc in CreateRenderTargetView().
parent
9c1abc90
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
140 additions
and
1 deletion
+140
-1
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+1
-0
device.c
dlls/d3d10core/device.c
+134
-0
view.c
dlls/d3d10core/view.c
+5
-1
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
2953d814
...
...
@@ -79,6 +79,7 @@ struct d3d10_rendertarget_view
LONG
refcount
;
ID3D10Resource
*
resource
;
D3D10_RENDER_TARGET_VIEW_DESC
desc
;
};
/* Layered device */
...
...
dlls/d3d10core/device.c
View file @
2953d814
...
...
@@ -670,6 +670,125 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Dev
return
E_NOTIMPL
;
}
static
HRESULT
d3d10_device_set_rtdesc_from_resource
(
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
,
ID3D10Resource
*
resource
)
{
D3D10_RESOURCE_DIMENSION
dimension
;
HRESULT
hr
;
ID3D10Resource_GetType
(
resource
,
&
dimension
);
switch
(
dimension
)
{
case
D3D10_RESOURCE_DIMENSION_TEXTURE1D
:
{
ID3D10Texture1D
*
texture
;
D3D10_TEXTURE1D_DESC
texture_desc
;
hr
=
ID3D10Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture1D
,
(
void
**
)
&
texture
);
if
(
FAILED
(
hr
))
{
ERR
(
"Resource of type TEXTURE1D doesn't implement ID3D10Texture1D?
\n
"
);
return
E_INVALIDARG
;
}
ID3D10Texture1D_GetDesc
(
texture
,
&
texture_desc
);
ID3D10Texture1D_Release
(
texture
);
desc
->
Format
=
texture_desc
.
Format
;
if
(
texture_desc
.
ArraySize
==
1
)
{
desc
->
ViewDimension
=
D3D10_RTV_DIMENSION_TEXTURE1D
;
desc
->
Texture1D
.
MipSlice
=
0
;
}
else
{
desc
->
ViewDimension
=
D3D10_RTV_DIMENSION_TEXTURE1DARRAY
;
desc
->
Texture1DArray
.
MipSlice
=
0
;
desc
->
Texture1DArray
.
FirstArraySlice
=
0
;
desc
->
Texture1DArray
.
ArraySize
=
1
;
}
return
S_OK
;
}
case
D3D10_RESOURCE_DIMENSION_TEXTURE2D
:
{
ID3D10Texture2D
*
texture
;
D3D10_TEXTURE2D_DESC
texture_desc
;
hr
=
ID3D10Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture2D
,
(
void
**
)
&
texture
);
if
(
FAILED
(
hr
))
{
ERR
(
"Resource of type TEXTURE2D doesn't implement ID3D10Texture2D?
\n
"
);
return
E_INVALIDARG
;
}
ID3D10Texture2D_GetDesc
(
texture
,
&
texture_desc
);
ID3D10Texture2D_Release
(
texture
);
desc
->
Format
=
texture_desc
.
Format
;
if
(
texture_desc
.
ArraySize
==
1
)
{
if
(
texture_desc
.
SampleDesc
.
Count
==
1
)
{
desc
->
ViewDimension
=
D3D10_RTV_DIMENSION_TEXTURE2D
;
desc
->
Texture2D
.
MipSlice
=
0
;
}
else
{
desc
->
ViewDimension
=
D3D10_RTV_DIMENSION_TEXTURE2DMS
;
}
}
else
{
if
(
texture_desc
.
SampleDesc
.
Count
==
1
)
{
desc
->
ViewDimension
=
D3D10_RTV_DIMENSION_TEXTURE2DARRAY
;
desc
->
Texture2DArray
.
MipSlice
=
0
;
desc
->
Texture2DArray
.
FirstArraySlice
=
0
;
desc
->
Texture2DArray
.
ArraySize
=
1
;
}
else
{
desc
->
ViewDimension
=
D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY
;
desc
->
Texture2DMSArray
.
FirstArraySlice
=
0
;
desc
->
Texture2DMSArray
.
ArraySize
=
1
;
}
}
return
S_OK
;
}
case
D3D10_RESOURCE_DIMENSION_TEXTURE3D
:
{
ID3D10Texture3D
*
texture
;
D3D10_TEXTURE3D_DESC
texture_desc
;
hr
=
ID3D10Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture3D
,
(
void
**
)
&
texture
);
if
(
FAILED
(
hr
))
{
ERR
(
"Resource of type TEXTURE3D doesn't implement ID3D10Texture3D?
\n
"
);
return
E_INVALIDARG
;
}
ID3D10Texture3D_GetDesc
(
texture
,
&
texture_desc
);
ID3D10Texture3D_Release
(
texture
);
desc
->
Format
=
texture_desc
.
Format
;
desc
->
ViewDimension
=
D3D10_RTV_DIMENSION_TEXTURE3D
;
desc
->
Texture3D
.
MipSlice
=
0
;
desc
->
Texture3D
.
FirstWSlice
=
0
;
desc
->
Texture3D
.
WSize
=
1
;
return
S_OK
;
}
default:
FIXME
(
"Unhandled resource dimension %#x
\n
"
,
dimension
);
return
E_INVALIDARG
;
}
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreateRenderTargetView
(
ID3D10Device
*
iface
,
ID3D10Resource
*
resource
,
const
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
,
ID3D10RenderTargetView
**
view
)
{
...
...
@@ -686,6 +805,21 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Devic
object
->
vtbl
=
&
d3d10_rendertarget_view_vtbl
;
object
->
refcount
=
1
;
if
(
!
desc
)
{
HRESULT
hr
=
d3d10_device_set_rtdesc_from_resource
(
&
object
->
desc
,
resource
);
if
(
FAILED
(
hr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
}
else
{
object
->
desc
=
*
desc
;
}
object
->
resource
=
resource
;
ID3D10Resource_AddRef
(
resource
);
...
...
dlls/d3d10core/view.c
View file @
2953d814
...
...
@@ -124,7 +124,11 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetResource(ID3D10RenderTa
static
void
STDMETHODCALLTYPE
d3d10_rendertarget_view_GetDesc
(
ID3D10RenderTargetView
*
iface
,
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
)
{
FIXME
(
"iface %p, desc %p stub!
\n
"
,
iface
,
desc
);
struct
d3d10_rendertarget_view
*
This
=
(
struct
d3d10_rendertarget_view
*
)
iface
;
TRACE
(
"iface %p, desc %p
\n
"
,
iface
,
desc
);
*
desc
=
This
->
desc
;
}
const
struct
ID3D10RenderTargetViewVtbl
d3d10_rendertarget_view_vtbl
=
...
...
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