Skip to content

Commit f897fae

Browse files
committed
demo: Fix MSVC build
Suppress getenv deprecation warning with a pragma; we could instead define _CRT_SECURE_NO_WARNINGS at the top of the file, but this is less local - we'd expect this code to be removed in the future anyway.
1 parent 1523126 commit f897fae

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

demo/main.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -990,10 +990,8 @@ static int follow(int* parents, int index)
990990
return index;
991991
}
992992

993-
void meshlets(const Mesh& mesh, bool scan = false, bool uniform = false, bool flex = false)
993+
void meshlets(const Mesh& mesh, bool scan = false, bool uniform = false, bool flex = false, bool dump = false)
994994
{
995-
bool dump = getenv("DUMP") && atoi(getenv("DUMP"));
996-
997995
// NVidia-recommends 64/126; we round 126 down to a multiple of 4
998996
// alternatively we also test uniform configuration with 64/64 which is better for AMD
999997
const size_t max_vertices = 64;
@@ -1480,7 +1478,14 @@ void processDev(const char* path)
14801478
if (!loadMesh(mesh, path))
14811479
return;
14821480

1483-
meshlets(mesh, /* scan= */ false, /* uniform= */ true, /* flex= */ true);
1481+
#ifdef _MSC_VER
1482+
#pragma warning(disable : 4996)
1483+
#endif
1484+
1485+
bool dump = getenv("DUMP") && atoi(getenv("DUMP"));
1486+
1487+
meshlets(mesh, /* scan= */ false, /* uniform= */ true, /* flex= */ false);
1488+
meshlets(mesh, /* scan= */ false, /* uniform= */ true, /* flex= */ true, dump);
14841489
}
14851490

14861491
void processNanite(const char* path)

0 commit comments

Comments
 (0)