Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
093d0a85
Commit
093d0a85
authored
May 24, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/allocator: Apply default bindflags only for RGBA formats.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c27b2461
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
sample.c
dlls/mfplat/sample.c
+20
-10
No files found.
dlls/mfplat/sample.c
View file @
093d0a85
...
...
@@ -1379,10 +1379,12 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
unsigned
int
max_sample_count
,
IMFAttributes
*
attributes
,
IMFMediaType
*
media_type
)
{
struct
surface_service
service
;
DXGI_FORMAT
dxgi_format
;
unsigned
int
i
;
GUID
major
,
subtype
;
UINT64
frame_size
;
IMFSample
*
sample
;
D3D11_USAGE
usage
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IMFMediaType_GetMajorType
(
media_type
,
&
major
)))
...
...
@@ -1400,22 +1402,30 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
if
(
sample_count
>
max_sample_count
)
return
E_INVALIDARG
;
allocator
->
frame_desc
.
usage
=
D3D11_USAGE_DEFAULT
;
usage
=
D3D11_USAGE_DEFAULT
;
if
(
attributes
)
{
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_BUFFERS_PER_SAMPLE
,
&
allocator
->
frame_desc
.
buffer_count
);
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_D3D11_USAGE
,
&
allocator
->
frame_desc
.
usage
);
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_D3D11_USAGE
,
&
usage
);
}
if
(
allocator
->
frame_desc
.
usage
==
D3D11_USAGE_IMMUTABLE
||
allocator
->
frame_desc
.
usage
>
D3D11_USAGE_STAGING
)
if
(
usage
==
D3D11_USAGE_IMMUTABLE
||
usage
>
D3D11_USAGE_STAGING
)
return
E_INVALIDARG
;
if
(
allocator
->
frame_desc
.
usage
==
D3D11_USAGE_DEFAULT
)
allocator
->
frame_desc
.
bindflags
=
D3D11_BIND_SHADER_RESOURCE
|
D3D11_BIND_RENDER_TARGET
;
else
if
(
allocator
->
frame_desc
.
usage
==
D3D11_USAGE_DYNAMIC
)
allocator
->
frame_desc
.
bindflags
=
D3D11_BIND_SHADER_RESOURCE
;
else
allocator
->
frame_desc
.
bindflags
=
0
;
dxgi_format
=
MFMapDX9FormatToDXGIFormat
(
subtype
.
Data1
);
allocator
->
frame_desc
.
bindflags
=
0
;
allocator
->
frame_desc
.
usage
=
D3D11_USAGE_DEFAULT
;
if
(
dxgi_format
==
DXGI_FORMAT_B8G8R8A8_UNORM
||
dxgi_format
==
DXGI_FORMAT_B8G8R8X8_UNORM
)
{
allocator
->
frame_desc
.
usage
=
usage
;
if
(
allocator
->
frame_desc
.
usage
==
D3D11_USAGE_DEFAULT
)
allocator
->
frame_desc
.
bindflags
=
D3D11_BIND_SHADER_RESOURCE
|
D3D11_BIND_RENDER_TARGET
;
else
if
(
allocator
->
frame_desc
.
usage
==
D3D11_USAGE_DYNAMIC
)
allocator
->
frame_desc
.
bindflags
=
D3D11_BIND_SHADER_RESOURCE
;
}
if
(
attributes
)
IMFAttributes_GetUINT32
(
attributes
,
&
MF_SA_D3D11_BINDFLAGS
,
&
allocator
->
frame_desc
.
bindflags
);
...
...
@@ -1427,7 +1437,7 @@ static HRESULT sample_allocator_initialize(struct sample_allocator *allocator, u
max_sample_count
=
max
(
1
,
max_sample_count
);
allocator
->
frame_desc
.
d3d9_format
=
subtype
.
Data1
;
allocator
->
frame_desc
.
dxgi_format
=
MFMapDX9FormatToDXGIFormat
(
allocator
->
frame_desc
.
d3d9_format
)
;
allocator
->
frame_desc
.
dxgi_format
=
dxgi_format
;
allocator
->
frame_desc
.
width
=
frame_size
>>
32
;
allocator
->
frame_desc
.
height
=
frame_size
;
allocator
->
frame_desc
.
buffer_count
=
max
(
1
,
allocator
->
frame_desc
.
buffer_count
);
...
...
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