Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
3142f1b5
There was an error fetching the commit references. Please try again later.
Commit
3142f1b5
authored
5 years ago
by
ReinUsesLisp
Browse files
Options
Downloads
Patches
Plain Diff
fixed_pipeline_state: Add depth clamp
parent
9c548146
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/video_core/renderer_vulkan/fixed_pipeline_state.cpp
+12
-6
12 additions, 6 deletions
src/video_core/renderer_vulkan/fixed_pipeline_state.cpp
src/video_core/renderer_vulkan/fixed_pipeline_state.h
+6
-4
6 additions, 4 deletions
src/video_core/renderer_vulkan/fixed_pipeline_state.h
with
18 additions
and
10 deletions
src/video_core/renderer_vulkan/fixed_pipeline_state.cpp
+
12
−
6
View file @
3142f1b5
...
...
@@ -109,6 +109,9 @@ constexpr FixedPipelineState::Rasterizer GetRasterizerState(const Maxwell& regs)
const
auto
topology
=
static_cast
<
std
::
size_t
>
(
regs
.
draw
.
topology
.
Value
());
const
bool
depth_bias_enabled
=
enabled_lut
[
PolygonOffsetEnableLUT
[
topology
]];
const
auto
&
clip
=
regs
.
view_volume_clip_control
;
const
bool
depth_clamp_enabled
=
clip
.
depth_clamp_near
==
1
||
clip
.
depth_clamp_far
==
1
;
Maxwell
::
Cull
::
FrontFace
front_face
=
regs
.
cull
.
front_face
;
if
(
regs
.
screen_y_control
.
triangle_rast_flip
!=
0
&&
regs
.
viewport_transform
[
0
].
scale_y
>
0.0
f
)
{
...
...
@@ -119,8 +122,9 @@ constexpr FixedPipelineState::Rasterizer GetRasterizerState(const Maxwell& regs)
}
const
bool
gl_ndc
=
regs
.
depth_mode
==
Maxwell
::
DepthMode
::
MinusOneToOne
;
return
FixedPipelineState
::
Rasterizer
(
regs
.
cull
.
enabled
,
depth_bias_enabled
,
gl_ndc
,
regs
.
cull
.
cull_face
,
front_face
);
return
FixedPipelineState
::
Rasterizer
(
regs
.
cull
.
enabled
,
depth_bias_enabled
,
depth_clamp_enabled
,
gl_ndc
,
regs
.
cull
.
cull_face
,
front_face
);
}
}
// Anonymous namespace
...
...
@@ -222,15 +226,17 @@ bool FixedPipelineState::Tessellation::operator==(const Tessellation& rhs) const
std
::
size_t
FixedPipelineState
::
Rasterizer
::
Hash
()
const
noexcept
{
return
static_cast
<
std
::
size_t
>
(
cull_enable
)
^
(
static_cast
<
std
::
size_t
>
(
depth_bias_enable
)
<<
1
)
^
(
static_cast
<
std
::
size_t
>
(
ndc_minus_one_to_one
)
<<
2
)
^
(
static_cast
<
std
::
size_t
>
(
depth_clamp_enable
)
<<
2
)
^
(
static_cast
<
std
::
size_t
>
(
ndc_minus_one_to_one
)
<<
3
)
^
(
static_cast
<
std
::
size_t
>
(
cull_face
)
<<
24
)
^
(
static_cast
<
std
::
size_t
>
(
front_face
)
<<
48
);
}
bool
FixedPipelineState
::
Rasterizer
::
operator
==
(
const
Rasterizer
&
rhs
)
const
noexcept
{
return
std
::
tie
(
cull_enable
,
depth_bias_enable
,
ndc_minus_one_to_one
,
cull_face
,
front_face
)
==
std
::
tie
(
rhs
.
cull_enable
,
rhs
.
depth_bias_enable
,
rhs
.
ndc_minus_one_to_one
,
rhs
.
cull_face
,
rhs
.
front_face
);
return
std
::
tie
(
cull_enable
,
depth_bias_enable
,
depth_clamp_enable
,
ndc_minus_one_to_one
,
cull_face
,
front_face
)
==
std
::
tie
(
rhs
.
cull_enable
,
rhs
.
depth_bias_enable
,
rhs
.
depth_clamp_enable
,
rhs
.
ndc_minus_one_to_one
,
rhs
.
cull_face
,
rhs
.
front_face
);
}
std
::
size_t
FixedPipelineState
::
DepthStencil
::
Hash
()
const
noexcept
{
...
...
This diff is collapsed.
Click to expand it.
src/video_core/renderer_vulkan/fixed_pipeline_state.h
+
6
−
4
View file @
3142f1b5
...
...
@@ -170,15 +170,17 @@ struct FixedPipelineState {
};
struct
Rasterizer
{
constexpr
Rasterizer
(
bool
cull_enable
,
bool
depth_bias_enable
,
bool
ndc_minus_one_to_one
,
Maxwell
::
Cull
::
CullFace
cull_face
,
Maxwell
::
Cull
::
FrontFace
front_face
)
constexpr
Rasterizer
(
bool
cull_enable
,
bool
depth_bias_enable
,
bool
depth_clamp_enable
,
bool
ndc_minus_one_to_one
,
Maxwell
::
Cull
::
CullFace
cull_face
,
Maxwell
::
Cull
::
FrontFace
front_face
)
:
cull_enable
{
cull_enable
},
depth_bias_enable
{
depth_bias_enable
},
ndc_minus_one_to_one
{
ndc_minus_one_to_one
},
cull_face
{
cull_face
},
front_face
{
front_face
}
{}
depth_clamp_enable
{
depth_clamp_enable
},
ndc_minus_one_to_one
{
ndc_minus_one_to_one
},
cull_face
{
cull_face
},
front_face
{
front_face
}
{}
Rasterizer
()
=
default
;
bool
cull_enable
;
bool
depth_bias_enable
;
bool
depth_clamp_enable
;
bool
ndc_minus_one_to_one
;
Maxwell
::
Cull
::
CullFace
cull_face
;
Maxwell
::
Cull
::
FrontFace
front_face
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment