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
4358ddc7
Commit
4358ddc7
authored
May 20, 2020
by
Henri Verbeet
Committed by
Alexandre Julliard
May 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement rasterisation object support for the Vulkan adapter.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4cb110dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
0 deletions
+90
-0
context_vk.c
dlls/wined3d/context_vk.c
+90
-0
No files found.
dlls/wined3d/context_vk.c
View file @
4358ddc7
...
...
@@ -169,6 +169,22 @@ static VkColorComponentFlags vk_colour_write_mask_from_wined3d(uint32_t wined3d_
return
vk_mask
;
}
static
VkCullModeFlags
vk_cull_mode_from_wined3d
(
enum
wined3d_cull
mode
)
{
switch
(
mode
)
{
case
WINED3D_CULL_NONE
:
return
VK_CULL_MODE_NONE
;
case
WINED3D_CULL_FRONT
:
return
VK_CULL_MODE_FRONT_BIT
;
case
WINED3D_CULL_BACK
:
return
VK_CULL_MODE_BACK_BIT
;
default:
FIXME
(
"Unhandled cull mode %#x.
\n
"
,
mode
);
return
VK_CULL_MODE_NONE
;
}
}
void
*
wined3d_allocator_chunk_vk_map
(
struct
wined3d_allocator_chunk_vk
*
chunk_vk
,
struct
wined3d_context_vk
*
context_vk
)
{
...
...
@@ -1487,6 +1503,73 @@ static void wined3d_context_vk_init_graphics_pipeline_key(struct wined3d_context
key
->
pipeline_desc
.
basePipelineIndex
=
-
1
;
}
static
void
wined3d_context_vk_update_rasterisation_state
(
const
struct
wined3d_context_vk
*
context_vk
,
const
struct
wined3d_state
*
state
,
struct
wined3d_graphics_pipeline_key_vk
*
key
)
{
const
struct
wined3d_d3d_info
*
d3d_info
=
context_vk
->
c
.
d3d_info
;
VkPipelineRasterizationStateCreateInfo
*
desc
=
&
key
->
rs_desc
;
const
struct
wined3d_rasterizer_state_desc
*
r
;
float
scale_bias
;
union
{
uint32_t
u32
;
float
f32
;
}
const_bias
;
if
(
!
state
->
rasterizer_state
)
{
desc
->
depthClampEnable
=
VK_FALSE
;
desc
->
cullMode
=
VK_CULL_MODE_BACK_BIT
;
desc
->
frontFace
=
VK_FRONT_FACE_CLOCKWISE
;
desc
->
depthBiasEnable
=
VK_FALSE
;
desc
->
depthBiasConstantFactor
=
0
.
0
f
;
desc
->
depthBiasClamp
=
0
.
0
f
;
desc
->
depthBiasSlopeFactor
=
0
.
0
f
;
return
;
}
r
=
&
state
->
rasterizer_state
->
desc
;
desc
->
depthClampEnable
=
!
r
->
depth_clip
;
desc
->
cullMode
=
vk_cull_mode_from_wined3d
(
r
->
cull_mode
);
desc
->
frontFace
=
r
->
front_ccw
?
VK_FRONT_FACE_COUNTER_CLOCKWISE
:
VK_FRONT_FACE_CLOCKWISE
;
scale_bias
=
r
->
scale_bias
;
const_bias
.
f32
=
r
->
depth_bias
;
if
(
!
scale_bias
&&
!
const_bias
.
f32
)
{
desc
->
depthBiasEnable
=
VK_FALSE
;
desc
->
depthBiasConstantFactor
=
0
.
0
f
;
desc
->
depthBiasClamp
=
0
.
0
f
;
desc
->
depthBiasSlopeFactor
=
0
.
0
f
;
return
;
}
desc
->
depthBiasEnable
=
VK_TRUE
;
if
(
d3d_info
->
wined3d_creation_flags
&
WINED3D_LEGACY_DEPTH_BIAS
)
{
const
struct
wined3d_rendertarget_view
*
dsv
;
if
((
dsv
=
state
->
fb
.
depth_stencil
))
{
desc
->
depthBiasConstantFactor
=
-
(
float
)
const_bias
.
u32
/
dsv
->
format
->
depth_bias_scale
;
desc
->
depthBiasSlopeFactor
=
-
(
float
)
const_bias
.
u32
;
}
else
{
desc
->
depthBiasConstantFactor
=
0
.
0
f
;
desc
->
depthBiasSlopeFactor
=
0
.
0
f
;
}
}
else
{
desc
->
depthBiasConstantFactor
=
const_bias
.
f32
;
desc
->
depthBiasSlopeFactor
=
scale_bias
;
}
desc
->
depthBiasClamp
=
r
->
depth_bias_clamp
;
}
static
void
wined3d_context_vk_update_blend_state
(
const
struct
wined3d_context_vk
*
context_vk
,
const
struct
wined3d_state
*
state
,
struct
wined3d_graphics_pipeline_key_vk
*
key
)
{
...
...
@@ -1658,6 +1741,13 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
update
=
true
;
}
if
(
wined3d_context_is_graphics_state_dirty
(
&
context_vk
->
c
,
STATE_RASTERIZER
))
{
wined3d_context_vk_update_rasterisation_state
(
context_vk
,
state
,
key
);
update
=
true
;
}
if
(
key
->
ms_desc
.
rasterizationSamples
!=
context_vk
->
sample_count
)
{
key
->
ms_desc
.
rasterizationSamples
=
context_vk
->
sample_count
;
...
...
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