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
f45dd543
Commit
f45dd543
authored
Apr 30, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Create Vulkan image views for unordered access views.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
573f37ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
6 deletions
+73
-6
adapter_vk.c
dlls/wined3d/adapter_vk.c
+9
-5
view.c
dlls/wined3d/view.c
+63
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/adapter_vk.c
View file @
f45dd543
...
...
@@ -1388,11 +1388,13 @@ static HRESULT adapter_vk_create_unordered_access_view(const struct wined3d_view
static
void
adapter_vk_destroy_unordered_access_view
(
struct
wined3d_unordered_access_view
*
view
)
{
struct
wined3d_unordered_access_view_vk
*
view
_vk
=
wined3d_unordered_access_view_vk
(
view
);
struct
wined3d_device
*
device
=
view
_vk
->
v
.
resource
->
device
;
struct
wined3d_unordered_access_view_vk
*
uav
_vk
=
wined3d_unordered_access_view_vk
(
view
);
struct
wined3d_device
*
device
=
uav
_vk
->
v
.
resource
->
device
;
unsigned
int
swapchain_count
=
device
->
swapchain_count
;
struct
wined3d_view_vk
*
view_vk
=
&
uav_vk
->
view_vk
;
VkImageView
*
vk_image_view
=
NULL
;
TRACE
(
"
view_vk %p.
\n
"
,
view
_vk
);
TRACE
(
"
uav_vk %p.
\n
"
,
uav
_vk
);
/* Take a reference to the device, in case releasing the view's resource
* would cause the device to be destroyed. However, swapchain resources
...
...
@@ -1400,8 +1402,10 @@ static void adapter_vk_destroy_unordered_access_view(struct wined3d_unordered_ac
* the refcount on a device that's in the process of being destroyed. */
if
(
swapchain_count
)
wined3d_device_incref
(
device
);
wined3d_unordered_access_view_cleanup
(
&
view_vk
->
v
);
wined3d_cs_destroy_object
(
device
->
cs
,
heap_free
,
view_vk
);
if
(
uav_vk
->
v
.
resource
->
type
!=
WINED3D_RTYPE_BUFFER
)
vk_image_view
=
&
view_vk
->
u
.
vk_image_info
.
imageView
;
wined3d_unordered_access_view_cleanup
(
&
uav_vk
->
v
);
wined3d_view_vk_destroy
(
device
,
NULL
,
vk_image_view
,
&
view_vk
->
command_buffer_id
,
uav_vk
);
if
(
swapchain_count
)
wined3d_device_decref
(
device
);
}
...
...
dlls/wined3d/view.c
View file @
f45dd543
...
...
@@ -1453,14 +1453,76 @@ HRESULT wined3d_unordered_access_view_gl_init(struct wined3d_unordered_access_vi
return
hr
;
}
static
void
wined3d_unordered_access_view_vk_cs_init
(
void
*
object
)
{
struct
wined3d_unordered_access_view_vk
*
uav_vk
=
object
;
struct
wined3d_view_vk
*
view_vk
=
&
uav_vk
->
view_vk
;
struct
wined3d_view_desc
*
desc
=
&
uav_vk
->
v
.
desc
;
const
struct
wined3d_format_vk
*
format_vk
;
struct
wined3d_texture_vk
*
texture_vk
;
struct
wined3d_context_vk
*
context_vk
;
struct
wined3d_device_vk
*
device_vk
;
struct
wined3d_resource
*
resource
;
uint32_t
default_flags
=
0
;
VkImageView
vk_image_view
;
resource
=
uav_vk
->
v
.
resource
;
device_vk
=
wined3d_device_vk
(
resource
->
device
);
format_vk
=
wined3d_format_vk
(
uav_vk
->
v
.
format
);
if
(
resource
->
type
==
WINED3D_RTYPE_BUFFER
)
{
FIXME
(
"Buffer views not implemented.
\n
"
);
return
;
}
texture_vk
=
wined3d_texture_vk
(
texture_from_resource
(
resource
));
if
(
texture_vk
->
t
.
layer_count
>
1
)
default_flags
|=
WINED3D_VIEW_TEXTURE_ARRAY
;
if
(
resource
->
format
->
id
==
format_vk
->
f
.
id
&&
desc
->
flags
==
default_flags
&&
!
desc
->
u
.
texture
.
level_idx
&&
desc
->
u
.
texture
.
level_count
==
texture_vk
->
t
.
level_count
&&
!
desc
->
u
.
texture
.
layer_idx
&&
desc
->
u
.
texture
.
layer_count
==
texture_vk
->
t
.
layer_count
&&
!
(
resource
->
bind_flags
&
WINED3D_BIND_DEPTH_STENCIL
)
&&
resource
->
type
!=
WINED3D_RTYPE_TEXTURE_3D
)
{
TRACE
(
"Creating identity unordered access view.
\n
"
);
return
;
}
if
(
texture_vk
->
t
.
swapchain
&&
texture_vk
->
t
.
swapchain
->
state
.
desc
.
backbuffer_count
>
1
)
FIXME
(
"Swapchain unordered access views not supported.
\n
"
);
context_vk
=
wined3d_context_vk
(
context_acquire
(
&
device_vk
->
d
,
NULL
,
0
));
vk_image_view
=
wined3d_view_vk_create_texture_view
(
context_vk
,
desc
,
texture_vk
,
format_vk
,
format_vk
->
f
.
color_fixup
,
false
);
context_release
(
&
context_vk
->
c
);
if
(
!
vk_image_view
)
return
;
TRACE
(
"Created image view 0x%s.
\n
"
,
wine_dbgstr_longlong
(
vk_image_view
));
view_vk
->
u
.
vk_image_info
.
imageView
=
vk_image_view
;
view_vk
->
u
.
vk_image_info
.
sampler
=
VK_NULL_HANDLE
;
view_vk
->
u
.
vk_image_info
.
imageLayout
=
texture_vk
->
layout
;
}
HRESULT
wined3d_unordered_access_view_vk_init
(
struct
wined3d_unordered_access_view_vk
*
view_vk
,
const
struct
wined3d_view_desc
*
desc
,
struct
wined3d_resource
*
resource
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
{
HRESULT
hr
;
TRACE
(
"view_vk %p, desc %s, resource %p, parent %p, parent_ops %p.
\n
"
,
view_vk
,
wined3d_debug_view_desc
(
desc
,
resource
),
resource
,
parent
,
parent_ops
);
return
wined3d_unordered_access_view_init
(
&
view_vk
->
v
,
desc
,
resource
,
parent
,
parent_ops
);
if
(
FAILED
(
hr
=
wined3d_unordered_access_view_init
(
&
view_vk
->
v
,
desc
,
resource
,
parent
,
parent_ops
)))
return
hr
;
wined3d_cs_init_object
(
resource
->
device
->
cs
,
wined3d_unordered_access_view_vk_cs_init
,
view_vk
);
return
hr
;
}
HRESULT
CDECL
wined3d_unordered_access_view_create
(
const
struct
wined3d_view_desc
*
desc
,
...
...
dlls/wined3d/wined3d_private.h
View file @
f45dd543
...
...
@@ -4670,6 +4670,7 @@ HRESULT wined3d_unordered_access_view_gl_init(struct wined3d_unordered_access_vi
struct
wined3d_unordered_access_view_vk
{
struct
wined3d_unordered_access_view
v
;
struct
wined3d_view_vk
view_vk
;
};
static
inline
struct
wined3d_unordered_access_view_vk
*
wined3d_unordered_access_view_vk
(
...
...
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