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.
This commit is contained in:
Raj 2026-10-08 12:05:20 +05:30
parent 66b9be6607
commit 33fc6ada3c
1 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,7 @@
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <new>
#include <string>
#include <vector>
@ -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::uint32_t*>(std::aligned_alloc(65536, recordBlockBytes));
Require(record != nullptr, "cannot allocate the indirect record block");
auto* record = static_cast<std::uint32_t*>(::operator new(recordBlockBytes, std::align_val_t{65536}));
{
GuestAllocations::Mutation mutation;
mutation.Add(record, recordBlockBytes, true, true);