dillongoostudios / goo-engine

Custom build of blender with some extra NPR features.
Other
982 stars 129 forks source link

Upstream: `Build: Ambiguous call to isfinite for MSVC 17.11` #92

Open illusion0001 opened 2 months ago

illusion0001 commented 2 months ago

Fixes build for new MSVC versions.

D:\a\goo-blender\goo-blender\intern\cycles\scene\image.cpp(637,14): error C2668: 'ccl::`anonymous-namespace'::isfinite': ambiguous call to overloaded function [D:\a\goo-blender\build_windows_x64_vc17_Release\intern\cycles\scene\cycles_scene.vcxproj]
    D:\a\goo-blender\goo-blender\intern\cycles\scene\image.cpp(40,6):
    could be 'bool ccl::`anonymous-namespace'::isfinite(uint16_t)'
    D:\a\goo-blender\goo-blender\intern\cycles\scene\image.cpp(36,6):
    or       'bool ccl::`anonymous-namespace'::isfinite(ccl::half)'
    D:\a\goo-blender\goo-blender\intern\cycles\scene\image.cpp(32,6):
    or       'bool ccl::`anonymous-namespace'::isfinite(ccl::uchar)'

Original commit comment:


Build: Ambiguous call to isfinite for MSVC 17.11

Overload resolution must have changed and is causing issues for one particular code path attempting to use isfinite(ccl::uchar). Compiler output attached.

It turns out that the code in question can be simplified to just remove the ambiguity because only the float codepath wants to check for finite values.


Reduced repro: https://godbolt.org/z/YWz3Yc3x8 Pull Request: https://projects.blender.org/blender/blender/pulls/125348