Skip to content

Commit 29bda52

Browse files
committed
Enable O1experimental by default for NSC rules
1 parent 0d19dfa commit 29bda52

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

3rdparty/dxc/dxc

cmake/common.cmake

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,7 @@ option(NSC_DEBUG_EDIF_LINE_BIT "Add \"-fspv-debug=line\" to NSC Debug CLI" OFF)
11911191
option(NSC_DEBUG_EDIF_TOOL_BIT "Add \"-fspv-debug=tool\" to NSC Debug CLI" ON)
11921192
option(NSC_DEBUG_EDIF_NON_SEMANTIC_BIT "Add \"-fspv-debug=vulkan-with-source\" to NSC Debug CLI" OFF)
11931193
option(NSC_USE_DEPFILE "Generate depfiles for NSC custom commands" ON)
1194+
option(NBL_DISABLE_EXPERIMENTAL_OPTS "Disable -O1experimental for all NSC compile rules globally" OFF)
11941195

11951196
function(NBL_CREATE_NSC_COMPILE_RULES)
11961197
set(COMMENT "this code has been autogenerated with Nabla CMake NBL_CREATE_HLSL_COMPILE_RULES utility")
@@ -1230,10 +1231,7 @@ struct DeviceConfigCaps
12301231
-fspv-target-env=vulkan1.3
12311232
-Wshadow
12321233
-Wconversion
1233-
-Wno-local-type-template-args
1234-
$<$<CONFIG:Debug>:-O0>
1235-
$<$<CONFIG:Release>:-O3>
1236-
$<$<CONFIG:RelWithDebInfo>:-O3>
1234+
-Wno-local-type-template-args
12371235
)
12381236

12391237
if(NSC_DEBUG_EDIF_FILE_BIT)
@@ -1268,9 +1266,23 @@ struct DeviceConfigCaps
12681266

12691267
set(REQUIRED_SINGLE_ARGS TARGET BINARY_DIR OUTPUT_VAR INPUTS INCLUDE NAMESPACE MOUNT_POINT_DEFINE)
12701268
set(OPTIONAL_SINGLE_ARGS GLOB_DIR)
1271-
cmake_parse_arguments(IMPL "DISCARD_DEFAULT_GLOB" "${REQUIRED_SINGLE_ARGS};${OPTIONAL_SINGLE_ARGS};LINK_TO" "COMMON_OPTIONS;DEPENDS" ${ARGV})
1269+
cmake_parse_arguments(IMPL "DISCARD_DEFAULT_GLOB;DISABLE_EXPERIMENTAL_OPTS" "${REQUIRED_SINGLE_ARGS};${OPTIONAL_SINGLE_ARGS};LINK_TO" "COMMON_OPTIONS;DEPENDS" ${ARGV})
12721270
NBL_PARSE_REQUIRED(IMPL ${REQUIRED_SINGLE_ARGS})
12731271

1272+
if(NBL_DISABLE_EXPERIMENTAL_OPTS OR IMPL_DISABLE_EXPERIMENTAL_OPTS)
1273+
list(APPEND REQUIRED_OPTIONS
1274+
$<$<CONFIG:Debug>:-O0>
1275+
$<$<CONFIG:Release>:-O3>
1276+
$<$<CONFIG:RelWithDebInfo>:-O3>
1277+
)
1278+
else()
1279+
list(APPEND REQUIRED_OPTIONS
1280+
$<$<CONFIG:Debug>:-O1experimental>
1281+
$<$<CONFIG:Release>:-O3>
1282+
$<$<CONFIG:RelWithDebInfo>:-O1experimental>
1283+
)
1284+
endif()
1285+
12741286
set(IMPL_HLSL_GLOB "")
12751287
if(NOT IMPL_DISCARD_DEFAULT_GLOB)
12761288
set(GLOB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")

0 commit comments

Comments
 (0)