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
49b8e55b
Commit
49b8e55b
authored
Apr 17, 2023
by
Giovanni Mascellani
Committed by
Alexandre Julliard
Apr 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Only download surface data from GPU for DXGI buffers when reading.
parent
071eb50f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
buffer.c
dlls/mfplat/buffer.c
+7
-3
mfplat.c
dlls/mfplat/tests/mfplat.c
+0
-1
No files found.
dlls/mfplat/buffer.c
View file @
49b8e55b
...
...
@@ -905,7 +905,7 @@ static HRESULT dxgi_surface_buffer_create_readback_texture(struct buffer *buffer
return
hr
;
}
static
HRESULT
dxgi_surface_buffer_map
(
struct
buffer
*
buffer
)
static
HRESULT
dxgi_surface_buffer_map
(
struct
buffer
*
buffer
,
MF2DBuffer_LockFlags
flags
)
{
ID3D11DeviceContext
*
immediate_context
;
ID3D11Device
*
device
;
...
...
@@ -916,8 +916,12 @@ static HRESULT dxgi_surface_buffer_map(struct buffer *buffer)
ID3D11Texture2D_GetDevice
(
buffer
->
dxgi_surface
.
texture
,
&
device
);
ID3D11Device_GetImmediateContext
(
device
,
&
immediate_context
);
if
(
flags
==
MF2DBuffer_LockFlags_Read
||
flags
==
MF2DBuffer_LockFlags_ReadWrite
)
{
ID3D11DeviceContext_CopySubresourceRegion
(
immediate_context
,
(
ID3D11Resource
*
)
buffer
->
dxgi_surface
.
rb_texture
,
0
,
0
,
0
,
0
,
(
ID3D11Resource
*
)
buffer
->
dxgi_surface
.
texture
,
buffer
->
dxgi_surface
.
sub_resource_idx
,
NULL
);
}
memset
(
&
buffer
->
dxgi_surface
.
map_desc
,
0
,
sizeof
(
buffer
->
dxgi_surface
.
map_desc
));
if
(
FAILED
(
hr
=
ID3D11DeviceContext_Map
(
immediate_context
,
(
ID3D11Resource
*
)
buffer
->
dxgi_surface
.
rb_texture
,
...
...
@@ -971,7 +975,7 @@ static HRESULT WINAPI dxgi_surface_buffer_Lock(IMFMediaBuffer *iface, BYTE **dat
if
(
SUCCEEDED
(
hr
))
{
hr
=
dxgi_surface_buffer_map
(
buffer
);
hr
=
dxgi_surface_buffer_map
(
buffer
,
MF2DBuffer_LockFlags_ReadWrite
);
if
(
SUCCEEDED
(
hr
))
{
copy_image
(
buffer
,
buffer
->
_2d
.
linear_buffer
,
buffer
->
_2d
.
width
,
buffer
->
dxgi_surface
.
map_desc
.
pData
,
...
...
@@ -1040,7 +1044,7 @@ static HRESULT dxgi_surface_buffer_lock(struct buffer *buffer, MF2DBuffer_LockFl
if
(
buffer
->
_2d
.
linear_buffer
)
hr
=
MF_E_UNEXPECTED
;
else
if
(
!
buffer
->
_2d
.
locks
)
hr
=
dxgi_surface_buffer_map
(
buffer
);
hr
=
dxgi_surface_buffer_map
(
buffer
,
flags
);
else
if
(
buffer
->
_2d
.
lock_flags
==
MF2DBuffer_LockFlags_Write
&&
flags
!=
MF2DBuffer_LockFlags_Write
)
hr
=
HRESULT_FROM_WIN32
(
ERROR_WAS_LOCKED
);
...
...
dlls/mfplat/tests/mfplat.c
View file @
49b8e55b
...
...
@@ -7458,7 +7458,6 @@ static void test_d3d11_surface_buffer(void)
hr
=
IMF2DBuffer2_Lock2DSize
(
_2dbuffer2
,
MF2DBuffer_LockFlags_Write
,
&
data
,
&
pitch
,
&
data2
,
&
length
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
*
(
DWORD
*
)
data
!=
0xefefefef
,
"Unexpected leading dword.
\n
"
);
memset
(
data
,
0x89
,
4
);
IMF2DBuffer2_Unlock2D
(
_2dbuffer2
);
...
...
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