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
05d1fbb3
Commit
05d1fbb3
authored
Sep 13, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Implement d3d10_depthstencil_view_GetDesc().
parent
3fa6bd0c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
4 deletions
+116
-4
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+2
-1
device.c
dlls/d3d10core/device.c
+1
-1
view.c
dlls/d3d10core/view.c
+113
-2
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
05d1fbb3
...
...
@@ -129,11 +129,12 @@ struct d3d10_depthstencil_view
ID3D10DepthStencilView
ID3D10DepthStencilView_iface
;
LONG
refcount
;
D3D10_DEPTH_STENCIL_VIEW_DESC
desc
;
ID3D10Resource
*
resource
;
};
HRESULT
d3d10_depthstencil_view_init
(
struct
d3d10_depthstencil_view
*
view
,
ID3D10Resource
*
resource
)
DECLSPEC_HIDDEN
;
ID3D10Resource
*
resource
,
const
D3D10_DEPTH_STENCIL_VIEW_DESC
*
desc
)
DECLSPEC_HIDDEN
;
/* ID3D10RenderTargetView */
struct
d3d10_rendertarget_view
...
...
dlls/d3d10core/device.c
View file @
05d1fbb3
...
...
@@ -803,7 +803,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Devic
return
E_OUTOFMEMORY
;
}
if
(
FAILED
(
hr
=
d3d10_depthstencil_view_init
(
object
,
resource
)))
if
(
FAILED
(
hr
=
d3d10_depthstencil_view_init
(
object
,
resource
,
desc
)))
{
WARN
(
"Failed to initialize depthstencil view, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
...
...
dlls/d3d10core/view.c
View file @
05d1fbb3
...
...
@@ -45,6 +45,101 @@ static struct wined3d_resource *wined3d_resource_from_resource(ID3D10Resource *r
}
}
static
HRESULT
set_dsdesc_from_resource
(
D3D10_DEPTH_STENCIL_VIEW_DESC
*
desc
,
ID3D10Resource
*
resource
)
{
D3D10_RESOURCE_DIMENSION
dimension
;
HRESULT
hr
;
ID3D10Resource_GetType
(
resource
,
&
dimension
);
switch
(
dimension
)
{
case
D3D10_RESOURCE_DIMENSION_TEXTURE1D
:
{
D3D10_TEXTURE1D_DESC
texture_desc
;
ID3D10Texture1D
*
texture
;
if
(
FAILED
(
hr
=
ID3D10Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture1D
,
(
void
**
)
&
texture
)))
{
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_DSV_DIMENSION_TEXTURE1D
;
desc
->
u
.
Texture1D
.
MipSlice
=
0
;
}
else
{
desc
->
ViewDimension
=
D3D10_DSV_DIMENSION_TEXTURE1DARRAY
;
desc
->
u
.
Texture1DArray
.
MipSlice
=
0
;
desc
->
u
.
Texture1DArray
.
FirstArraySlice
=
0
;
desc
->
u
.
Texture1DArray
.
ArraySize
=
1
;
}
return
S_OK
;
}
case
D3D10_RESOURCE_DIMENSION_TEXTURE2D
:
{
D3D10_TEXTURE2D_DESC
texture_desc
;
ID3D10Texture2D
*
texture
;
if
(
FAILED
(
hr
=
ID3D10Resource_QueryInterface
(
resource
,
&
IID_ID3D10Texture2D
,
(
void
**
)
&
texture
)))
{
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_DSV_DIMENSION_TEXTURE2D
;
desc
->
u
.
Texture2D
.
MipSlice
=
0
;
}
else
{
desc
->
ViewDimension
=
D3D10_DSV_DIMENSION_TEXTURE2DMS
;
}
}
else
{
if
(
texture_desc
.
SampleDesc
.
Count
==
1
)
{
desc
->
ViewDimension
=
D3D10_DSV_DIMENSION_TEXTURE2DARRAY
;
desc
->
u
.
Texture2DArray
.
MipSlice
=
0
;
desc
->
u
.
Texture2DArray
.
FirstArraySlice
=
0
;
desc
->
u
.
Texture2DArray
.
ArraySize
=
1
;
}
else
{
desc
->
ViewDimension
=
D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY
;
desc
->
u
.
Texture2DMSArray
.
FirstArraySlice
=
0
;
desc
->
u
.
Texture2DMSArray
.
ArraySize
=
1
;
}
}
return
S_OK
;
}
default:
FIXME
(
"Unhandled resource dimension %#x.
\n
"
,
dimension
);
case
D3D10_RESOURCE_DIMENSION_BUFFER
:
case
D3D10_RESOURCE_DIMENSION_TEXTURE3D
:
return
E_INVALIDARG
;
}
}
static
HRESULT
set_rtdesc_from_resource
(
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
,
ID3D10Resource
*
resource
)
{
D3D10_RESOURCE_DIMENSION
dimension
;
...
...
@@ -269,7 +364,11 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetResource(ID3D10DepthSte
static
void
STDMETHODCALLTYPE
d3d10_depthstencil_view_GetDesc
(
ID3D10DepthStencilView
*
iface
,
D3D10_DEPTH_STENCIL_VIEW_DESC
*
desc
)
{
FIXME
(
"iface %p, desc %p stub!
\n
"
,
iface
,
desc
);
struct
d3d10_depthstencil_view
*
view
=
impl_from_ID3D10DepthStencilView
(
iface
);
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
*
desc
=
view
->
desc
;
}
static
const
struct
ID3D10DepthStencilViewVtbl
d3d10_depthstencil_view_vtbl
=
...
...
@@ -290,11 +389,23 @@ static const struct ID3D10DepthStencilViewVtbl d3d10_depthstencil_view_vtbl =
};
HRESULT
d3d10_depthstencil_view_init
(
struct
d3d10_depthstencil_view
*
view
,
ID3D10Resource
*
resource
)
ID3D10Resource
*
resource
,
const
D3D10_DEPTH_STENCIL_VIEW_DESC
*
desc
)
{
HRESULT
hr
;
view
->
ID3D10DepthStencilView_iface
.
lpVtbl
=
&
d3d10_depthstencil_view_vtbl
;
view
->
refcount
=
1
;
if
(
!
desc
)
{
if
(
FAILED
(
hr
=
set_dsdesc_from_resource
(
&
view
->
desc
,
resource
)))
return
hr
;
}
else
{
view
->
desc
=
*
desc
;
}
view
->
resource
=
resource
;
ID3D10Resource_AddRef
(
resource
);
...
...
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