Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
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
d3d12: Only enable depth bias for triangle primitives
parent
3bdfaccf
Changes
1
Show whitespace changes
Inline
Side-by-side
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,
static
bool
depth_bias
(
struct
d3d12_rasterizer_state
*
state
,
enum
pipe_prim_type
reduced_prim
)
{
switch
(
reduced_prim
)
{
case
PIPE_PRIM_POINTS
:
return
state
->
base
.
offset_point
;
/* glPolygonOffset is supposed to be only enabled when rendering polygons.
* In d3d12 case, all polygons (and quads) are lowered to triangles */
if
(
reduced_prim
!=
PIPE_PRIM_TRIANGLES
)
return
false
;
case
PIPE_PRIM_LINES
:
return
state
->
base
.
offset_line
;
unsigned
fill_mode
=
state
->
base
.
cull_face
==
PIPE_FACE_FRONT
?
state
->
base
.
fill_back
:
state
->
base
.
fill_front
;
case
PIPE_PRIM_TRIANGLES
:
switch
(
fill_mode
)
{
case
PIPE_POLYGON_MODE_FILL
:
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:
unreachable
(
"unexpected
reduced prim
"
);
unreachable
(
"unexpected
fill mode
"
);
}
}
...
...
Write
Preview
Supports
Markdown
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