From 7d62f1f26fb176a89fc4e8f9e450456ee2ecdeb8 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 10 Mar 2022 17:51:38 -0800 Subject: [PATCH] Disable optimizations for gltf_decoder.cc in MSVC builds. (#829) Not really sure who is to blame, but in optimized builds from MSVC gltf_decoder.cc appears to be getting garbage values back from TinyGLTF when it parses the materials for testdata/.../three_meshes_two_materials_one_no_material.gltf Since there's no certainty about whether this is limited to this particular file, just disable optimizations for src/draco/io/gltf_decoder.cc in all MSVC build configurations. --- .github/workflows/ci.yml | 12 ++---------- CMakeLists.txt | 7 +++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcbfc43..eb60ea3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,11 +165,7 @@ jobs: -DDRACO_TESTS=ON \ -DDRACO_TRANSCODER_SUPPORTED=ON cmake_build_command: cmake --build . --config Release -- -m:2 - # TODO(https://github.com/google/draco/issues/826) - draco_test_command: |- - Release/draco_tests \ - --gtest_filter=-GltfDecoderTest.ThreeMeshesOneNoMaterialMesh - + draco_test_command: Release/draco_tests - test_name: windows-msvc-release-static os: windows-2019 @@ -189,11 +185,7 @@ jobs: -DDRACO_TESTS=ON \ -DDRACO_TRANSCODER_SUPPORTED=ON cmake_build_command: cmake --build . --config Release -- -m:2 - # TODO(https://github.com/google/draco/issues/826) - draco_test_command: |- - Release/draco_tests \ - --gtest_filter=-GltfDecoderTest.ThreeMeshesOneNoMaterialMesh - + draco_test_command: Release/draco_tests - test_name: windows-make-release-shared os: windows-2019 diff --git a/CMakeLists.txt b/CMakeLists.txt index e551901..ca5452f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -862,6 +862,13 @@ else() ${draco_include_paths}) if(DRACO_TRANSCODER_SUPPORTED) + if(MSVC) + # TODO(https://github.com/google/draco/issues/826) + set_source_files_properties( + "${draco_src_root}/io/gltf_decoder.cc" + PROPERTIES COMPILE_OPTIONS "/Od") + endif() + draco_add_library( NAME draco_material