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
f654f983
Commit
f654f983
authored
Aug 08, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a structure for Vulkan context information.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7170f674
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
29 deletions
+40
-29
adapter_vk.c
dlls/wined3d/adapter_vk.c
+9
-26
context.c
dlls/wined3d/context.c
+7
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+24
-1
No files found.
dlls/wined3d/adapter_vk.c
View file @
f654f983
...
...
@@ -24,23 +24,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
struct
wined3d_device_vk
{
struct
wined3d_device
d
;
struct
wined3d_context
context_vk
;
VkDevice
vk_device
;
VkQueue
vk_queue
;
struct
wined3d_vk_info
vk_info
;
};
static
inline
struct
wined3d_device_vk
*
wined3d_device_vk
(
struct
wined3d_device
*
device
)
{
return
CONTAINING_RECORD
(
device
,
struct
wined3d_device_vk
,
d
);
}
static
inline
const
struct
wined3d_adapter_vk
*
wined3d_adapter_vk_const
(
const
struct
wined3d_adapter
*
adapter
)
{
return
CONTAINING_RECORD
(
adapter
,
struct
wined3d_adapter_vk
,
a
);
...
...
@@ -300,7 +283,7 @@ struct wined3d_context *adapter_vk_acquire_context(struct wined3d_device *device
if
(
!
device
->
context_count
)
return
NULL
;
return
&
wined3d_device_vk
(
device
)
->
context_vk
;
return
&
wined3d_device_vk
(
device
)
->
context_vk
.
c
;
}
void
adapter_vk_release_context
(
struct
wined3d_context
*
context
)
...
...
@@ -416,8 +399,8 @@ static BOOL adapter_vk_check_format(const struct wined3d_adapter *adapter,
static
HRESULT
adapter_vk_init_3d
(
struct
wined3d_device
*
device
)
{
struct
wined3d_context_vk
*
context_vk
;
struct
wined3d_device_vk
*
device_vk
;
struct
wined3d_context
*
context_vk
;
HRESULT
hr
;
TRACE
(
"device %p.
\n
"
,
device
);
...
...
@@ -430,10 +413,10 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device)
return
hr
;
}
if
(
!
device_context_add
(
device
,
context_vk
))
if
(
!
device_context_add
(
device
,
&
context_vk
->
c
))
{
ERR
(
"Failed to add the newly created context to the context list.
\n
"
);
wined3d_context_cleanup
(
context_vk
);
wined3d_context_
vk_
cleanup
(
context_vk
);
return
E_FAIL
;
}
...
...
@@ -442,8 +425,8 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device)
if
(
!
(
device_vk
->
d
.
blitter
=
wined3d_cpu_blitter_create
()))
{
ERR
(
"Failed to create CPU blitter.
\n
"
);
device_context_remove
(
device
,
context_vk
);
wined3d_context_cleanup
(
context_vk
);
device_context_remove
(
device
,
&
context_vk
->
c
);
wined3d_context_
vk_
cleanup
(
context_vk
);
return
E_FAIL
;
}
...
...
@@ -452,15 +435,15 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device)
static
void
adapter_vk_uninit_3d
(
struct
wined3d_device
*
device
)
{
struct
wined3d_context
*
context_vk
;
struct
wined3d_context
_vk
*
context_vk
;
TRACE
(
"device %p.
\n
"
,
device
);
device
->
blitter
->
ops
->
blitter_destroy
(
device
->
blitter
,
NULL
);
context_vk
=
&
wined3d_device_vk
(
device
)
->
context_vk
;
device_context_remove
(
device
,
context_vk
);
wined3d_context_cleanup
(
context_vk
);
device_context_remove
(
device
,
&
context_vk
->
c
);
wined3d_context_
vk_
cleanup
(
context_vk
);
}
static
HRESULT
adapter_vk_create_swapchain
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
desc
,
...
...
dlls/wined3d/context.c
View file @
f654f983
...
...
@@ -1493,6 +1493,11 @@ static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl)
wined3d_context_cleanup
(
&
context_gl
->
c
);
}
void
wined3d_context_vk_cleanup
(
struct
wined3d_context_vk
*
context_vk
)
{
wined3d_context_cleanup
(
&
context_vk
->
c
);
}
DWORD
context_get_tls_idx
(
void
)
{
return
wined3d_context_tls_idx
;
...
...
@@ -2295,11 +2300,11 @@ fail:
return
E_FAIL
;
}
HRESULT
wined3d_context_vk_init
(
struct
wined3d_context
*
context_vk
,
struct
wined3d_swapchain
*
swapchain
)
HRESULT
wined3d_context_vk_init
(
struct
wined3d_context
_vk
*
context_vk
,
struct
wined3d_swapchain
*
swapchain
)
{
TRACE
(
"context_vk %p, swapchain %p.
\n
"
,
context_vk
,
swapchain
);
wined3d_context_init
(
context_vk
,
swapchain
);
wined3d_context_init
(
&
context_vk
->
c
,
swapchain
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
f654f983
...
...
@@ -2127,7 +2127,13 @@ void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl,
void
wined3d_context_gl_update_stream_sources
(
struct
wined3d_context_gl
*
context_gl
,
const
struct
wined3d_state
*
state
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_context_vk_init
(
struct
wined3d_context
*
context_vk
,
struct
wined3d_context_vk
{
struct
wined3d_context
c
;
};
void
wined3d_context_vk_cleanup
(
struct
wined3d_context_vk
*
context_vk
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_context_vk_init
(
struct
wined3d_context_vk
*
context_vk
,
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
typedef
void
(
*
APPLYSTATEFUNC
)(
struct
wined3d_context
*
ctx
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
);
...
...
@@ -3287,6 +3293,23 @@ static inline struct wined3d_device_gl *wined3d_device_gl(struct wined3d_device
return
CONTAINING_RECORD
(
device
,
struct
wined3d_device_gl
,
d
);
}
struct
wined3d_device_vk
{
struct
wined3d_device
d
;
struct
wined3d_context_vk
context_vk
;
VkDevice
vk_device
;
VkQueue
vk_queue
;
struct
wined3d_vk_info
vk_info
;
};
static
inline
struct
wined3d_device_vk
*
wined3d_device_vk
(
struct
wined3d_device
*
device
)
{
return
CONTAINING_RECORD
(
device
,
struct
wined3d_device_vk
,
d
);
}
static
inline
BOOL
isStateDirty
(
const
struct
wined3d_context
*
context
,
unsigned
int
state_id
)
{
unsigned
int
idx
=
state_id
/
(
sizeof
(
*
context
->
dirty_graphics_states
)
*
CHAR_BIT
);
...
...
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