From 02659dd3cc945d6e2dd9ead46fa89f567e3bc126 Mon Sep 17 00:00:00 2001 From: coldhex Date: Sat, 15 Mar 2025 12:45:20 +0200 Subject: [PATCH 1/8] nv2a: Fix cubemap fourth texture coordinate component handling Xbox hardware ignores fourth texture coordinate component for cubemaps. --- hw/xbox/nv2a/pgraph/glsl/psh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/glsl/psh.c b/hw/xbox/nv2a/pgraph/glsl/psh.c index a664281f09..e3a566a347 100644 --- a/hw/xbox/nv2a/pgraph/glsl/psh.c +++ b/hw/xbox/nv2a/pgraph/glsl/psh.c @@ -984,8 +984,8 @@ static MString* psh_convert(struct PixelShader *ps) } break; case PS_TEXTUREMODES_CUBEMAP: - mstring_append_fmt(vars, "vec4 t%d = texture(texSamp%d, pT%d.xyz / pT%d.w);\n", - i, i, i, i); + mstring_append_fmt(vars, "vec4 t%d = texture(texSamp%d, pT%d.xyz);\n", + i, i, i); break; case PS_TEXTUREMODES_PASSTHRU: assert(ps->state.border_logical_size[i][0] == 0.0f && "Unexpected border texture on passthru"); From c782b1e8ed696a105564de7b65112c042958a968 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 17 Mar 2025 13:27:01 -0700 Subject: [PATCH 2/8] scripts/download-macos-libs.py: Set mirror to main packages.macports.org --- scripts/download-macos-libs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 3967f75385..8b0ec60394 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -10,8 +10,7 @@ import os.path from tarfile import TarFile import subprocess -# MIRROR = 'http://packages.macports.org/macports/packages' -MIRROR = 'http://nue.de.packages.macports.org/macports/packages' +MIRROR = 'https://packages.macports.org' # FIXME: Inline macports key # FIXME: Move packages to archive directory to track used vs unused From 68770159412bcaf87190099a2afe94897bd9f6f8 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 17 Mar 2025 13:27:42 -0700 Subject: [PATCH 3/8] scripts/download-macos-libs.py: Bump arm64 to macOS 13.x (darwin 22) --- 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 8b0ec60394..c58703db72 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -18,7 +18,7 @@ MIRROR = 'https://packages.macports.org' class LibInstaller: DARWIN_TARGET_X64="darwin_17" # macOS 10.13 - DARWIN_TARGET_ARM64="darwin_21" # macOS 12.x + DARWIN_TARGET_ARM64="darwin_22" # macOS 13.x def __init__(self, arch): self._queue = [] From b455d582271e428953c2df41a17f61df951e01c8 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 17 Mar 2025 13:28:05 -0700 Subject: [PATCH 4/8] build.sh: Bump macOS on arm64 to 13.7.4 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 25190dccfe..d84b67ee4b 100755 --- a/build.sh +++ b/build.sh @@ -196,7 +196,7 @@ case "$platform" in # Adjust compilation options based on platform Darwin) echo "Compiling for MacOS for $target_arch..." if [ "$target_arch" == "arm64" ]; then - macos_min_ver=12.7.5 + macos_min_ver=13.7.4 elif [ "$target_arch" == "x86_64" ]; then macos_min_ver=12.7.5 else From 860bccb7220ae8a77fd5c0f68e6db5c061b48425 Mon Sep 17 00:00:00 2001 From: Logan Stromberg Date: Mon, 17 Mar 2025 14:32:40 -0700 Subject: [PATCH 5/8] nv2a: Fix surface clip to scissor origin --- hw/xbox/nv2a/pgraph/gl/draw.c | 4 ++-- hw/xbox/nv2a/pgraph/vk/draw.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/gl/draw.c b/hw/xbox/nv2a/pgraph/gl/draw.c index af87c41e28..d9a0d4f91b 100644 --- a/hw/xbox/nv2a/pgraph/gl/draw.c +++ b/hw/xbox/nv2a/pgraph/gl/draw.c @@ -332,8 +332,8 @@ void pgraph_gl_draw_begin(NV2AState *d) /* Surface clip */ /* FIXME: Consider moving to PSH w/ window clip */ - unsigned int xmin = pg->surface_shape.clip_x - pg->surface_binding_dim.clip_x, - ymin = pg->surface_shape.clip_y - pg->surface_binding_dim.clip_y; + unsigned int xmin = pg->surface_shape.clip_x, + ymin = pg->surface_shape.clip_y; unsigned int xmax = xmin + pg->surface_shape.clip_width - 1, ymax = ymin + pg->surface_shape.clip_height - 1; diff --git a/hw/xbox/nv2a/pgraph/vk/draw.c b/hw/xbox/nv2a/pgraph/vk/draw.c index f34b6aa094..8327f9c529 100644 --- a/hw/xbox/nv2a/pgraph/vk/draw.c +++ b/hw/xbox/nv2a/pgraph/vk/draw.c @@ -1472,10 +1472,8 @@ static void begin_draw(PGRAPHState *pg) /* Surface clip */ /* FIXME: Consider moving to PSH w/ window clip */ - unsigned int xmin = pg->surface_shape.clip_x - - pg->surface_binding_dim.clip_x, - ymin = pg->surface_shape.clip_y - - pg->surface_binding_dim.clip_y; + unsigned int xmin = pg->surface_shape.clip_x, + ymin = pg->surface_shape.clip_y; unsigned int xmax = xmin + pg->surface_shape.clip_width - 1, ymax = ymin + pg->surface_shape.clip_height - 1; From c3a8b9569f616c4c0a89b265fd5ff25c04e565b2 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 17 Mar 2025 14:25:46 -0700 Subject: [PATCH 6/8] nv2a: Simplify surface clip to scissor size calculation --- hw/xbox/nv2a/pgraph/gl/draw.c | 7 +++---- hw/xbox/nv2a/pgraph/vk/draw.c | 7 ++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/gl/draw.c b/hw/xbox/nv2a/pgraph/gl/draw.c index d9a0d4f91b..bfa92662e7 100644 --- a/hw/xbox/nv2a/pgraph/gl/draw.c +++ b/hw/xbox/nv2a/pgraph/gl/draw.c @@ -334,11 +334,10 @@ void pgraph_gl_draw_begin(NV2AState *d) /* FIXME: Consider moving to PSH w/ window clip */ unsigned int xmin = pg->surface_shape.clip_x, ymin = pg->surface_shape.clip_y; - unsigned int xmax = xmin + pg->surface_shape.clip_width - 1, - ymax = ymin + pg->surface_shape.clip_height - 1; - unsigned int scissor_width = xmax - xmin + 1, - scissor_height = ymax - ymin + 1; + unsigned int scissor_width = pg->surface_shape.clip_width, + scissor_height = pg->surface_shape.clip_height; + pgraph_apply_anti_aliasing_factor(pg, &xmin, &ymin); pgraph_apply_anti_aliasing_factor(pg, &scissor_width, &scissor_height); ymin = pg->surface_binding_dim.height - (ymin + scissor_height); diff --git a/hw/xbox/nv2a/pgraph/vk/draw.c b/hw/xbox/nv2a/pgraph/vk/draw.c index 8327f9c529..c082c5cfb4 100644 --- a/hw/xbox/nv2a/pgraph/vk/draw.c +++ b/hw/xbox/nv2a/pgraph/vk/draw.c @@ -1475,11 +1475,8 @@ static void begin_draw(PGRAPHState *pg) unsigned int xmin = pg->surface_shape.clip_x, ymin = pg->surface_shape.clip_y; - unsigned int xmax = xmin + pg->surface_shape.clip_width - 1, - ymax = ymin + pg->surface_shape.clip_height - 1; - - unsigned int scissor_width = xmax - xmin + 1, - scissor_height = ymax - ymin + 1; + unsigned int scissor_width = pg->surface_shape.clip_width, + scissor_height = pg->surface_shape.clip_height; pgraph_apply_anti_aliasing_factor(pg, &xmin, &ymin); pgraph_apply_anti_aliasing_factor(pg, &scissor_width, &scissor_height); From b929d4eced623d7c377339e4daa9896ec22a0781 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Thu, 13 Mar 2025 21:11:59 -0700 Subject: [PATCH 7/8] nv2a: Drop surface compat clip constraint --- hw/xbox/nv2a/pgraph/gl/surface.c | 4 +--- hw/xbox/nv2a/pgraph/vk/surface.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/gl/surface.c b/hw/xbox/nv2a/pgraph/gl/surface.c index cd6dd145ca..53df185130 100644 --- a/hw/xbox/nv2a/pgraph/gl/surface.c +++ b/hw/xbox/nv2a/pgraph/gl/surface.c @@ -582,9 +582,7 @@ static bool check_surface_compatibility(SurfaceBinding *s1, SurfaceBinding *s2, (s1->color == s2->color) && (s1->fmt.gl_attachment == s2->fmt.gl_attachment) && (s1->fmt.gl_internal_format == s2->fmt.gl_internal_format) && - (s1->pitch == s2->pitch) && - (s1->shape.clip_x <= s2->shape.clip_x) && - (s1->shape.clip_y <= s2->shape.clip_y); + (s1->pitch == s2->pitch); if (!format_compatible) { return false; } diff --git a/hw/xbox/nv2a/pgraph/vk/surface.c b/hw/xbox/nv2a/pgraph/vk/surface.c index 2ce4f84695..5636ecb4b8 100644 --- a/hw/xbox/nv2a/pgraph/vk/surface.c +++ b/hw/xbox/nv2a/pgraph/vk/surface.c @@ -890,9 +890,7 @@ static bool check_surface_compatibility(SurfaceBinding const *s1, bool format_compatible = (s1->color == s2->color) && (s1->host_fmt.vk_format == s2->host_fmt.vk_format) && - (s1->pitch == s2->pitch) && - (s1->shape.clip_x <= s2->shape.clip_x) && - (s1->shape.clip_y <= s2->shape.clip_y); + (s1->pitch == s2->pitch); if (!format_compatible) { return false; } From d2bf1c21eea1630348215a896f9eb6e843d6ebec Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 17 Mar 2025 14:57:30 -0700 Subject: [PATCH 8/8] debian: Add python3-venv build dep --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 45550f165e..eb495ec081 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Build-Depends: debhelper (>= 11), git, python3:any, python3-yaml, + python3-venv, ninja-build, libgtk-3-dev, libepoxy-dev,