Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

faha223
Copy link
Contributor

@faha223 faha223 commented Jan 15, 2025

Set LineWidth to SurfaceScaleFactor to match the line width behavior of the OpenGL renderer

@faha223 faha223 changed the title Vulkan line width nv2a: Vulkan line width Jan 19, 2025
@@ -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,
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants