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
9e094def
Commit
9e094def
authored
Jul 02, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Hook up push constants for Vulkan.
parent
f201a609
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
adapter_vk.c
dlls/wined3d/adapter_vk.c
+1
-0
cs.c
dlls/wined3d/cs.c
+26
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/adapter_vk.c
View file @
9e094def
...
...
@@ -2322,6 +2322,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_
d3d_info
->
subpixel_viewport
=
true
;
d3d_info
->
fences
=
true
;
d3d_info
->
persistent_map
=
true
;
d3d_info
->
gpu_push_constants
=
true
;
/* Like GL, Vulkan doesn't explicitly specify a filling convention and only mandates that a
* shared edge of two adjacent triangles generate a fragment for exactly one of the triangles.
...
...
dlls/wined3d/cs.c
View file @
9e094def
...
...
@@ -2144,29 +2144,39 @@ static const struct push_constant_info
size_t
size
;
unsigned
int
max_count
;
DWORD
mask
;
enum
wined3d_shader_type
shader_type
;
enum
vkd3d_shader_d3dbc_constant_register
shader_binding
;
}
wined3d_cs_push_constant_info
[]
=
{
[
WINED3D_PUSH_CONSTANTS_VS_F
]
=
{
sizeof
(
struct
wined3d_vec4
),
WINED3D_MAX_VS_CONSTS_F
,
WINED3D_SHADER_CONST_VS_F
},
[
WINED3D_PUSH_CONSTANTS_PS_F
]
=
{
sizeof
(
struct
wined3d_vec4
),
WINED3D_MAX_PS_CONSTS_F
,
WINED3D_SHADER_CONST_PS_F
},
[
WINED3D_PUSH_CONSTANTS_VS_I
]
=
{
sizeof
(
struct
wined3d_ivec4
),
WINED3D_MAX_CONSTS_I
,
WINED3D_SHADER_CONST_VS_I
},
[
WINED3D_PUSH_CONSTANTS_PS_I
]
=
{
sizeof
(
struct
wined3d_ivec4
),
WINED3D_MAX_CONSTS_I
,
WINED3D_SHADER_CONST_PS_I
},
[
WINED3D_PUSH_CONSTANTS_VS_B
]
=
{
sizeof
(
BOOL
),
WINED3D_MAX_CONSTS_B
,
WINED3D_SHADER_CONST_VS_B
},
[
WINED3D_PUSH_CONSTANTS_PS_B
]
=
{
sizeof
(
BOOL
),
WINED3D_MAX_CONSTS_B
,
WINED3D_SHADER_CONST_PS_B
},
[
WINED3D_PUSH_CONSTANTS_VS_F
]
=
{
sizeof
(
struct
wined3d_vec4
),
WINED3D_MAX_VS_CONSTS_F
,
WINED3D_SHADER_CONST_VS_F
,
WINED3D_SHADER_TYPE_VERTEX
,
VKD3D_SHADER_D3DBC_FLOAT_CONSTANT_REGISTER
},
[
WINED3D_PUSH_CONSTANTS_PS_F
]
=
{
sizeof
(
struct
wined3d_vec4
),
WINED3D_MAX_PS_CONSTS_F
,
WINED3D_SHADER_CONST_PS_F
,
WINED3D_SHADER_TYPE_PIXEL
,
VKD3D_SHADER_D3DBC_FLOAT_CONSTANT_REGISTER
},
[
WINED3D_PUSH_CONSTANTS_VS_I
]
=
{
sizeof
(
struct
wined3d_ivec4
),
WINED3D_MAX_CONSTS_I
,
WINED3D_SHADER_CONST_VS_I
,
WINED3D_SHADER_TYPE_VERTEX
,
VKD3D_SHADER_D3DBC_INT_CONSTANT_REGISTER
},
[
WINED3D_PUSH_CONSTANTS_PS_I
]
=
{
sizeof
(
struct
wined3d_ivec4
),
WINED3D_MAX_CONSTS_I
,
WINED3D_SHADER_CONST_PS_I
,
WINED3D_SHADER_TYPE_PIXEL
,
VKD3D_SHADER_D3DBC_INT_CONSTANT_REGISTER
},
[
WINED3D_PUSH_CONSTANTS_VS_B
]
=
{
sizeof
(
BOOL
),
WINED3D_MAX_CONSTS_B
,
WINED3D_SHADER_CONST_VS_B
,
WINED3D_SHADER_TYPE_VERTEX
,
VKD3D_SHADER_D3DBC_BOOL_CONSTANT_REGISTER
},
[
WINED3D_PUSH_CONSTANTS_PS_B
]
=
{
sizeof
(
BOOL
),
WINED3D_MAX_CONSTS_B
,
WINED3D_SHADER_CONST_PS_B
,
WINED3D_SHADER_TYPE_PIXEL
,
VKD3D_SHADER_D3DBC_BOOL_CONSTANT_REGISTER
},
};
static
bool
prepare_push_constant_buffer
(
struct
wined3d_device
*
device
,
enum
wined3d_push_constants
type
)
static
bool
prepare_push_constant_buffer
(
struct
wined3d_device
_context
*
context
,
enum
wined3d_push_constants
type
)
{
const
struct
push_constant_info
*
info
=
&
wined3d_cs_push_constant_info
[
type
];
struct
wined3d_device
*
device
=
context
->
device
;
bool
gpu
=
device
->
adapter
->
d3d_info
.
gpu_push_constants
;
HRESULT
hr
;
const
struct
wined3d_buffer_desc
desc
=
struct
wined3d_buffer_desc
desc
=
{
.
byte_width
=
info
->
max_count
*
info
->
size
,
.
bind_flags
=
0
,
.
access
=
WINED3D_RESOURCE_ACCESS_CPU
|
WINED3D_RESOURCE_ACCESS_MAP_R
|
WINED3D_RESOURCE_ACCESS_MAP_W
,
};
if
(
gpu
)
{
desc
.
bind_flags
=
WINED3D_BIND_CONSTANT_BUFFER
;
desc
.
access
=
WINED3D_RESOURCE_ACCESS_GPU
;
}
if
(
!
device
->
push_constants
[
type
]
&&
FAILED
(
hr
=
wined3d_buffer_create
(
device
,
&
desc
,
NULL
,
NULL
,
&
wined3d_null_parent_ops
,
&
device
->
push_constants
[
type
])))
{
...
...
@@ -2174,6 +2184,13 @@ static bool prepare_push_constant_buffer(struct wined3d_device *device, enum win
return
false
;
}
if
(
gpu
)
{
struct
wined3d_constant_buffer_state
state
=
{.
buffer
=
device
->
push_constants
[
type
],
.
size
=
desc
.
byte_width
};
wined3d_device_context_emit_set_constant_buffers
(
context
,
info
->
shader_type
,
info
->
shader_binding
,
1
,
&
state
);
}
return
true
;
}
...
...
@@ -2219,7 +2236,7 @@ void wined3d_device_context_push_constants(struct wined3d_device_context *contex
unsigned
int
byte_size
=
count
*
info
->
size
;
struct
wined3d_box
box
;
if
(
!
prepare_push_constant_buffer
(
context
->
device
,
type
))
if
(
!
prepare_push_constant_buffer
(
context
,
type
))
return
;
wined3d_box_set
(
&
box
,
byte_offset
,
0
,
byte_offset
+
byte_size
,
1
,
0
,
1
);
...
...
dlls/wined3d/wined3d_private.h
View file @
9e094def
...
...
@@ -236,6 +236,7 @@ struct wined3d_d3d_info
uint32_t
subpixel_viewport
:
1
;
uint32_t
fences
:
1
;
uint32_t
persistent_map
:
1
;
uint32_t
gpu_push_constants
:
1
;
enum
wined3d_feature_level
feature_level
;
DWORD
multisample_draw_location
;
...
...
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