From 7fe40a37ef396f0a39cca196cea91d3e4e655e0d Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Thu, 12 Mar 2026 14:15:07 -0400 Subject: [PATCH] [vulkan] Removed bresenham line mode for driver issues + adjusted LineLoop to LineStrip handling --- .../renderer_vulkan/vk_graphics_pipeline.cpp | 8 ------ .../renderer_vulkan/vk_query_cache.cpp | 2 +- .../renderer_vulkan/vk_rasterizer.cpp | 27 ------------------- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index bdf8692e42..9a4e7cfeb9 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -757,8 +757,6 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { IsLine(input_assembly_topology) && any_stippled_lines_supported; const bool supports_rectangular_lines = line_rasterization_supported && device.SupportsRectangularLines(); - const bool supports_bresenham_lines = - line_rasterization_supported && device.SupportsBresenhamLines(); const bool supports_smooth_lines = line_rasterization_supported && device.SupportsSmoothLines(); VkLineRasterizationModeEXT line_rasterization_mode = VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT; @@ -768,14 +766,10 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { line_rasterization_mode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT; } else if (supports_rectangular_lines) { line_rasterization_mode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT; - } else if (supports_bresenham_lines) { - line_rasterization_mode = VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT; } } else { if (supports_rectangular_lines) { line_rasterization_mode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT; - } else if (supports_bresenham_lines) { - line_rasterization_mode = VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT; } else if (supports_smooth_lines) { line_rasterization_mode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT; } @@ -789,8 +783,6 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { switch (line_rasterization_mode) { case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT: return device.SupportsStippledRectangularLines(); - case VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT: - return device.SupportsStippledBresenhamLines(); case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT: return device.SupportsStippledSmoothLines(); default: diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 2909120025..d8073b5447 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -1518,7 +1518,7 @@ bool QueryCacheRuntime::HostConditionalRenderingCompareValues(VideoCommon::Looku if (driver_blocks_pair_resolve || !is_gpu_high) { EndHostConditionalRendering(); - return false; + return true; } if (!is_in_bc[0] && !is_in_bc[1]) { diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index dde89f5574..7c87ceb623 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -237,7 +237,6 @@ bool IsLineRasterizationTopology(const Device& device, Maxwell::PrimitiveTopolog VkLineRasterizationModeEXT SelectLineRasterizationMode(const Device& device, bool smooth_lines) { const bool supports_rectangular_lines = device.SupportsRectangularLines(); - const bool supports_bresenham_lines = device.SupportsBresenhamLines(); const bool supports_smooth_lines = device.SupportsSmoothLines(); if (smooth_lines) { @@ -247,16 +246,10 @@ VkLineRasterizationModeEXT SelectLineRasterizationMode(const Device& device, boo if (supports_rectangular_lines) { return VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT; } - if (supports_bresenham_lines) { - return VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT; - } } else { if (supports_rectangular_lines) { return VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT; } - if (supports_bresenham_lines) { - return VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT; - } if (supports_smooth_lines) { return VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT; } @@ -269,8 +262,6 @@ bool SupportsStippleForMode(const Device& device, VkLineRasterizationModeEXT mod switch (mode) { case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT: return device.SupportsStippledRectangularLines(); - case VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT: - return device.SupportsStippledBresenhamLines(); case VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT: return device.SupportsStippledSmoothLines(); default: @@ -403,15 +394,9 @@ void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) { if (maxwell3d->regs.transform_feedback_enabled != 0) { query_cache.CounterEnable(VideoCommon::QueryType::StreamingByteCount, false); } - scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.SetPrimitiveTopologyEXT(VK_PRIMITIVE_TOPOLOGY_LINE_LIST); - }); DrawLineLoopClosure(draw_state, draw_params.base_instance, draw_params.num_instances, static_cast(draw_params.base_vertex), draw_params.num_vertices, draw_params.is_indexed); - scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.SetPrimitiveTopologyEXT(VK_PRIMITIVE_TOPOLOGY_LINE_STRIP); - }); } }); } @@ -590,9 +575,6 @@ void RasterizerVulkan::DrawIndirectLineLoopClosures( if (maxwell3d->regs.transform_feedback_enabled != 0) { query_cache.CounterEnable(VideoCommon::QueryType::StreamingByteCount, false); } - scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.SetPrimitiveTopologyEXT(VK_PRIMITIVE_TOPOLOGY_LINE_LIST); - }); emitted_closure = true; } @@ -622,9 +604,6 @@ void RasterizerVulkan::DrawIndirectLineLoopClosures( if (maxwell3d->regs.transform_feedback_enabled != 0) { query_cache.CounterEnable(VideoCommon::QueryType::StreamingByteCount, false); } - scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.SetPrimitiveTopologyEXT(VK_PRIMITIVE_TOPOLOGY_LINE_LIST); - }); emitted_closure = true; } DrawLineLoopClosure(draw_state, command.firstInstance, command.instanceCount, @@ -632,12 +611,6 @@ void RasterizerVulkan::DrawIndirectLineLoopClosures( false); } } - - if (emitted_closure) { - scheduler.Record([](vk::CommandBuffer cmdbuf) { - cmdbuf.SetPrimitiveTopologyEXT(VK_PRIMITIVE_TOPOLOGY_LINE_STRIP); - }); - } } void RasterizerVulkan::DrawTexture() {