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
35b27b4a
Commit
35b27b4a
authored
May 13, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement Vulkan buffer shader resource view descriptors.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd63ec2f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
6 deletions
+51
-6
adapter_vk.c
dlls/wined3d/adapter_vk.c
+1
-0
context_vk.c
dlls/wined3d/context_vk.c
+21
-5
view.c
dlls/wined3d/view.c
+26
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-0
No files found.
dlls/wined3d/adapter_vk.c
View file @
35b27b4a
...
...
@@ -1383,6 +1383,7 @@ static void adapter_vk_destroy_shader_resource_view(struct wined3d_shader_resour
vk_buffer_view
=
&
view_vk
->
u
.
vk_buffer_view
;
else
vk_image_view
=
&
view_vk
->
u
.
vk_image_info
.
imageView
;
list_remove
(
&
view_vk
->
bo_user
.
entry
);
wined3d_shader_resource_view_cleanup
(
&
srv_vk
->
v
);
wined3d_view_vk_destroy
(
device
,
vk_buffer_view
,
vk_image_view
,
NULL
,
NULL
,
&
view_vk
->
command_buffer_id
,
srv_vk
);
...
...
dlls/wined3d/context_vk.c
View file @
35b27b4a
...
...
@@ -1336,6 +1336,7 @@ static bool wined3d_context_vk_update_descriptors(struct wined3d_context_vk *con
VkDescriptorSet
vk_descriptor_set
;
struct
wined3d_view_vk
*
view_vk
;
struct
wined3d_buffer
*
buffer
;
VkBufferView
*
buffer_view
;
VkDescriptorType
type
;
VkResult
vr
;
size_t
i
;
...
...
@@ -1378,8 +1379,9 @@ static bool wined3d_context_vk_update_descriptors(struct wined3d_context_vk *con
view_vk
=
&
wined3d_shader_resource_view_vk
(
srv
)
->
view_vk
;
if
(
resource
->
type
==
WINED3D_RTYPE_BUFFER
)
{
FIXME
(
"Buffer SRV descriptors not implemented.
\n
"
);
return
false
;
image_info
=
NULL
;
buffer_view
=
&
view_vk
->
u
.
vk_buffer_view
;
type
=
VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
;
}
else
{
...
...
@@ -1389,11 +1391,12 @@ static bool wined3d_context_vk_update_descriptors(struct wined3d_context_vk *con
image_info
=
&
view_vk
->
u
.
vk_image_info
;
else
image_info
=
wined3d_texture_vk_get_default_image_info
(
texture_vk
,
context_vk
);
buffer_view
=
NULL
;
type
=
VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
;
}
if
(
!
wined3d_shader_descriptor_writes_vk_add_write
(
writes
,
vk_descriptor_set
,
binding
->
binding_idx
,
type
,
NULL
,
image_info
,
NULL
))
binding
->
binding_idx
,
type
,
NULL
,
image_info
,
buffer_view
))
return
false
;
break
;
...
...
@@ -1500,6 +1503,7 @@ static void wined3d_context_vk_load_shader_resources(struct wined3d_context_vk *
const
struct
wined3d_shader_resource_bindings
*
bindings
=
&
context_vk
->
compute
.
bindings
;
struct
wined3d_shader_descriptor_writes_vk
*
writes
=
&
context_vk
->
descriptor_writes
;
const
struct
wined3d_shader_resource_binding
*
binding
;
struct
wined3d_shader_resource_view_vk
*
srv_vk
;
struct
wined3d_shader_resource_view
*
srv
;
struct
wined3d_buffer_vk
*
buffer_vk
;
struct
wined3d_buffer
*
buffer
;
...
...
@@ -1527,9 +1531,21 @@ static void wined3d_context_vk_load_shader_resources(struct wined3d_context_vk *
if
(
!
(
srv
=
state
->
shader_resource_view
[
binding
->
shader_type
][
binding
->
resource_idx
]))
break
;
if
(
srv
->
resource
->
type
!=
WINED3D_RTYPE_BUFFER
)
srv_vk
=
wined3d_shader_resource_view_vk
(
srv
);
if
(
srv
->
resource
->
type
==
WINED3D_RTYPE_BUFFER
)
{
if
(
!
srv_vk
->
view_vk
.
bo_user
.
valid
)
{
wined3d_shader_resource_view_vk_update
(
srv_vk
,
context_vk
);
context_invalidate_compute_state
(
&
context_vk
->
c
,
STATE_COMPUTE_SHADER_RESOURCE_BINDING
);
}
wined3d_buffer_load
(
buffer_from_resource
(
srv
->
resource
),
&
context_vk
->
c
,
state
);
}
else
{
wined3d_texture_load
(
texture_from_resource
(
srv
->
resource
),
&
context_vk
->
c
,
FALSE
);
wined3d_context_vk_reference_shader_resource_view
(
context_vk
,
wined3d_shader_resource_view_vk
(
srv
));
}
wined3d_context_vk_reference_shader_resource_view
(
context_vk
,
srv_vk
);
break
;
case
WINED3D_SHADER_DESCRIPTOR_TYPE_UAV_COUNTER
:
...
...
dlls/wined3d/view.c
View file @
35b27b4a
...
...
@@ -1011,12 +1011,32 @@ HRESULT wined3d_shader_resource_view_gl_init(struct wined3d_shader_resource_view
return
hr
;
}
void
wined3d_shader_resource_view_vk_update
(
struct
wined3d_shader_resource_view_vk
*
srv_vk
,
struct
wined3d_context_vk
*
context_vk
)
{
const
struct
wined3d_format_vk
*
view_format_vk
=
wined3d_format_vk
(
srv_vk
->
v
.
format
);
const
struct
wined3d_view_desc
*
desc
=
&
srv_vk
->
v
.
desc
;
struct
wined3d_resource
*
resource
=
srv_vk
->
v
.
resource
;
struct
wined3d_view_vk
*
view_vk
=
&
srv_vk
->
view_vk
;
struct
wined3d_buffer_vk
*
buffer_vk
;
VkBufferView
vk_buffer_view
;
buffer_vk
=
wined3d_buffer_vk
(
buffer_from_resource
(
resource
));
wined3d_context_vk_destroy_buffer_view
(
context_vk
,
view_vk
->
u
.
vk_buffer_view
,
view_vk
->
command_buffer_id
);
if
((
vk_buffer_view
=
wined3d_view_vk_create_buffer_view
(
context_vk
,
desc
,
buffer_vk
,
view_format_vk
)))
{
view_vk
->
u
.
vk_buffer_view
=
vk_buffer_view
;
view_vk
->
bo_user
.
valid
=
true
;
}
}
static
void
wined3d_shader_resource_view_vk_cs_init
(
void
*
object
)
{
struct
wined3d_shader_resource_view_vk
*
srv_vk
=
object
;
struct
wined3d_view_desc
*
desc
=
&
srv_vk
->
v
.
desc
;
struct
wined3d_texture_vk
*
texture_vk
;
const
struct
wined3d_format
*
format
;
struct
wined3d_buffer_vk
*
buffer_vk
;
struct
wined3d_resource
*
resource
;
struct
wined3d_context
*
context
;
VkBufferView
vk_buffer_view
;
...
...
@@ -1028,9 +1048,11 @@ static void wined3d_shader_resource_view_vk_cs_init(void *object)
if
(
resource
->
type
==
WINED3D_RTYPE_BUFFER
)
{
buffer_vk
=
wined3d_buffer_vk
(
buffer_from_resource
(
resource
));
context
=
context_acquire
(
resource
->
device
,
NULL
,
0
);
vk_buffer_view
=
wined3d_view_vk_create_buffer_view
(
wined3d_context_vk
(
context
),
desc
,
wined3d_buffer_vk
(
buffer_from_resource
(
resource
))
,
wined3d_format_vk
(
format
));
desc
,
buffer_vk
,
wined3d_format_vk
(
format
));
context_release
(
context
);
if
(
!
vk_buffer_view
)
...
...
@@ -1039,6 +1061,8 @@ static void wined3d_shader_resource_view_vk_cs_init(void *object)
TRACE
(
"Created buffer view 0x%s.
\n
"
,
wine_dbgstr_longlong
(
vk_buffer_view
));
srv_vk
->
view_vk
.
u
.
vk_buffer_view
=
vk_buffer_view
;
srv_vk
->
view_vk
.
bo_user
.
valid
=
true
;
list_add_head
(
&
buffer_vk
->
bo
.
users
,
&
srv_vk
->
view_vk
.
bo_user
.
entry
);
return
;
}
...
...
@@ -1087,6 +1111,7 @@ HRESULT wined3d_shader_resource_view_vk_init(struct wined3d_shader_resource_view
if
(
FAILED
(
hr
=
wined3d_shader_resource_view_init
(
&
view_vk
->
v
,
desc
,
resource
,
parent
,
parent_ops
)))
return
hr
;
list_init
(
&
view_vk
->
view_vk
.
bo_user
.
entry
);
wined3d_cs_init_object
(
resource
->
device
->
cs
,
wined3d_shader_resource_view_vk_cs_init
,
view_vk
);
return
hr
;
...
...
dlls/wined3d/wined3d_private.h
View file @
35b27b4a
...
...
@@ -4698,6 +4698,7 @@ HRESULT wined3d_shader_resource_view_gl_init(struct wined3d_shader_resource_view
struct
wined3d_view_vk
{
struct
wined3d_bo_user_vk
bo_user
;
union
{
VkBufferView
vk_buffer_view
;
...
...
@@ -4721,6 +4722,8 @@ static inline struct wined3d_shader_resource_view_vk *wined3d_shader_resource_vi
HRESULT
wined3d_shader_resource_view_vk_init
(
struct
wined3d_shader_resource_view_vk
*
view_vk
,
const
struct
wined3d_view_desc
*
desc
,
struct
wined3d_resource
*
resource
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
void
wined3d_shader_resource_view_vk_update
(
struct
wined3d_shader_resource_view_vk
*
view_vk
,
struct
wined3d_context_vk
*
context_vk
)
DECLSPEC_HIDDEN
;
struct
wined3d_unordered_access_view
{
...
...
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