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
543605ca
Commit
543605ca
authored
Oct 31, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass correct bind flags to swapchain creation functions.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7cba9157
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
36 deletions
+36
-36
device.c
dlls/d3d8/device.c
+1
-1
device.c
dlls/d3d9/device.c
+1
-1
ddraw.c
dlls/ddraw/ddraw.c
+1
-1
device.c
dlls/dxgi/device.c
+6
-6
dxgi_private.h
dlls/dxgi/dxgi_private.h
+2
-2
swapchain.c
dlls/dxgi/swapchain.c
+3
-3
utils.c
dlls/dxgi/utils.c
+11
-11
device.c
dlls/wined3d/device.c
+4
-4
swapchain.c
dlls/wined3d/swapchain.c
+6
-6
wined3d.h
include/wine/wined3d.h
+1
-1
No files found.
dlls/d3d8/device.c
View file @
543605ca
...
...
@@ -301,7 +301,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch
swapchain_desc
->
backbuffer_height
=
present_parameters
->
BackBufferHeight
;
swapchain_desc
->
backbuffer_format
=
wined3dformat_from_d3dformat
(
present_parameters
->
BackBufferFormat
);
swapchain_desc
->
backbuffer_count
=
max
(
1
,
present_parameters
->
BackBufferCount
);
swapchain_desc
->
backbuffer_
usage
=
WINED3DUSAGE_RENDER
TARGET
;
swapchain_desc
->
backbuffer_
bind_flags
=
WINED3D_BIND_RENDER_
TARGET
;
swapchain_desc
->
multisample_type
=
present_parameters
->
MultiSampleType
;
swapchain_desc
->
multisample_quality
=
0
;
/* d3d9 only */
swapchain_desc
->
swap_effect
=
wined3dswapeffect_from_d3dswapeffect
(
present_parameters
->
SwapEffect
);
...
...
dlls/d3d9/device.c
View file @
543605ca
...
...
@@ -335,7 +335,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch
swapchain_desc
->
backbuffer_height
=
present_parameters
->
BackBufferHeight
;
swapchain_desc
->
backbuffer_format
=
wined3dformat_from_d3dformat
(
present_parameters
->
BackBufferFormat
);
swapchain_desc
->
backbuffer_count
=
max
(
1
,
present_parameters
->
BackBufferCount
);
swapchain_desc
->
backbuffer_
usage
=
WINED3DUSAGE_RENDER
TARGET
;
swapchain_desc
->
backbuffer_
bind_flags
=
WINED3D_BIND_RENDER_
TARGET
;
swapchain_desc
->
multisample_type
=
present_parameters
->
MultiSampleType
;
swapchain_desc
->
multisample_quality
=
present_parameters
->
MultiSampleQuality
;
swapchain_desc
->
swap_effect
=
wined3dswapeffect_from_d3dswapeffect
(
present_parameters
->
SwapEffect
);
...
...
dlls/ddraw/ddraw.c
View file @
543605ca
...
...
@@ -631,7 +631,7 @@ static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL win
swapchain_desc
.
backbuffer_width
=
mode
.
width
;
swapchain_desc
.
backbuffer_height
=
mode
.
height
;
swapchain_desc
.
backbuffer_format
=
mode
.
format_id
;
swapchain_desc
.
backbuffer_
usage
=
0
;
swapchain_desc
.
backbuffer_
bind_flags
=
0
;
swapchain_desc
.
backbuffer_count
=
1
;
swapchain_desc
.
swap_effect
=
WINED3D_SWAP_EFFECT_DISCARD
;
swapchain_desc
.
device_window
=
window
;
...
...
dlls/dxgi/device.c
View file @
543605ca
...
...
@@ -186,12 +186,12 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
surface_desc
.
format
=
wined3dformat_from_dxgi_format
(
desc
->
Format
);
wined3d_sample_desc_from_dxgi
(
&
surface_desc
.
multisample_type
,
&
surface_desc
.
multisample_quality
,
&
desc
->
SampleDesc
);
surface_desc
.
usage
=
wined3d_usage
_from_dxgi_usage
(
usage
);
surface_desc
.
bind_flags
=
0
;
if
(
surface_desc
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
surface_desc
.
bind_flags
|=
WINED3D_BIND_RENDER_TARGET
;
if
(
surface_desc
.
usage
&
WINED3DUSAGE_TEXTURE
)
surface_desc
.
bind_flags
|=
WINED3D_BIND_SHADER_RESOURCE
;
surface_desc
.
bind_flags
=
wined3d_bind_flags
_from_dxgi_usage
(
usage
);
surface_desc
.
usage
=
0
;
if
(
surface_desc
.
bind_flags
&
WINED3D_BIND_SHADER_RESOURCE
)
surface_desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
if
(
surface_desc
.
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)
surface_desc
.
usage
|=
WINED3DUSAGE_RENDERTARGET
;
surface_desc
.
access
=
WINED3D_RESOURCE_ACCESS_GPU
;
surface_desc
.
width
=
desc
->
Width
;
surface_desc
.
height
=
desc
->
Height
;
...
...
dlls/dxgi/dxgi_private.h
View file @
543605ca
...
...
@@ -91,8 +91,8 @@ void wined3d_sample_desc_from_dxgi(enum wined3d_multisample_type *wined3d_type,
unsigned
int
*
wined3d_quality
,
const
DXGI_SAMPLE_DESC
*
dxgi_desc
)
DECLSPEC_HIDDEN
;
void
wined3d_display_mode_from_dxgi
(
struct
wined3d_display_mode
*
wined3d_mode
,
const
DXGI_MODE_DESC
*
mode
)
DECLSPEC_HIDDEN
;
DXGI_USAGE
dxgi_usage_from_wined3d_
usage
(
DWORD
wined3d_usage
)
DECLSPEC_HIDDEN
;
DWORD
wined3d_usage
_from_dxgi_usage
(
DXGI_USAGE
usage
)
DECLSPEC_HIDDEN
;
DXGI_USAGE
dxgi_usage_from_wined3d_
bind_flags
(
unsigned
int
wined3d_bind_flags
)
DECLSPEC_HIDDEN
;
unsigned
int
wined3d_bind_flags
_from_dxgi_usage
(
DXGI_USAGE
usage
)
DECLSPEC_HIDDEN
;
unsigned
int
dxgi_swapchain_flags_from_wined3d
(
unsigned
int
wined3d_flags
)
DECLSPEC_HIDDEN
;
unsigned
int
wined3d_swapchain_flags_from_dxgi
(
unsigned
int
flags
)
DECLSPEC_HIDDEN
;
...
...
dlls/dxgi/swapchain.c
View file @
543605ca
...
...
@@ -381,7 +381,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc(IDXGISwapChain1 *iface,
desc
->
BufferDesc
.
Scaling
=
DXGI_MODE_SCALING_UNSPECIFIED
;
dxgi_sample_desc_from_wined3d
(
&
desc
->
SampleDesc
,
wined3d_desc
.
multisample_type
,
wined3d_desc
.
multisample_quality
);
desc
->
BufferUsage
=
dxgi_usage_from_wined3d_
usage
(
wined3d_desc
.
backbuffer_usage
);
desc
->
BufferUsage
=
dxgi_usage_from_wined3d_
bind_flags
(
wined3d_desc
.
backbuffer_bind_flags
);
desc
->
BufferCount
=
wined3d_desc
.
backbuffer_count
;
desc
->
OutputWindow
=
wined3d_desc
.
device_window
;
desc
->
Windowed
=
wined3d_desc
.
windowed
;
...
...
@@ -538,7 +538,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetDesc1(IDXGISwapChain1 *iface
desc
->
Stereo
=
FALSE
;
dxgi_sample_desc_from_wined3d
(
&
desc
->
SampleDesc
,
wined3d_desc
.
multisample_type
,
wined3d_desc
.
multisample_quality
);
desc
->
BufferUsage
=
dxgi_usage_from_wined3d_
usage
(
wined3d_desc
.
backbuffer_usage
);
desc
->
BufferUsage
=
dxgi_usage_from_wined3d_
bind_flags
(
wined3d_desc
.
backbuffer_bind_flags
);
desc
->
BufferCount
=
wined3d_desc
.
backbuffer_count
;
desc
->
Scaling
=
DXGI_SCALING_STRETCH
;
desc
->
SwapEffect
=
dxgi_swap_effect_from_wined3d
(
wined3d_desc
.
swap_effect
);
...
...
@@ -858,7 +858,7 @@ HRESULT d3d11_swapchain_create(IWineDXGIDevice *device, HWND window, const DXGI_
wined3d_desc
.
backbuffer_height
=
swapchain_desc
->
Height
;
wined3d_desc
.
backbuffer_format
=
wined3dformat_from_dxgi_format
(
swapchain_desc
->
Format
);
wined3d_desc
.
backbuffer_count
=
swapchain_desc
->
BufferCount
;
wined3d_desc
.
backbuffer_
usage
=
wined3d_usage
_from_dxgi_usage
(
swapchain_desc
->
BufferUsage
);
wined3d_desc
.
backbuffer_
bind_flags
=
wined3d_bind_flags
_from_dxgi_usage
(
swapchain_desc
->
BufferUsage
);
wined3d_sample_desc_from_dxgi
(
&
wined3d_desc
.
multisample_type
,
&
wined3d_desc
.
multisample_quality
,
&
swapchain_desc
->
SampleDesc
);
wined3d_desc
.
device_window
=
window
;
...
...
dlls/dxgi/utils.c
View file @
543605ca
...
...
@@ -455,34 +455,34 @@ void wined3d_display_mode_from_dxgi(struct wined3d_display_mode *wined3d_mode,
wined3d_mode
->
scanline_ordering
=
wined3d_scanline_ordering_from_dxgi
(
mode
->
ScanlineOrdering
);
}
DXGI_USAGE
dxgi_usage_from_wined3d_
usage
(
DWORD
wined3d_usage
)
DXGI_USAGE
dxgi_usage_from_wined3d_
bind_flags
(
unsigned
int
wined3d_bind_flags
)
{
DXGI_USAGE
dxgi_usage
=
0
;
if
(
wined3d_
usage
&
WINED3DUSAGE_TEXTUR
E
)
if
(
wined3d_
bind_flags
&
WINED3D_BIND_SHADER_RESOURC
E
)
dxgi_usage
|=
DXGI_USAGE_SHADER_INPUT
;
if
(
wined3d_
usage
&
WINED3DUSAGE_RENDER
TARGET
)
if
(
wined3d_
bind_flags
&
WINED3D_BIND_RENDER_
TARGET
)
dxgi_usage
|=
DXGI_USAGE_RENDER_TARGET_OUTPUT
;
wined3d_
usage
&=
~
(
WINED3DUSAGE_TEXTURE
|
WINED3DUSAGE_RENDER
TARGET
);
if
(
wined3d_
usage
)
FIXME
(
"Unhandled wined3d
usage %#x.
\n
"
,
wined3d_usage
);
wined3d_
bind_flags
&=
~
(
WINED3D_BIND_SHADER_RESOURCE
|
WINED3D_BIND_RENDER_
TARGET
);
if
(
wined3d_
bind_flags
)
FIXME
(
"Unhandled wined3d
bind flags %#x.
\n
"
,
wined3d_bind_flags
);
return
dxgi_usage
;
}
DWORD
wined3d_usage
_from_dxgi_usage
(
DXGI_USAGE
dxgi_usage
)
unsigned
int
wined3d_bind_flags
_from_dxgi_usage
(
DXGI_USAGE
dxgi_usage
)
{
DWORD
wined3d_usage
=
0
;
unsigned
int
wined3d_bind_flags
=
0
;
if
(
dxgi_usage
&
DXGI_USAGE_SHADER_INPUT
)
wined3d_
usage
|=
WINED3DUSAGE_TEXTUR
E
;
wined3d_
bind_flags
|=
WINED3D_BIND_SHADER_RESOURC
E
;
if
(
dxgi_usage
&
DXGI_USAGE_RENDER_TARGET_OUTPUT
)
wined3d_
usage
|=
WINED3DUSAGE_RENDER
TARGET
;
wined3d_
bind_flags
|=
WINED3D_BIND_RENDER_
TARGET
;
dxgi_usage
&=
~
(
DXGI_USAGE_SHADER_INPUT
|
DXGI_USAGE_RENDER_TARGET_OUTPUT
);
if
(
dxgi_usage
)
FIXME
(
"Unhandled DXGI usage %#x.
\n
"
,
dxgi_usage
);
return
wined3d_
usage
;
return
wined3d_
bind_flags
;
}
#define DXGI_WINED3D_SWAPCHAIN_FLAGS \
...
...
dlls/wined3d/device.c
View file @
543605ca
...
...
@@ -1092,7 +1092,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device,
goto
err_out
;
}
if
(
swapchain_desc
->
backbuffer_count
&&
swapchain_desc
->
backbuffer_
usage
&
WINED3DUSAGE_RENDER
TARGET
)
if
(
swapchain_desc
->
backbuffer_count
&&
swapchain_desc
->
backbuffer_
bind_flags
&
WINED3D_BIND_RENDER_
TARGET
)
{
struct
wined3d_resource
*
back_buffer
=
&
swapchain
->
back_buffers
[
0
]
->
resource
;
struct
wined3d_view_desc
view_desc
;
...
...
@@ -4823,8 +4823,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
TRACE
(
"refresh_rate %u
\n
"
,
swapchain_desc
->
refresh_rate
);
TRACE
(
"auto_restore_display_mode %#x
\n
"
,
swapchain_desc
->
auto_restore_display_mode
);
if
(
swapchain_desc
->
backbuffer_
usage
&&
swapchain_desc
->
backbuffer_usage
!=
WINED3DUSAGE_RENDER
TARGET
)
FIXME
(
"Got unexpected backbuffer
usage %#x.
\n
"
,
swapchain_desc
->
backbuffer_usage
);
if
(
swapchain_desc
->
backbuffer_
bind_flags
&&
swapchain_desc
->
backbuffer_bind_flags
!=
WINED3D_BIND_RENDER_
TARGET
)
FIXME
(
"Got unexpected backbuffer
bind flags %#x.
\n
"
,
swapchain_desc
->
backbuffer_bind_flags
);
if
(
swapchain_desc
->
swap_effect
!=
WINED3D_SWAP_EFFECT_DISCARD
&&
swapchain_desc
->
swap_effect
!=
WINED3D_SWAP_EFFECT_SEQUENTIAL
...
...
@@ -4939,7 +4939,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
wined3d_rendertarget_view_decref
(
device
->
back_buffer_view
);
device
->
back_buffer_view
=
NULL
;
}
if
(
swapchain
->
desc
.
backbuffer_count
&&
swapchain
->
desc
.
backbuffer_
usage
&
WINED3DUSAGE_RENDER
TARGET
)
if
(
swapchain
->
desc
.
backbuffer_count
&&
swapchain
->
desc
.
backbuffer_
bind_flags
&
WINED3D_BIND_RENDER_
TARGET
)
{
struct
wined3d_resource
*
back_buffer
=
&
swapchain
->
back_buffers
[
0
]
->
resource
;
...
...
dlls/wined3d/swapchain.c
View file @
543605ca
...
...
@@ -917,14 +917,14 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
goto
err
;
}
texture_desc
.
usage
=
swapchain
->
desc
.
backbuffer_usage
;
texture_desc
.
bind_flags
=
swapchain
->
desc
.
backbuffer_bind_flags
;
texture_desc
.
usage
=
0
;
if
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
)
texture_desc
.
usage
|=
WINED3DUSAGE_OWNDC
;
texture_desc
.
bind_flags
=
0
;
if
(
texture_desc
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
texture_desc
.
bind_flags
|=
WINED3D_BIND_RENDER_TARGET
;
if
(
texture_desc
.
usage
&
WINED3DUSAGE_TEXTURE
)
texture_desc
.
bind_flags
|=
WINED3D_BIND_SHADER_RESOURCE
;
if
(
texture_desc
.
bind_flags
&
WINED3D_BIND_RENDER_TARGET
)
texture_desc
.
usage
|=
WINED3DUSAGE_RENDERTARGET
;
if
(
texture_desc
.
bind_flags
&
WINED3D_BIND_SHADER_RESOURCE
)
texture_desc
.
usage
|=
WINED3DUSAGE_TEXTURE
;
for
(
i
=
0
;
i
<
swapchain
->
desc
.
backbuffer_count
;
++
i
)
{
TRACE
(
"Creating back buffer %u.
\n
"
,
i
);
...
...
include/wine/wined3d.h
View file @
543605ca
...
...
@@ -1747,7 +1747,7 @@ struct wined3d_swapchain_desc
unsigned
int
backbuffer_height
;
enum
wined3d_format_id
backbuffer_format
;
unsigned
int
backbuffer_count
;
DWORD
backbuffer_usage
;
unsigned
int
backbuffer_bind_flags
;
enum
wined3d_multisample_type
multisample_type
;
DWORD
multisample_quality
;
enum
wined3d_swap_effect
swap_effect
;
...
...
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