From 33fc6ada3c4736c527db071e92f83cee6d677309 Mon Sep 17 00:00:00 2001 From: Raj Date: Thu, 8 Oct 2026 12:05:20 +0530 Subject: [PATCH] test(agc): build the mesh tests with MinGW tests/Mesh.cpp called setenv and std::aligned_alloc, which MinGW does not provide, so agc_driver_mesh_tests did not compile on Windows. The 64 KiB indirect record block now comes from aligned operator new, and the environment is set with _putenv_s on Windows, as ShaderDiskCache.cpp does. The setenv also named APS5_NO_SHADER_DISK_CACHE, which nothing reads; the shader cache is turned off by ANYPS5_NO_SHADER_CACHE. --- core/libs/prx/libSceAgcDriver/tests/Mesh.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/libs/prx/libSceAgcDriver/tests/Mesh.cpp b/core/libs/prx/libSceAgcDriver/tests/Mesh.cpp index 025817a38..892321417 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Mesh.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Mesh.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -206,7 +207,11 @@ void CheckTriangles(const char* what) { int main() { try { - setenv("APS5_NO_SHADER_DISK_CACHE", "1", 1); +#ifdef _WIN32 + _putenv_s("ANYPS5_NO_SHADER_CACHE", "1"); +#else + setenv("ANYPS5_NO_SHADER_CACHE", "1", 1); +#endif for (std::uint32_t triangle = 0; triangle < Triangles; ++triangle) { const auto vertices = TriangleVertices(triangle); for (std::uint32_t k = 0; k < 3; ++k) { @@ -253,8 +258,7 @@ int main() { } constexpr std::size_t recordBlockBytes = 65536; - auto* record = static_cast(std::aligned_alloc(65536, recordBlockBytes)); - Require(record != nullptr, "cannot allocate the indirect record block"); + auto* record = static_cast(::operator new(recordBlockBytes, std::align_val_t{65536})); { GuestAllocations::Mutation mutation; mutation.Add(record, recordBlockBytes, true, true);