diff --git a/src/intel/vulkan/anv_genX.h b/src/intel/vulkan/anv_genX.h index 4964f64140a..61b92abb495 100644 --- a/src/intel/vulkan/anv_genX.h +++ b/src/intel/vulkan/anv_genX.h @@ -179,13 +179,6 @@ void genX(batch_emit_dummy_post_sync_op)(struct anv_batch *batch, uint32_t primitive_topology, uint32_t vertex_count); -void -genX(rasterization_mode)(VkPolygonMode raster_mode, - VkLineRasterizationModeEXT line_mode, - float line_width, - uint32_t *api_mode, - bool *msaa_rasterization_enable); - VkPolygonMode genX(raster_polygon_mode)(struct anv_graphics_pipeline *pipeline, VkPolygonMode polygon_mode, diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index 1828d5b91e2..016d9b1b81c 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -691,55 +691,6 @@ const uint32_t genX(vk_to_intel_front_face)[] = { [VK_FRONT_FACE_CLOCKWISE] = 0 }; -void -genX(rasterization_mode)(VkPolygonMode raster_mode, - VkLineRasterizationModeEXT line_mode, - float line_width, - uint32_t *api_mode, - bool *msaa_rasterization_enable) -{ - if (raster_mode == VK_POLYGON_MODE_LINE) { - /* Unfortunately, configuring our line rasterization hardware on gfx8 - * and later is rather painful. Instead of giving us bits to tell the - * hardware what line mode to use like we had on gfx7, we now have an - * arcane combination of API Mode and MSAA enable bits which do things - * in a table which are expected to magically put the hardware into the - * right mode for your API. Sadly, Vulkan isn't any of the APIs the - * hardware people thought of so nothing works the way you want it to. - * - * Look at the table titled "Multisample Rasterization Modes" in Vol 7 - * of the Skylake PRM for more details. - */ - switch (line_mode) { - case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT: - *api_mode = DX101; -#if GFX_VER <= 9 - /* Prior to ICL, the algorithm the HW uses to draw wide lines - * doesn't quite match what the CTS expects, at least for rectangular - * lines, so we set this to false here, making it draw parallelograms - * instead, which work well enough. - */ - *msaa_rasterization_enable = line_width < 1.0078125; -#else - *msaa_rasterization_enable = true; -#endif - break; - - case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT: - case VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT: - *api_mode = DX9OGL; - *msaa_rasterization_enable = false; - break; - - default: - unreachable("Unsupported line rasterization mode"); - } - } else { - *api_mode = DX101; - *msaa_rasterization_enable = true; - } -} - static void emit_rs_state(struct anv_graphics_pipeline *pipeline, const struct vk_input_assembly_state *ia, diff --git a/src/intel/vulkan/gfx8_cmd_buffer.c b/src/intel/vulkan/gfx8_cmd_buffer.c index 0b46c37416a..ef4e3859692 100644 --- a/src/intel/vulkan/gfx8_cmd_buffer.c +++ b/src/intel/vulkan/gfx8_cmd_buffer.c @@ -445,6 +445,55 @@ static const uint32_t genX(vk_to_intel_blend_op)[] = { [VK_BLEND_OP_MAX] = BLENDFUNCTION_MAX, }; +static void +genX(rasterization_mode)(VkPolygonMode raster_mode, + VkLineRasterizationModeEXT line_mode, + float line_width, + uint32_t *api_mode, + bool *msaa_rasterization_enable) +{ + if (raster_mode == VK_POLYGON_MODE_LINE) { + /* Unfortunately, configuring our line rasterization hardware on gfx8 + * and later is rather painful. Instead of giving us bits to tell the + * hardware what line mode to use like we had on gfx7, we now have an + * arcane combination of API Mode and MSAA enable bits which do things + * in a table which are expected to magically put the hardware into the + * right mode for your API. Sadly, Vulkan isn't any of the APIs the + * hardware people thought of so nothing works the way you want it to. + * + * Look at the table titled "Multisample Rasterization Modes" in Vol 7 + * of the Skylake PRM for more details. + */ + switch (line_mode) { + case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT: + *api_mode = DX101; +#if GFX_VER <= 9 + /* Prior to ICL, the algorithm the HW uses to draw wide lines + * doesn't quite match what the CTS expects, at least for rectangular + * lines, so we set this to false here, making it draw parallelograms + * instead, which work well enough. + */ + *msaa_rasterization_enable = line_width < 1.0078125; +#else + *msaa_rasterization_enable = true; +#endif + break; + + case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT: + case VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT: + *api_mode = DX9OGL; + *msaa_rasterization_enable = false; + break; + + default: + unreachable("Unsupported line rasterization mode"); + } + } else { + *api_mode = DX101; + *msaa_rasterization_enable = true; + } +} + void genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer) {