-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nv2a: Vulkan line width #1872
base: master
Are you sure you want to change the base?
nv2a: Vulkan line width #1872
Conversation
hw/xbox/nv2a/pgraph/vk/display.c
Outdated
@@ -413,7 +413,7 @@ static void create_display_pipeline(PGRAPHState *pg) | |||
.depthClampEnable = VK_FALSE, | |||
.rasterizerDiscardEnable = VK_FALSE, | |||
.polygonMode = VK_POLYGON_MODE_FILL, | |||
.lineWidth = 1.0f, | |||
.lineWidth = (float)pg->surface_scale_factor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like for GL, before using a value other than 1, we must check that the device supports wideLines and the supported value ranges. Check out VkPhysicalDeviceFeatures/VkPhysicalDeviceLimits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I removed this change as well as the one in create_clear_pipeline in draw.c because it became apparent that these functions aren't being called when surface scale factor changes and that doesn't seem to affect the rendered image.
In the remaining change in create_pipeline in draw.c I've added logic to clamp the line width to a value within the range defined in r->device_props.limits.lineWidthRange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, display and clear pipelines shouldn't be drawing lines. Only draw pipeline needs the line width adjustment
Removed the change from create_clear_pipeline in draw.c because it isn't required. Added logic to create_pipeline in draw.c to use r->device_props.limits.lineWidthRange to constrain the line width to the supported range
Set LineWidth to SurfaceScaleFactor to match the line width behavior of the OpenGL renderer