mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-31 14:53:36 +00:00
fix(vulkan): add fallback for unsupported line rasterization modes
- Check for rectangularLines and smoothLines feature support - Fall back to VK_LINE_RASTERIZATION_MODE_DEFAULT when unavailable - Fixes validation errors on GPUs without rectangular line support
This commit is contained in:
@@ -690,12 +690,17 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
|
||||
.depthBiasSlopeFactor = 0.0f,
|
||||
.lineWidth = 1.0f,
|
||||
};
|
||||
// Determine line rasterization mode based on available features
|
||||
VkLineRasterizationModeEXT line_mode = VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT;
|
||||
if (key.state.smooth_lines != 0 && device.IsSmoothLinesSupported()) {
|
||||
line_mode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
|
||||
} else if (device.IsRectangularLinesSupported()) {
|
||||
line_mode = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT;
|
||||
}
|
||||
VkPipelineRasterizationLineStateCreateInfoEXT line_state{
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT,
|
||||
.pNext = nullptr,
|
||||
.lineRasterizationMode = key.state.smooth_lines != 0
|
||||
? VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT
|
||||
: VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT,
|
||||
.lineRasterizationMode = line_mode,
|
||||
.stippledLineEnable = VK_FALSE, // TODO
|
||||
.lineStippleFactor = 0,
|
||||
.lineStipplePattern = 0,
|
||||
|
||||
Reference in New Issue
Block a user