static void
radv_pipeline_init_multisample_state(struct radv_graphics_pipeline *pipeline,
const struct radv_blend_state *blend,
- const struct radv_graphics_pipeline_info *info)
+ const struct radv_graphics_pipeline_info *info,
+ unsigned rast_prim)
{
const struct radv_physical_device *pdevice = pipeline->base.device->physical_device;
struct radv_multisample_state *ms = &pipeline->ms;
S_028A48_VPORT_SCISSOR_ENABLE(1) |
S_028A48_LINE_STIPPLE_ENABLE(info->rs.stippled_line_enable);
- if (info->rs.line_raster_mode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT) {
- /* From the Vulkan spec 1.1.129:
+ if (info->rs.line_raster_mode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT &&
+ radv_rast_prim_is_line(rast_prim)) {
+ /* From the Vulkan spec 1.3.221:
*
- * "When VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT lines are being rasterized, sample locations
- * may all be treated as being at the pixel center (this may affect attribute and depth
- * interpolation)."
+ * "When Bresenham lines are being rasterized, sample locations may all be treated as being at
+ * the pixel center (this may affect attribute and depth interpolation)."
+ *
+ * "One consequence of this is that Bresenham lines cover the same pixels regardless of the
+ * number of rasterization samples, and cover all samples in those pixels (unless masked out
+ * or killed)."
*/
ms->num_samples = 1;
}
return result;
pipeline->spi_baryc_cntl = S_0286E0_FRONT_FACE_ALL_BITS(1);
- radv_pipeline_init_multisample_state(pipeline, &blend, &info);
+
+ uint32_t vgt_gs_out_prim_type = radv_pipeline_init_vgt_gs_out(pipeline, &info);
+
+ radv_pipeline_init_multisample_state(pipeline, &blend, &info, vgt_gs_out_prim_type);
if (!radv_pipeline_has_stage(pipeline, MESA_SHADER_MESH))
radv_pipeline_init_input_assembly_state(pipeline, &info);
if (!radv_pipeline_has_stage(pipeline, MESA_SHADER_MESH))
radv_pipeline_init_vertex_input_state(pipeline, &info);
- uint32_t vgt_gs_out_prim_type = radv_pipeline_init_vgt_gs_out(pipeline, &info);
-
radv_pipeline_init_binning_state(pipeline, &blend, &info);
radv_pipeline_init_shader_stages_state(pipeline);
radv_pipeline_init_scratch(device, &pipeline->base);
}
static inline bool
+radv_rast_prim_is_point(unsigned rast_prim)
+{
+ return rast_prim == V_028A6C_POINTLIST;
+}
+
+static inline bool
+radv_rast_prim_is_line(unsigned rast_prim)
+{
+ return rast_prim == V_028A6C_LINESTRIP;
+}
+
+static inline bool
radv_rast_prim_is_points_or_lines(unsigned rast_prim)
{
- switch (rast_prim) {
- case V_028A6C_POINTLIST:
- case V_028A6C_LINESTRIP:
- return true;
- case V_028A6C_TRISTRIP:
- case V_028A6C_RECTLIST:
- return false;
- default:
- unreachable("invalid rast prim");
- }
+ return radv_rast_prim_is_point(rast_prim) || radv_rast_prim_is_line(rast_prim);
}
static inline uint32_t