From 7f5176bc5fb7c546871898a8bf5cdaa3632717bf Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Thu, 14 Nov 2024 23:48:22 -0500 Subject: [PATCH 1/4] nv2a: Scale line thickness by surface scale factor --- hw/xbox/nv2a/pgraph.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/xbox/nv2a/pgraph.c b/hw/xbox/nv2a/pgraph.c index 0127371df2..2dbaf0a1a4 100644 --- a/hw/xbox/nv2a/pgraph.c +++ b/hw/xbox/nv2a/pgraph.c @@ -3053,6 +3053,7 @@ DEF_METHOD(NV097, SET_BEGIN_END) glDisable(GL_DITHER); } + glLineWidth(pg->surface_scale_factor); glEnable(GL_PROGRAM_POINT_SIZE); bool anti_aliasing = GET_MASK(pg->regs[NV_PGRAPH_ANTIALIASING], NV_PGRAPH_ANTIALIASING_ENABLE); From 79441500fe8279a4136f8238044dc3b2e1d1d56b Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Fri, 22 Nov 2024 17:49:01 -0500 Subject: [PATCH 2/4] nv2a: Check supported line width * Added logic to check for the supported line width range before setting 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. * Moved the glLineWidth call outside the if/else * Moved the code to query line GL_SMOOTH_LINE_WIDTH_RANGE and GL_ALIASED_LINE_WIDTH_RANGE to nv2a_gl_context_init(void) so that it's just called while OpenGL is being initialized. * Removed the lineWidth local variable. It's simpler to just call glLineWidth in the if and else blocks --- hw/xbox/nv2a/pgraph.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/xbox/nv2a/pgraph.c b/hw/xbox/nv2a/pgraph.c index 2dbaf0a1a4..335c73cc0f 100644 --- a/hw/xbox/nv2a/pgraph.c +++ b/hw/xbox/nv2a/pgraph.c @@ -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 supportedAliasedLineWidthRange[2] = { 0.0f, 0.0f }; +static GLfloat supportedSmoothLineWidthRange[2] = { 0.0f, 0.0f }; // static void pgraph_set_context_user(NV2AState *d, uint32_t val); static void pgraph_gl_fence(void); @@ -3053,7 +3055,6 @@ DEF_METHOD(NV097, SET_BEGIN_END) glDisable(GL_DITHER); } - glLineWidth(pg->surface_scale_factor); glEnable(GL_PROGRAM_POINT_SIZE); bool anti_aliasing = GET_MASK(pg->regs[NV_PGRAPH_ANTIALIASING], NV_PGRAPH_ANTIALIASING_ENABLE); @@ -3062,8 +3063,10 @@ DEF_METHOD(NV097, SET_BEGIN_END) if (!anti_aliasing && pg->regs[NV_PGRAPH_SETUPRASTER] & NV_PGRAPH_SETUPRASTER_LINESMOOTHENABLE) { glEnable(GL_LINE_SMOOTH); + glLineWidth(MIN(supportedSmoothLineWidthRange[1], pg->surface_scale_factor)); } else { glDisable(GL_LINE_SMOOTH); + glLineWidth(MIN(supportedAliasedLineWidthRange[1], pg->surface_scale_factor)); } if (!anti_aliasing && pg->regs[NV_PGRAPH_SETUPRASTER] & NV_PGRAPH_SETUPRASTER_POLYSMOOTHENABLE) { @@ -3910,6 +3913,9 @@ void nv2a_gl_context_init(void) { g_nv2a_context_render = glo_context_create(); g_nv2a_context_display = glo_context_create(); + + glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, supportedSmoothLineWidthRange); + glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, supportedAliasedLineWidthRange); } void nv2a_set_surface_scale_factor(unsigned int scale) From 0308baa4b09b8541ac260c952e082b6414330145 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Fri, 27 Dec 2024 00:47:44 -0700 Subject: [PATCH 3/4] download-macos-libs.py: Skip mesa, llvm --- scripts/download-macos-libs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index dd1f913dd6..e75d886c02 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -92,7 +92,7 @@ class LibInstaller: shell=True, check=True) def is_pkg_skipped(self, pkg_name): - return any(pkg_name.startswith(n) for n in ('python', 'ncurses')) + return any(pkg_name.startswith(n) for n in ('python', 'ncurses', 'mesa', 'llvm')) def install_pkg(self, pkg_name): if self.is_pkg_installed(pkg_name): From 2c08c76b095748eb28a1c26157ddf67e5541ca44 Mon Sep 17 00:00:00 2001 From: antangelo Date: Thu, 26 Dec 2024 22:55:22 -0500 Subject: [PATCH 4/4] .clang-format: Set SortIncludes to Never --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 56804459cb..8750a94dc8 100644 --- a/.clang-format +++ b/.clang-format @@ -82,7 +82,7 @@ MaxEmptyLinesToKeep: 2 #PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right ReflowComments: true -SortIncludes: true +SortIncludes: Never SpaceAfterCStyleCast: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements