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
d073d3ea
Commit
d073d3ea
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 upload surface data to GPU for DXGI buffers when writing.
parent
49b8e55b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
buffer.c
dlls/mfplat/buffer.c
+10
-5
mfplat.c
dlls/mfplat/tests/mfplat.c
+0
-1
No files found.
dlls/mfplat/buffer.c
View file @
d073d3ea
...
...
@@ -936,7 +936,7 @@ static HRESULT dxgi_surface_buffer_map(struct buffer *buffer, MF2DBuffer_LockFla
return
hr
;
}
static
void
dxgi_surface_buffer_unmap
(
struct
buffer
*
buffer
)
static
void
dxgi_surface_buffer_unmap
(
struct
buffer
*
buffer
,
MF2DBuffer_LockFlags
flags
)
{
ID3D11DeviceContext
*
immediate_context
;
ID3D11Device
*
device
;
...
...
@@ -946,8 +946,11 @@ static void dxgi_surface_buffer_unmap(struct buffer *buffer)
ID3D11DeviceContext_Unmap
(
immediate_context
,
(
ID3D11Resource
*
)
buffer
->
dxgi_surface
.
rb_texture
,
0
);
memset
(
&
buffer
->
dxgi_surface
.
map_desc
,
0
,
sizeof
(
buffer
->
dxgi_surface
.
map_desc
));
ID3D11DeviceContext_CopySubresourceRegion
(
immediate_context
,
(
ID3D11Resource
*
)
buffer
->
dxgi_surface
.
texture
,
buffer
->
dxgi_surface
.
sub_resource_idx
,
0
,
0
,
0
,
(
ID3D11Resource
*
)
buffer
->
dxgi_surface
.
rb_texture
,
0
,
NULL
);
if
(
flags
==
MF2DBuffer_LockFlags_Write
||
flags
==
MF2DBuffer_LockFlags_ReadWrite
)
{
ID3D11DeviceContext_CopySubresourceRegion
(
immediate_context
,
(
ID3D11Resource
*
)
buffer
->
dxgi_surface
.
texture
,
buffer
->
dxgi_surface
.
sub_resource_idx
,
0
,
0
,
0
,
(
ID3D11Resource
*
)
buffer
->
dxgi_surface
.
rb_texture
,
0
,
NULL
);
}
ID3D11DeviceContext_Release
(
immediate_context
);
ID3D11Device_Release
(
device
);
...
...
@@ -1014,7 +1017,7 @@ static HRESULT WINAPI dxgi_surface_buffer_Unlock(IMFMediaBuffer *iface)
{
copy_image
(
buffer
,
buffer
->
dxgi_surface
.
map_desc
.
pData
,
buffer
->
dxgi_surface
.
map_desc
.
RowPitch
,
buffer
->
_2d
.
linear_buffer
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
width
,
buffer
->
_2d
.
height
);
dxgi_surface_buffer_unmap
(
buffer
);
dxgi_surface_buffer_unmap
(
buffer
,
MF2DBuffer_LockFlags_ReadWrite
);
free
(
buffer
->
_2d
.
linear_buffer
);
buffer
->
_2d
.
linear_buffer
=
NULL
;
...
...
@@ -1052,6 +1055,8 @@ static HRESULT dxgi_surface_buffer_lock(struct buffer *buffer, MF2DBuffer_LockFl
{
if
(
!
buffer
->
_2d
.
locks
)
buffer
->
_2d
.
lock_flags
=
flags
;
else
buffer
->
_2d
.
lock_flags
|=
flags
;
buffer
->
_2d
.
locks
++
;
*
scanline0
=
buffer
->
dxgi_surface
.
map_desc
.
pData
;
*
pitch
=
buffer
->
dxgi_surface
.
map_desc
.
RowPitch
;
...
...
@@ -1096,7 +1101,7 @@ static HRESULT WINAPI dxgi_surface_buffer_Unlock2D(IMF2DBuffer2 *iface)
{
if
(
!--
buffer
->
_2d
.
locks
)
{
dxgi_surface_buffer_unmap
(
buffer
);
dxgi_surface_buffer_unmap
(
buffer
,
buffer
->
_2d
.
lock_flags
);
buffer
->
_2d
.
lock_flags
=
0
;
}
}
...
...
dlls/mfplat/tests/mfplat.c
View file @
d073d3ea
...
...
@@ -7452,7 +7452,6 @@ static void test_d3d11_surface_buffer(void)
IMF2DBuffer2_Unlock2D
(
_2dbuffer2
);
color
=
get_d3d11_texture_color
(
texture
,
0
,
0
);
todo_wine
ok
(
color
==
0xcdcdcdcd
,
"Unexpected leading dword %#lx.
\n
"
,
color
);
put_d3d11_texture_color
(
texture
,
0
,
0
,
0xefefefef
);
...
...
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