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: Check for supported line widths before setting the line width #1792

Merged
merged 7 commits into from
Nov 22, 2024

Conversation

faha223
Copy link
Contributor

@faha223 faha223 commented Nov 17, 2024

Added checks to GL_ALIASED_LINE_WIDTH_RANGE and and GL_SMOOTH_LINE_WIDTH_RANGE to ensure that the line width we set is within the supported range. I also moved the glLineWidth call down a few lines so it would be called after we know the supported line width range.

faha223 added 5 commits March 9, 2024 21:14
build: Update arm64 target, handle target/arch independent pkg names
nv2a: Scale line thickness by surface scale factor
…g the line width to avoid errors.

I also moved the glLineWidth call so that it could be after the call to get the supported line width range for the desired line type.
@@ -3062,9 +3063,12 @@ DEF_METHOD(NV097, SET_BEGIN_END)
if (!anti_aliasing && pg->regs[NV_PGRAPH_SETUPRASTER] &
NV_PGRAPH_SETUPRASTER_LINESMOOTHENABLE) {
glEnable(GL_LINE_SMOOTH);
glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, supportedLineWidthRange);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to load both line width ranges into separate arrays once during init and then just select between them based on the above condition?

@@ -381,6 +381,8 @@ static const SurfaceFormatInfo kelvin_surface_zeta_fixed_format_map[] = {
{4, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH_STENCIL_ATTACHMENT},
};

static GLfloat supportedLineWidthRange[2] = { 0.0f, 0.0f };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my other comment does not apply, then I don't think this needs to be a static global

@antangelo
Copy link
Contributor

The commit/PR title should be of the form <subsystem>: One line description of the change (where in this case the subsystem is nv2a)

@faha223 faha223 changed the title Safer wide lines NV2A: Safer wide lines Nov 20, 2024
@faha223 faha223 changed the title NV2A: Safer wide lines NV2A: Check for supported line widths before setting the line width Nov 20, 2024
…D_LINE_WIDTH_RANGE to nv2a_gl_context_init(void) so that it's just called while OpenGL is being initialized.
@mborgerson mborgerson merged commit 7944150 into xemu-project:master Nov 22, 2024
15 checks passed
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.

3 participants