rast_line_state.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT;
rast_line_state.pNext = rast_state.pNext;
rast_line_state.lineRasterizationMode = VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT;
- rast_line_state.stippledLineEnable = VK_FALSE;
- rast_line_state.lineStippleFactor = 0;
- rast_line_state.lineStipplePattern = 0;
+
+ if (state->rast_state->line_stipple_pattern != UINT16_MAX) {
+ rast_line_state.stippledLineEnable = VK_TRUE;
+ rast_line_state.lineStippleFactor = state->rast_state->line_stipple_factor + 1;
+ rast_line_state.lineStipplePattern = state->rast_state->line_stipple_pattern;
+ } else {
+ rast_line_state.stippledLineEnable = VK_FALSE;
+ rast_line_state.lineStippleFactor = 0;
+ rast_line_state.lineStipplePattern = 0;
+ }
rast_state.pNext = &rast_line_state;
}
VK_FRONT_FACE_COUNTER_CLOCKWISE :
VK_FRONT_FACE_CLOCKWISE;
+ if (rs_state->line_stipple_enable) {
+ state->hw_state.line_stipple_factor = rs_state->line_stipple_factor;
+ state->hw_state.line_stipple_pattern = rs_state->line_stipple_pattern;
+ } else {
+ state->hw_state.line_stipple_factor = 0;
+ state->hw_state.line_stipple_pattern = UINT16_MAX;
+ }
+
state->offset_point = rs_state->offset_point;
state->offset_line = rs_state->offset_line;
state->offset_tri = rs_state->offset_tri;
unsigned depth_clamp : 1;
unsigned rasterizer_discard : 1;
unsigned force_persample_interp : 1;
+ unsigned line_stipple_factor : 8;
+ unsigned line_stipple_pattern : 16;
};
struct zink_rasterizer_state {