diff --git a/core/libs/prx/libSceAgcDriver/tests/execution/NativeDepthBdaClear.cpp b/core/libs/prx/libSceAgcDriver/tests/execution/NativeDepthBdaClear.cpp index a1ecc911ef..dacdaaaa55 100644 --- a/core/libs/prx/libSceAgcDriver/tests/execution/NativeDepthBdaClear.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/execution/NativeDepthBdaClear.cpp @@ -54,6 +54,7 @@ constexpr std::size_t BlockBytes = 1048576; struct SharedBacking { int file; std::uint64_t offset; + std::size_t resolverReturns = 0; }; std::map sharedBlocks; @@ -66,7 +67,9 @@ bool ResolveSharedBlock(std::uintptr_t address, std::size_t bytes, int* file, st if (lead >= BlockBytes || bytes > BlockBytes - lead) return false; *file = fcntl(entry->second.file, F_DUPFD_CLOEXEC, 0); *offset = entry->second.offset + lead; - return *file >= 0; + if (*file < 0) return false; + ++entry->second.resolverReturns; + return true; } struct SharedBackingScope { @@ -136,6 +139,9 @@ public: std::uint64_t Address() const { return reinterpret_cast(block); } const std::uint8_t* Data() const { return block; } void FillWith(std::uint8_t value) const { std::memset(block, value, BlockBytes); } +#ifdef __linux__ + std::size_t SharedBackingResolverReturns() const { return sharedBlocks.at(Address()).resolverReturns; } +#endif private: std::uint8_t* block = nullptr; @@ -181,8 +187,14 @@ int RunNativeClear(AgcDriver::VulkanDevice& device, ClearConsumer consumer) { device.Dispatch(compile(), groups, 1u, 1u, {}, reinterpret_cast(code.data())); device.WaitIdle(); Require(std::all_of(metadata.Data(), metadata.Data() + BlockBytes, [](auto value) { return value == 0u; }), "the warm-up native clear did not retain zero metadata"); - if (!Memory::Watched(depth.Address(), BlockBytes) || !Memory::Watched(metadata.Address(), BlockBytes)) { - std::puts("skipped, the device does not retain guest write watching for native clear imports"); + const bool depthWatched = Memory::Watched(depth.Address(), BlockBytes); + const bool metadataWatched = Memory::Watched(metadata.Address(), BlockBytes); + if (!depthWatched || !metadataWatched) { + std::printf("skipped, native clear imports lost guest write watching after warm-up (depth watched=%u, metadata watched=%u", static_cast(depthWatched), static_cast(metadataWatched)); +#ifdef __linux__ + std::printf(", Linux shared backing present, resolver fd returns: depth=%zu metadata=%zu", depth.SharedBackingResolverReturns(), metadata.SharedBackingResolverReturns()); +#endif + std::puts(")"); return VulkanTestSkipped; } const auto context = AgcDriver::VulkanDeviceTestAccess::Context(device);