From 1893b56c3862cfc68a7a6a3f06dd878d855f6745 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Wed, 19 Mar 2025 02:02:32 -0700 Subject: [PATCH 1/4] nv2a/vk: Fix vertex ram buffer dirty bit check --- hw/xbox/nv2a/pgraph/vk/vertex.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/vk/vertex.c b/hw/xbox/nv2a/pgraph/vk/vertex.c index b7bf97b38a..60154cf0d1 100644 --- a/hw/xbox/nv2a/pgraph/vk/vertex.c +++ b/hw/xbox/nv2a/pgraph/vk/vertex.c @@ -49,9 +49,12 @@ void pgraph_vk_update_vertex_ram_buffer(PGRAPHState *pg, hwaddr offset, pgraph_vk_download_surfaces_in_range_if_dirty(pg, offset, size); - size_t offset_bit = offset / 4096; - size_t nbits = size / 4096; - if (find_next_bit(r->uploaded_bitmap, nbits, offset_bit) < nbits) { + size_t start_bit = offset / TARGET_PAGE_SIZE; + size_t end_bit = TARGET_PAGE_ALIGN(offset + size) / TARGET_PAGE_SIZE; + size_t nbits = end_bit - start_bit; + + if (find_next_bit(r->uploaded_bitmap, start_bit + nbits, start_bit) < + end_bit) { // Vertex data changed while building the draw list. Finish drawing // before updating RAM buffer. pgraph_vk_finish(pg, VK_FINISH_REASON_VERTEX_BUFFER_DIRTY); @@ -60,7 +63,7 @@ void pgraph_vk_update_vertex_ram_buffer(PGRAPHState *pg, hwaddr offset, nv2a_profile_inc_counter(NV2A_PROF_GEOM_BUFFER_UPDATE_1); memcpy(r->storage_buffers[BUFFER_VERTEX_RAM].mapped + offset, data, size); - bitmap_set(r->uploaded_bitmap, offset_bit, nbits); + bitmap_set(r->uploaded_bitmap, start_bit, nbits); } static void update_memory_buffer(NV2AState *d, hwaddr addr, hwaddr size) From 1eced78a076015441597cc400f0fb3a83ef7895f Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sat, 22 Mar 2025 14:30:47 -0700 Subject: [PATCH 2/4] meson: Migrate epoxy probe to meson.build --- configure | 15 --------------- meson.build | 5 +++-- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/configure b/configure index c660bcfbe4..61a8f2bebb 100755 --- a/configure +++ b/configure @@ -1191,17 +1191,6 @@ EOF fi fi -########################################## -# epoxy probe - -if $pkg_config --libs --silence-errors epoxy > /dev/null 2>&1 ; then - epoxy_libs=$($pkg_config --libs --silence-errors epoxy) - epoxy_cflags=$($pkg_config --cflags --silence-errors epoxy) -else - error_exit "epoxy not present." \ - "Please install the epoxy devel package." -fi - ########################################## # detect rust triple @@ -1807,10 +1796,6 @@ if test "$default_targets" = "yes"; then echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak fi -# FIXME: Use meson -echo "EPOXY_CFLAGS=$epoxy_cflags" >> $config_host_mak -echo "EPOXY_LIBS=$epoxy_libs" >> $config_host_mak - # tests/tcg configuration mkdir -p tests/tcg echo "# Automatically generated by configure - do not modify" > tests/tcg/$config_host_mak diff --git a/meson.build b/meson.build index a819ef25ad..72e7049e02 100644 --- a/meson.build +++ b/meson.build @@ -1774,6 +1774,8 @@ if not get_option('coreaudio').auto() or (host_os == 'darwin' and have_system) required: get_option('coreaudio')) endif +epoxy = dependency('epoxy', required: true) + opengl = not_found if not get_option('opengl').auto() or have_system or have_vhost_user_gpu # FIXME: Use meson's 'gl' dep @@ -1787,8 +1789,7 @@ if not get_option('opengl').auto() or have_system or have_vhost_user_gpu error('Unknown GL platform') endif - opengl = declare_dependency(compile_args: config_host['EPOXY_CFLAGS'].split(), - link_args: config_host['EPOXY_LIBS'].split() + opengl_libs) + opengl = declare_dependency(link_args: opengl_libs, dependencies: epoxy) endif gbm = not_found From 708445a8dd7e0e3a20cb03d28d1674cad97aad78 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sat, 22 Mar 2025 14:43:16 -0700 Subject: [PATCH 3/4] scripts/download-macos-libs.py: Patch out epoxy.pc Requires.private --- scripts/download-macos-libs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index c58703db72..15baa7543b 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -149,7 +149,9 @@ class LibInstaller: if pkg_name.startswith('openssl'): # FIXME new_prefix = f'prefix={self._extract_path}/opt/local/libexec/openssl11\n' lines[i] = new_prefix - break + elif l.strip().startswith('Requires.private:'): + if pkg_name.startswith('libepoxy'): + lines[i] = '' with open(extracted_path, 'w') as f: f.write(''.join(lines)) From 9e58abc95184320d830c3c11628b0d9605614abb Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sat, 22 Mar 2025 15:11:39 -0700 Subject: [PATCH 4/4] ci: Drop macOS ninja install to stop 'already installed' warning --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b34d6f431..0ef3537790 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -315,8 +315,7 @@ jobs: brew install \ ccache \ coreutils \ - dylibbundler \ - ninja + dylibbundler pip install pyyaml requests - name: Initialize compiler, library cache id: cache