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
574fd3d3
Commit
574fd3d3
authored
Sep 17, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxva2: Implement CreateSurface().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7c1b534a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
20 deletions
+71
-20
main.c
dlls/dxva2/main.c
+33
-4
dxva2.c
dlls/dxva2/tests/dxva2.c
+38
-16
No files found.
dlls/dxva2/main.c
View file @
574fd3d3
...
...
@@ -19,6 +19,7 @@
#define COBJMACROS
#include <stdarg.h>
#include <limits.h>
#include "windef.h"
#include "winbase.h"
#include "d3d9.h"
...
...
@@ -132,12 +133,40 @@ static ULONG WINAPI device_manager_processor_service_Release(IDirectXVideoProces
static
HRESULT
WINAPI
device_manager_processor_service_CreateSurface
(
IDirectXVideoProcessorService
*
iface
,
UINT
width
,
UINT
height
,
UINT
backbuffers
,
D3DFORMAT
format
,
D3DPOOL
pool
,
DWORD
usage
,
DWORD
dxvaType
,
IDirect3DSurface9
**
surface
,
HANDLE
*
shared_handle
)
IDirect3DSurface9
**
surface
s
,
HANDLE
*
shared_handle
)
{
FIXME
(
"%p, %u, %u, %u, %u, %u, %u, %u, %p, %p.
\n
"
,
iface
,
width
,
height
,
backbuffers
,
format
,
pool
,
usage
,
dxvaType
,
surface
,
shared_handle
);
struct
device_manager
*
manager
=
impl_from_IDirectXVideoProcessorService
(
iface
);
unsigned
int
i
,
j
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u, %u, %u, %u, %u, %u, %u, %p, %p.
\n
"
,
iface
,
width
,
height
,
backbuffers
,
format
,
pool
,
usage
,
dxvaType
,
surfaces
,
shared_handle
);
if
(
backbuffers
>=
UINT_MAX
)
return
E_INVALIDARG
;
memset
(
surfaces
,
0
,
(
backbuffers
+
1
)
*
sizeof
(
*
surfaces
));
for
(
i
=
0
;
i
<
backbuffers
+
1
;
++
i
)
{
if
(
FAILED
(
hr
=
IDirect3DDevice9_CreateOffscreenPlainSurface
(
manager
->
device
,
width
,
height
,
format
,
pool
,
&
surfaces
[
i
],
NULL
)))
break
;
}
if
(
FAILED
(
hr
))
{
for
(
j
=
0
;
j
<
i
;
++
j
)
{
if
(
surfaces
[
j
])
{
IDirect3DSurface9_Release
(
surfaces
[
j
]);
surfaces
[
j
]
=
NULL
;
}
}
}
return
hr
;
}
static
HRESULT
WINAPI
device_manager_processor_service_RegisterVideoProcessorSoftwareDevice
(
...
...
dlls/dxva2/tests/dxva2.c
View file @
574fd3d3
...
...
@@ -59,13 +59,31 @@ static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9, HWND focus_window)
return
device
;
}
static
void
test_surface_desc
(
IDirect3DSurface9
*
surface
)
{
D3DSURFACE_DESC
desc
=
{
0
};
HRESULT
hr
;
hr
=
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
desc
.
Format
==
D3DFMT_X8R8G8B8
,
"Unexpected format %d.
\n
"
,
desc
.
Format
);
ok
(
desc
.
Type
==
D3DRTYPE_SURFACE
,
"Unexpected type %d.
\n
"
,
desc
.
Type
);
ok
(
desc
.
Usage
==
0
,
"Unexpected usage %d.
\n
"
,
desc
.
Usage
);
ok
(
desc
.
Pool
==
D3DPOOL_DEFAULT
,
"Unexpected pool %d.
\n
"
,
desc
.
Pool
);
ok
(
desc
.
MultiSampleType
==
D3DMULTISAMPLE_NONE
,
"Unexpected multisample type %d.
\n
"
,
desc
.
MultiSampleType
);
ok
(
desc
.
MultiSampleQuality
==
0
,
"Unexpected multisample quality %d.
\n
"
,
desc
.
MultiSampleQuality
);
ok
(
desc
.
Width
==
64
,
"Unexpected width %u.
\n
"
,
desc
.
Width
);
ok
(
desc
.
Height
==
64
,
"Unexpected height %u.
\n
"
,
desc
.
Height
);
}
static
void
test_device_manager
(
void
)
{
IDirectXVideoProcessorService
*
processor_service
;
IDirectXVideoAccelerationService
*
accel_service
;
IDirect3DDevice9
*
device
,
*
device2
,
*
device3
;
IDirect3DDeviceManager9
*
manager
;
IDirect3DSurface9
*
surface
;
IDirect3DSurface9
*
surface
s
[
2
]
;
int
refcount
,
refcount2
;
HANDLE
handle
,
handle1
;
IDirect3D9
*
d3d
;
...
...
@@ -262,12 +280,20 @@ static void test_device_manager(void)
hr
=
DXVA2CreateVideoService
(
device
,
&
IID_IDirectXVideoAccelerationService
,
(
void
**
)
&
accel_service
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
surfaces
[
0
]
=
surfaces
[
1
]
=
NULL
;
hr
=
IDirectXVideoAccelerationService_CreateSurface
(
accel_service
,
64
,
64
,
0
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
0
,
DXVA2_VideoProcessorRenderTarget
,
surfaces
,
NULL
);
ok
(
hr
==
S_OK
,
"Failed to create a surface, hr %#x.
\n
"
,
hr
);
ok
(
!!
surfaces
[
0
]
&&
!
surfaces
[
1
],
"Unexpected surfaces.
\n
"
);
IDirect3DSurface9_Release
(
surfaces
[
0
]);
hr
=
IDirectXVideoAccelerationService_CreateSurface
(
accel_service
,
64
,
64
,
1
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
0
,
DXVA2_VideoProcessorRenderTarget
,
&
surface
,
NULL
);
todo_wine
D3DPOOL_DEFAULT
,
0
,
DXVA2_VideoProcessorRenderTarget
,
surfaces
,
NULL
);
ok
(
hr
==
S_OK
,
"Failed to create a surface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IDirect3DSurface9_Release
(
surface
);
ok
(
!!
surfaces
[
0
]
&&
!!
surfaces
[
1
],
"Unexpected surfaces.
\n
"
);
test_surface_desc
(
surfaces
[
0
]);
IDirect3DSurface9_Release
(
surfaces
[
0
]);
IDirect3DSurface9_Release
(
surfaces
[
1
]);
IDirectXVideoAccelerationService_Release
(
accel_service
);
...
...
@@ -281,20 +307,16 @@ todo_wine
hr
=
IDirect3DDeviceManager9_CloseDeviceHandle
(
manager
,
handle
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectXVideoAccelerationService_CreateSurface
(
accel_service
,
64
,
64
,
1
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
0
,
DXVA2_VideoProcessorRenderTarget
,
&
surface
,
NULL
);
todo_wine
hr
=
IDirectXVideoAccelerationService_CreateSurface
(
accel_service
,
64
,
64
,
0
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
0
,
DXVA2_VideoProcessorRenderTarget
,
surfaces
,
NULL
);
ok
(
hr
==
S_OK
,
"Failed to create a surface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DSurface9_GetDevice
(
surface
,
&
device3
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
device2
==
device3
,
"Unexpected device.
\n
"
);
IDirect3DDevice9_Release
(
device3
);
hr
=
IDirect3DSurface9_GetDevice
(
surfaces
[
0
],
&
device3
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
device2
==
device3
,
"Unexpected device.
\n
"
);
IDirect3DDevice9_Release
(
device3
);
IDirect3DSurface9_Release
(
surface
);
}
IDirect3DSurface9_Release
(
surfaces
[
0
]);
IDirectXVideoAccelerationService_Release
(
accel_service
);
...
...
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