Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Erik Faye-Lund
mesa
Commits
179e8745
Commit
179e8745
authored
Sep 03, 2020
by
Louis-Francis Ratté-Boulianne
Committed by
Erik Faye-Lund
Oct 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d12: Only enable depth bias for triangle primitives
parent
3bdfaccf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
+15
-7
No files found.
src/gallium/drivers/d3d12/d3d12_pipeline_state.cpp
View file @
179e8745
...
@@ -126,18 +126,26 @@ fill_so_declaration(const struct pipe_stream_output_info *info,
...
@@ -126,18 +126,26 @@ fill_so_declaration(const struct pipe_stream_output_info *info,
static
bool
static
bool
depth_bias
(
struct
d3d12_rasterizer_state
*
state
,
enum
pipe_prim_type
reduced_prim
)
depth_bias
(
struct
d3d12_rasterizer_state
*
state
,
enum
pipe_prim_type
reduced_prim
)
{
{
switch
(
reduced_prim
)
{
/* glPolygonOffset is supposed to be only enabled when rendering polygons.
case
PIPE_PRIM_POINTS
:
* In d3d12 case, all polygons (and quads) are lowered to triangles */
return
state
->
base
.
offset_point
;
if
(
reduced_prim
!=
PIPE_PRIM_TRIANGLES
)
return
false
;
case
PIPE_PRIM_LINES
:
unsigned
fill_mode
=
state
->
base
.
cull_face
==
PIPE_FACE_FRONT
?
state
->
base
.
fill_back
return
state
->
base
.
offset_line
;
:
state
->
base
.
fill_front
;
case
PIPE_PRIM_TRIANGLES
:
switch
(
fill_mode
)
{
case
PIPE_POLYGON_MODE_FILL
:
return
state
->
base
.
offset_tri
;
return
state
->
base
.
offset_tri
;
case
PIPE_POLYGON_MODE_LINE
:
return
state
->
base
.
offset_line
;
case
PIPE_POLYGON_MODE_POINT
:
return
state
->
base
.
offset_point
;
default:
default:
unreachable
(
"unexpected
reduced prim
"
);
unreachable
(
"unexpected
fill mode
"
);
}
}
}
}
...
...
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