Added a check of available physical device features. If the wideLines feature is not supported then the lineWidth is left at 1.0f

This commit is contained in:
specialfred453@gmail.com 2025-03-21 17:20:28 -04:00
parent b3d9c09732
commit a07f0facf0
1 changed files with 10 additions and 3 deletions

View File

@ -810,9 +810,16 @@ static void create_pipeline(PGRAPHState *pg)
// FIXME: Handle in shader?
}
float lineWidth = MIN(r->device_props.limits.lineWidthRange[1],
MAX(r->device_props.limits.lineWidthRange[0],
(float)pg->surface_scale_factor));
VkPhysicalDeviceFeatures available_features;
vkGetPhysicalDeviceFeatures(r->physical_device, &available_features);
float lineWidth = 1.0f;
if(available_features.wideLines == VK_TRUE)
{
lineWidth = MIN(r->device_props.limits.lineWidthRange[1],
MAX(r->device_props.limits.lineWidthRange[0],
(float)pg->surface_scale_factor));
}
VkPipelineRasterizationStateCreateInfo rasterizer = {
.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,