-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Conversation
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.
hw/xbox/nv2a/pgraph.c
Outdated
@@ -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); |
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.
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?
hw/xbox/nv2a/pgraph.c
Outdated
@@ -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 }; |
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.
If my other comment does not apply, then I don't think this needs to be a static global
The commit/PR title should be of the form |
…D_LINE_WIDTH_RANGE to nv2a_gl_context_init(void) so that it's just called while OpenGL is being initialized.
…eWidth in the if and else blocks
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.