if (screen->info.have_EXT_line_rasterization) {
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.lineRasterizationMode = state->rast_state->line_mode;
if (state->rast_state->line_stipple_pattern != UINT16_MAX) {
rast_line_state.stippledLineEnable = VK_TRUE;
!(screen->info.feats12.scalarBlockLayout ||
screen->info.have_EXT_scalar_block_layout) ||
!screen->info.have_KHR_maintenance1 ||
- !screen->info.have_EXT_custom_border_color) {
+ !screen->info.have_EXT_custom_border_color ||
+ !screen->info.have_EXT_line_rasterization ||
+ !screen->info.line_rast_feats.rectangularLines ||
+ !screen->info.line_rast_feats.bresenhamLines ||
+ !screen->info.line_rast_feats.smoothLines ||
+ !screen->info.line_rast_feats.stippledRectangularLines ||
+ !screen->info.line_rast_feats.stippledBresenhamLines ||
+ !screen->info.line_rast_feats.stippledSmoothLines) {
fprintf(stderr, "WARNING: Some incorrect rendering "
"might occur because the selected Vulkan device (%s) doesn't support "
"base Zink requirements: ", screen->info.props.deviceName);
printf("scalarBlockLayout OR EXT_scalar_block_layout ");
CHECK_OR_PRINT(have_KHR_maintenance1);
CHECK_OR_PRINT(have_EXT_custom_border_color);
+ CHECK_OR_PRINT(have_EXT_line_rasterization);
+ if (screen->info.have_EXT_line_rasterization) {
+ CHECK_OR_PRINT(line_rast_feats.rectangularLines);
+ CHECK_OR_PRINT(line_rast_feats.bresenhamLines);
+ CHECK_OR_PRINT(line_rast_feats.smoothLines);
+ CHECK_OR_PRINT(line_rast_feats.stippledRectangularLines);
+ CHECK_OR_PRINT(line_rast_feats.stippledBresenhamLines);
+ CHECK_OR_PRINT(line_rast_feats.stippledSmoothLines);
+ }
fprintf(stderr, "\n");
}
}
VK_FRONT_FACE_COUNTER_CLOCKWISE :
VK_FRONT_FACE_CLOCKWISE;
+ VkPhysicalDeviceLineRasterizationFeaturesEXT *line_feats =
+ &screen->info.line_rast_feats;
+ state->hw_state.line_mode =
+ VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT;
+
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;
+
+ if (screen->info.have_EXT_line_rasterization) {
+ if (rs_state->multisample) {
+ if (line_feats->stippledRectangularLines)
+ state->hw_state.line_mode =
+ VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT;
+ } else if (rs_state->line_smooth) {
+ if (line_feats->stippledRectangularLines)
+ state->hw_state.line_mode =
+ VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
+ } else if (line_feats->stippledBresenhamLines)
+ state->hw_state.line_mode =
+ VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT;
+ else {
+ /* no suitable mode that supports line stippling */
+ state->hw_state.line_stipple_factor = 0;
+ state->hw_state.line_stipple_pattern = UINT16_MAX;
+ }
+ }
} else {
+ if (screen->info.have_EXT_line_rasterization) {
+ if (rs_state->multisample) {
+ if (line_feats->rectangularLines)
+ state->hw_state.line_mode =
+ VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT;
+ } else if (rs_state->line_smooth) {
+ if (line_feats->rectangularLines)
+ state->hw_state.line_mode =
+ VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
+ } else if (line_feats->bresenhamLines)
+ state->hw_state.line_mode =
+ VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT;
+ }
state->hw_state.line_stipple_factor = 0;
state->hw_state.line_stipple_pattern = UINT16_MAX;
}
VkPolygonMode polygon_mode;
VkCullModeFlags cull_mode;
VkProvokingVertexModeEXT pv_mode;
+ VkLineRasterizationModeEXT line_mode;
unsigned depth_clamp : 1;
unsigned rasterizer_discard : 1;
unsigned force_persample_interp : 1;