Cycles: add /jumptablerdata to MSVC compiler flags #110470

Merged
Xavier Hallade merged 1 commits from xavierh/blender:jumptablerdata into main 2023-07-25 19:19:44 +02:00
1 changed files with 7 additions and 0 deletions

View File

@ -83,6 +83,13 @@ elseif(WIN32 AND MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# grained control and the speedup we get here is too big to ignore.
set(CYCLES_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /GS-")
# "jumptablerdata" improves performance when there is contention in large switch statements such as in svm.h
# This flag is supported starting with MSVC 17.7 preview 3:
# https://learn.microsoft.com/en-us/cpp/build/reference/jump-table-rdata
if(MSVC_VERSION GREATER_EQUAL 1937)
xavierh marked this conversation as resolved
Review

I don't think 1937 is specific enough to target 17.7 preview 3, non developers do use the preview compilers these days and may still be on update 1 or 2 (we black listed 17.6 due to a bad codegen, which moved some blender enthusiast style users over to the preview channel but i don't see them updating it on a regular basis)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.37.32820) 

should do nicely though. (19.37.32820 is 17.7 preview 3)

I don't think 1937 is specific enough to target 17.7 preview 3, non developers do use the preview compilers these days and may still be on update 1 or 2 (we black listed 17.6 due to a bad codegen, which moved some blender enthusiast style users over to the preview channel but i don't see them updating it on a regular basis) ``` if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.37.32820) ``` should do nicely though. (19.37.32820 is 17.7 preview 3)
Review

sure! your proposition will be nicer to them, done with b0d1226b6c

sure! your proposition will be nicer to them, done with https://projects.blender.org/blender/blender/commit/b0d1226b6cb16a155ce8a89840f0ff326ea3f4aa
string(APPEND CYCLES_KERNEL_FLAGS " /jumptablerdata")
endif()
# there is no /arch:SSE3, but intrinsics are available anyway
if(CMAKE_CL_64)
set(CYCLES_SSE2_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}")