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
4cfac484
Commit
4cfac484
authored
Mar 15, 2021
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move feature level selection to wined3d_state_create().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
53fdee61
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
38 deletions
+42
-38
device.c
dlls/d3d11/device.c
+2
-1
cs.c
dlls/wined3d/cs.c
+3
-3
device.c
dlls/wined3d/device.c
+1
-28
stateblock.c
dlls/wined3d/stateblock.c
+32
-3
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
wined3d.h
include/wine/wined3d.h
+2
-1
No files found.
dlls/d3d11/device.c
View file @
4cfac484
...
...
@@ -295,7 +295,8 @@ static struct wined3d_state *d3d_device_context_state_get_wined3d_state(struct d
if
((
entry
=
d3d_device_context_state_get_entry
(
state
,
device
)))
return
entry
->
wined3d_state
;
if
(
FAILED
(
wined3d_state_create
(
device
->
wined3d_device
,
&
wined3d_state
)))
if
(
FAILED
(
wined3d_state_create
(
device
->
wined3d_device
,
(
enum
wined3d_feature_level
*
)
&
device
->
feature_level
,
1
,
&
wined3d_state
)))
return
NULL
;
if
(
!
d3d_device_context_state_add_entry
(
state
,
device
,
wined3d_state
))
...
...
dlls/wined3d/cs.c
View file @
4cfac484
...
...
@@ -3008,7 +3008,8 @@ static DWORD WINAPI wined3d_cs_run(void *ctx)
FreeLibraryAndExitThread
(
wined3d_module
,
0
);
}
struct
wined3d_cs
*
wined3d_cs_create
(
struct
wined3d_device
*
device
,
enum
wined3d_feature_level
feature_level
)
struct
wined3d_cs
*
wined3d_cs_create
(
struct
wined3d_device
*
device
,
const
enum
wined3d_feature_level
*
levels
,
unsigned
int
level_count
)
{
const
struct
wined3d_d3d_info
*
d3d_info
=
&
device
->
adapter
->
d3d_info
;
struct
wined3d_cs
*
cs
;
...
...
@@ -3016,12 +3017,11 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device, enum wined3d
if
(
!
(
cs
=
heap_alloc_zero
(
sizeof
(
*
cs
))))
return
NULL
;
if
(
!
(
cs
->
c
.
state
=
heap_alloc_zero
(
sizeof
(
*
cs
->
c
.
state
)
)))
if
(
FAILED
(
wined3d_state_create
(
device
,
levels
,
level_count
,
&
cs
->
c
.
state
)))
{
heap_free
(
cs
);
return
NULL
;
}
state_init
(
cs
->
c
.
state
,
&
device
->
adapter
->
d3d_info
,
WINED3D_STATE_INIT_DEFAULT
,
feature_level
);
cs
->
c
.
ops
=
&
wined3d_cs_st_ops
;
cs
->
c
.
device
=
device
;
...
...
dlls/wined3d/device.c
View file @
4cfac484
...
...
@@ -5976,27 +5976,6 @@ static int wined3d_depth_stencil_state_compare(const void *key, const struct win
return
memcmp
(
&
state
->
desc
,
key
,
sizeof
(
state
->
desc
));
}
static
BOOL
wined3d_select_feature_level
(
const
struct
wined3d_adapter
*
adapter
,
const
enum
wined3d_feature_level
*
levels
,
unsigned
int
level_count
,
enum
wined3d_feature_level
*
selected_level
)
{
const
struct
wined3d_d3d_info
*
d3d_info
=
&
adapter
->
d3d_info
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
level_count
;
++
i
)
{
if
(
levels
[
i
]
&&
d3d_info
->
feature_level
>=
levels
[
i
])
{
*
selected_level
=
levels
[
i
];
return
TRUE
;
}
}
FIXME_
(
winediag
)(
"None of the requested D3D feature levels is supported on this GPU "
"with the current shader backend.
\n
"
);
return
FALSE
;
}
HRESULT
wined3d_device_init
(
struct
wined3d_device
*
device
,
struct
wined3d
*
wined3d
,
unsigned
int
adapter_idx
,
enum
wined3d_device_type
device_type
,
HWND
focus_window
,
unsigned
int
flags
,
BYTE
surface_alignment
,
const
enum
wined3d_feature_level
*
levels
,
unsigned
int
level_count
,
...
...
@@ -6005,15 +5984,9 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined
struct
wined3d_adapter
*
adapter
=
wined3d
->
adapters
[
adapter_idx
];
const
struct
wined3d_fragment_pipe_ops
*
fragment_pipeline
;
const
struct
wined3d_vertex_pipe_ops
*
vertex_pipeline
;
enum
wined3d_feature_level
feature_level
;
unsigned
int
i
;
HRESULT
hr
;
if
(
!
wined3d_select_feature_level
(
adapter
,
levels
,
level_count
,
&
feature_level
))
return
E_FAIL
;
TRACE
(
"Device feature level %s.
\n
"
,
wined3d_debug_feature_level
(
feature_level
));
device
->
ref
=
1
;
device
->
wined3d
=
wined3d
;
wined3d_incref
(
device
->
wined3d
);
...
...
@@ -6058,7 +6031,7 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined
device
->
max_frame_latency
=
3
;
if
(
!
(
device
->
cs
=
wined3d_cs_create
(
device
,
feature_level
)))
if
(
!
(
device
->
cs
=
wined3d_cs_create
(
device
,
levels
,
level_count
)))
{
WARN
(
"Failed to create command stream.
\n
"
);
hr
=
E_FAIL
;
...
...
dlls/wined3d/stateblock.c
View file @
4cfac484
...
...
@@ -27,6 +27,7 @@
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
WINE_DECLARE_DEBUG_CHANNEL
(
winediag
);
static
const
DWORD
pixel_states_render
[]
=
{
...
...
@@ -1887,15 +1888,43 @@ void state_init(struct wined3d_state *state, const struct wined3d_d3d_info *d3d_
state_init_default
(
state
,
d3d_info
);
}
HRESULT
CDECL
wined3d_state_create
(
struct
wined3d_device
*
device
,
struct
wined3d_state
**
state
)
static
bool
wined3d_select_feature_level
(
const
struct
wined3d_adapter
*
adapter
,
const
enum
wined3d_feature_level
*
levels
,
unsigned
int
level_count
,
enum
wined3d_feature_level
*
selected_level
)
{
const
struct
wined3d_d3d_info
*
d3d_info
=
&
adapter
->
d3d_info
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
level_count
;
++
i
)
{
if
(
levels
[
i
]
&&
d3d_info
->
feature_level
>=
levels
[
i
])
{
*
selected_level
=
levels
[
i
];
return
true
;
}
}
FIXME_
(
winediag
)(
"None of the requested D3D feature levels is supported on this GPU "
"with the current shader backend.
\n
"
);
return
false
;
}
HRESULT
CDECL
wined3d_state_create
(
struct
wined3d_device
*
device
,
const
enum
wined3d_feature_level
*
levels
,
unsigned
int
level_count
,
struct
wined3d_state
**
state
)
{
enum
wined3d_feature_level
feature_level
;
struct
wined3d_state
*
object
;
TRACE
(
"device %p, state %p.
\n
"
,
device
,
state
);
TRACE
(
"device %p, levels %p, level_count %u, state %p.
\n
"
,
device
,
levels
,
level_count
,
state
);
if
(
!
wined3d_select_feature_level
(
device
->
adapter
,
levels
,
level_count
,
&
feature_level
))
return
E_FAIL
;
TRACE
(
"Selected feature level %s.
\n
"
,
wined3d_debug_feature_level
(
feature_level
));
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
state_init
(
object
,
&
device
->
adapter
->
d3d_info
,
WINED3D_STATE_INIT_DEFAULT
,
device
->
cs
->
c
.
state
->
feature_level
);
state_init
(
object
,
&
device
->
adapter
->
d3d_info
,
WINED3D_STATE_INIT_DEFAULT
,
feature_level
);
*
state
=
object
;
return
S_OK
;
...
...
dlls/wined3d/wined3d.spec
View file @
4cfac484
...
...
@@ -245,7 +245,7 @@
@ cdecl wined3d_shader_resource_view_get_parent(ptr)
@ cdecl wined3d_shader_resource_view_incref(ptr)
@ cdecl wined3d_state_create(ptr ptr)
@ cdecl wined3d_state_create(ptr ptr
long ptr
)
@ cdecl wined3d_state_destroy(ptr)
@ cdecl wined3d_state_get_feature_level(ptr)
...
...
dlls/wined3d/wined3d_private.h
View file @
4cfac484
...
...
@@ -4717,7 +4717,7 @@ struct wined3d_cs
};
struct
wined3d_cs
*
wined3d_cs_create
(
struct
wined3d_device
*
device
,
enum
wined3d_feature_level
feature_level
)
DECLSPEC_HIDDEN
;
const
enum
wined3d_feature_level
*
levels
,
unsigned
int
level_count
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_destroy
(
struct
wined3d_cs
*
cs
)
DECLSPEC_HIDDEN
;
void
wined3d_cs_destroy_object
(
struct
wined3d_cs
*
cs
,
void
(
*
callback
)(
void
*
object
),
void
*
object
)
DECLSPEC_HIDDEN
;
...
...
include/wine/wined3d.h
View file @
4cfac484
...
...
@@ -2745,7 +2745,8 @@ void __cdecl wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader
void
*
__cdecl
wined3d_shader_resource_view_get_parent
(
const
struct
wined3d_shader_resource_view
*
view
);
ULONG
__cdecl
wined3d_shader_resource_view_incref
(
struct
wined3d_shader_resource_view
*
view
);
HRESULT
__cdecl
wined3d_state_create
(
struct
wined3d_device
*
device
,
struct
wined3d_state
**
state
);
HRESULT
__cdecl
wined3d_state_create
(
struct
wined3d_device
*
device
,
const
enum
wined3d_feature_level
*
levels
,
unsigned
int
level_count
,
struct
wined3d_state
**
state
);
void
__cdecl
wined3d_state_destroy
(
struct
wined3d_state
*
state
);
enum
wined3d_feature_level
__cdecl
wined3d_state_get_feature_level
(
const
struct
wined3d_state
*
state
);
...
...
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