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
4a843f28
Commit
4a843f28
authored
Aug 06, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Implement dxgi_surface_GetDesc() on top of wined3d.
parent
d29f263c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
45 deletions
+42
-45
texture.c
dlls/d3d10core/texture.c
+24
-31
device.c
dlls/dxgi/device.c
+7
-7
dxgi_private.h
dlls/dxgi/dxgi_private.h
+2
-3
surface.c
dlls/dxgi/surface.c
+8
-3
winedxgi.idl
include/wine/winedxgi.idl
+1
-1
No files found.
dlls/d3d10core/texture.c
View file @
4a843f28
...
...
@@ -296,35 +296,6 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
wined3d_private_store_init
(
&
texture
->
private_store
);
texture
->
desc
=
*
desc
;
if
(
desc
->
MipLevels
==
1
&&
desc
->
ArraySize
==
1
)
{
DXGI_SURFACE_DESC
surface_desc
;
IWineDXGIDevice
*
wine_device
;
if
(
FAILED
(
hr
=
ID3D10Device1_QueryInterface
(
&
device
->
ID3D10Device1_iface
,
&
IID_IWineDXGIDevice
,
(
void
**
)
&
wine_device
)))
{
ERR
(
"Device should implement IWineDXGIDevice.
\n
"
);
wined3d_private_store_cleanup
(
&
texture
->
private_store
);
return
E_FAIL
;
}
surface_desc
.
Width
=
desc
->
Width
;
surface_desc
.
Height
=
desc
->
Height
;
surface_desc
.
Format
=
desc
->
Format
;
surface_desc
.
SampleDesc
=
desc
->
SampleDesc
;
hr
=
IWineDXGIDevice_create_surface
(
wine_device
,
&
surface_desc
,
0
,
NULL
,
(
IUnknown
*
)
&
texture
->
ID3D10Texture2D_iface
,
(
void
**
)
&
texture
->
dxgi_surface
);
IWineDXGIDevice_Release
(
wine_device
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to create DXGI surface, returning %#x
\n
"
,
hr
);
wined3d_private_store_cleanup
(
&
texture
->
private_store
);
return
hr
;
}
}
if
(
desc
->
ArraySize
!=
1
)
FIXME
(
"Array textures not implemented.
\n
"
);
if
(
desc
->
SampleDesc
.
Count
>
1
)
...
...
@@ -348,13 +319,35 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
&
d3d10_texture2d_wined3d_parent_ops
,
&
texture
->
wined3d_texture
)))
{
WARN
(
"Failed to create wined3d texture, hr %#x.
\n
"
,
hr
);
if
(
texture
->
dxgi_surface
)
IUnknown_Release
(
texture
->
dxgi_surface
);
wined3d_private_store_cleanup
(
&
texture
->
private_store
);
return
hr
;
}
texture
->
desc
.
MipLevels
=
levels
;
if
(
desc
->
MipLevels
==
1
&&
desc
->
ArraySize
==
1
)
{
IWineDXGIDevice
*
wine_device
;
if
(
FAILED
(
hr
=
ID3D10Device1_QueryInterface
(
&
device
->
ID3D10Device1_iface
,
&
IID_IWineDXGIDevice
,
(
void
**
)
&
wine_device
)))
{
ERR
(
"Device should implement IWineDXGIDevice.
\n
"
);
wined3d_texture_decref
(
texture
->
wined3d_texture
);
return
E_FAIL
;
}
hr
=
IWineDXGIDevice_create_surface
(
wine_device
,
wined3d_texture_get_resource
(
texture
->
wined3d_texture
),
0
,
NULL
,
(
IUnknown
*
)
&
texture
->
ID3D10Texture2D_iface
,
(
void
**
)
&
texture
->
dxgi_surface
);
IWineDXGIDevice_Release
(
wine_device
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to create DXGI surface, returning %#x
\n
"
,
hr
);
texture
->
dxgi_surface
=
NULL
;
wined3d_texture_decref
(
texture
->
wined3d_texture
);
return
hr
;
}
}
texture
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
texture
->
device
);
...
...
dlls/dxgi/device.c
View file @
4a843f28
...
...
@@ -256,23 +256,23 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_GetGPUThreadPriority(IWineDXGIDevic
/* IWineDXGIDevice methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_create_surface
(
IWineDXGIDevice
*
iface
,
const
DXGI_SURFACE_DESC
*
desc
,
DXGI_USAGE
usage
,
const
DXGI_SHARED_RESOURCE
*
shared_resource
,
IUnknown
*
outer
,
void
**
surface
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_create_surface
(
IWineDXGIDevice
*
iface
,
struct
wined3d_resource
*
wined3d_resource
,
DXGI_USAGE
usage
,
const
DXGI_SHARED_RESOURCE
*
shared_resource
,
IUnknown
*
outer
,
void
**
surface
)
{
struct
dxgi_surface
*
object
;
HRESULT
hr
;
FIXME
(
"iface %p, desc %p, usage %#x, shared_resource %p, outer %p, surface %p partial stub!
\n
"
,
iface
,
desc
,
usage
,
shared_resource
,
outer
,
surface
);
TRACE
(
"iface %p, wined3d_resource %p, usage %#x, shared_resource %p, outer %p, surface %p.
\n
"
,
iface
,
wined3d_resource
,
usage
,
shared_resource
,
outer
,
surface
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate DXGI surface object memory
\n
"
);
return
E_OUTOFMEMORY
;
}
if
(
FAILED
(
hr
=
dxgi_surface_init
(
object
,
(
IDXGIDevice
*
)
iface
,
outer
,
desc
)))
if
(
FAILED
(
hr
=
dxgi_surface_init
(
object
,
(
IDXGIDevice
*
)
iface
,
outer
,
wined3d_resource
)))
{
WARN
(
"Failed to initialize surface, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
...
...
dlls/dxgi/dxgi_private.h
View file @
4a843f28
...
...
@@ -164,11 +164,10 @@ struct dxgi_surface
LONG
refcount
;
struct
wined3d_private_store
private_store
;
IDXGIDevice
*
device
;
DXGI_SURFACE_DESC
desc
;
struct
wined3d_resource
*
wined3d_resource
;
};
HRESULT
dxgi_surface_init
(
struct
dxgi_surface
*
surface
,
IDXGIDevice
*
device
,
IUnknown
*
outer
,
const
DXGI_SURFACE_DESC
*
desc
)
DECLSPEC_HIDDEN
;
IUnknown
*
outer
,
struct
wined3d_resource
*
wined3d_resource
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_DXGI_PRIVATE_H */
dlls/dxgi/surface.c
View file @
4a843f28
...
...
@@ -164,10 +164,15 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDevice(IDXGISurface *iface, REF
static
HRESULT
STDMETHODCALLTYPE
dxgi_surface_GetDesc
(
IDXGISurface
*
iface
,
DXGI_SURFACE_DESC
*
desc
)
{
struct
dxgi_surface
*
surface
=
impl_from_IDXGISurface
(
iface
);
struct
wined3d_resource_desc
wined3d_desc
;
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
*
desc
=
surface
->
desc
;
wined3d_resource_get_desc
(
surface
->
wined3d_resource
,
&
wined3d_desc
);
desc
->
Width
=
wined3d_desc
.
width
;
desc
->
Height
=
wined3d_desc
.
height
;
desc
->
Format
=
dxgi_format_from_wined3dformat
(
wined3d_desc
.
format
);
dxgi_sample_desc_from_wined3d
(
&
desc
->
SampleDesc
,
wined3d_desc
.
multisample_type
,
wined3d_desc
.
multisample_quality
);
return
S_OK
;
}
...
...
@@ -214,7 +219,7 @@ static const struct IUnknownVtbl dxgi_surface_inner_unknown_vtbl =
};
HRESULT
dxgi_surface_init
(
struct
dxgi_surface
*
surface
,
IDXGIDevice
*
device
,
IUnknown
*
outer
,
const
DXGI_SURFACE_DESC
*
desc
)
IUnknown
*
outer
,
struct
wined3d_resource
*
wined3d_resource
)
{
surface
->
IDXGISurface_iface
.
lpVtbl
=
&
dxgi_surface_vtbl
;
surface
->
IUnknown_iface
.
lpVtbl
=
&
dxgi_surface_inner_unknown_vtbl
;
...
...
@@ -222,7 +227,7 @@ HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
wined3d_private_store_init
(
&
surface
->
private_store
);
surface
->
outer_unknown
=
outer
?
outer
:
&
surface
->
IUnknown_iface
;
surface
->
device
=
device
;
surface
->
desc
=
*
desc
;
surface
->
wined3d_resource
=
wined3d_resource
;
return
S_OK
;
}
include/wine/winedxgi.idl
View file @
4a843f28
...
...
@@ -26,7 +26,7 @@ import "dxgi.idl";
interface
IWineDXGIDevice
:
IDXGIDevice
{
HRESULT
create_surface
(
[
in
]
const
DXGI_SURFACE_DESC
*
desc
,
[
in
]
struct
wined3d_resource
*
wined3d_resource
,
[
in
]
DXGI_USAGE
usage
,
[
in
]
const
DXGI_SHARED_RESOURCE
*
shared_resource
,
[
in
]
IUnknown
*
outer
,
...
...
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