Skip to content

Commit 08a83fd

Browse files
committed
Merge master
2 parents c71762e + f75557d commit 08a83fd

116 files changed

Lines changed: 7516 additions & 7349 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-nabla.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ jobs:
146146
github-token: ${{ secrets.GITHUB_TOKEN }}
147147
result-encoding: string
148148
script: |
149+
const headSha = context.payload.pull_request ? context.payload.pull_request.head.sha : context.sha;
149150
const response = await github.rest.checks.create({
150151
owner: context.repo.owner,
151152
repo: context.repo.repo,
152153
name: `Examples (${{ matrix.os }}, ${{ matrix.vendor }}-${{ matrix.tag }}, ${{ matrix.config }})`,
153-
head_sha: context.sha,
154+
head_sha: headSha,
154155
status: 'in_progress'
155156
});
156157
return response.data.id;

3rdparty/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ if(CMAKE_TOOLCHAIN_FILE)
149149
list(APPEND NBL_JPEG_CMAKE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
150150
endif()
151151

152+
nbl_append_sanitize_address_cmake_options(NBL_JPEG_CMAKE_OPTIONS)
153+
152154
# TODO: might find an alternative library which supports add_subdirectory, untill then we need to switch to a workaround just like
153155
# we do for DXC due to: https://github.com/libjpeg-turbo/libjpeg-turbo/blob/0b742742c873025e2a127918d4969238ace7ae5b/CMakeLists.txt#L69
154156
execute_process(COMMAND "${CMAKE_COMMAND}" -S "${CMAKE_CURRENT_SOURCE_DIR}/libjpeg-turbo" -B "${CMAKE_CURRENT_BINARY_DIR}/libjpeg-turbo" -G "${CMAKE_GENERATOR}" ${NBL_JPEG_CMAKE_OPTIONS}
@@ -492,10 +494,6 @@ endif()
492494
foreach(trgt IN LISTS NBL_3RDPARTY_TARGETS)
493495
set_property(TARGET ${trgt} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${NBL_COMPILER_DYNAMIC_RUNTIME}>:DLL>")
494496

495-
if(MSVC AND NBL_SANITIZE_ADDRESS)
496-
set_property(TARGET ${trgt} PROPERTY COMPILE_OPTIONS /fsanitize=address)
497-
endif()
498-
499497
get_target_property(NBL_TARGET_TYPE ${trgt} TYPE)
500498
if(NOT "${NBL_TARGET_TYPE}" STREQUAL "INTERFACE_LIBRARY")
501499
# maybe explicit global mapping would be better, to discuss

3rdparty/dxc/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ list(APPEND NBL_DXC_CMAKE_OPTIONS "-DDXC_SPIRV_TOOLS_DIR=${DXC_SPIRV_TOOLS_DIR}"
4343
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DDXC_SPIRV_HEADERS_DIR=${DXC_SPIRV_HEADERS_DIR}")
4444
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DDXC_ENABLE_ETW=OFF")
4545

46+
nbl_append_sanitize_address_cmake_options(NBL_DXC_CMAKE_OPTIONS)
47+
4648
if(NOT NBL_IS_MULTI_CONFIG)
4749
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
4850
endif()
@@ -54,7 +56,9 @@ endif()
5456
#else()
5557
# NBL_EXT_P_APPEND_COMPILE_OPTIONS(NBL_DXC_CMAKE_OPTIONS Release RelWithDebInfo Debug)
5658
#endif()
57-
#list(TRANSFORM NBL_DXC_CMAKE_OPTIONS REPLACE "/fp:fast" "/fp:precise")
59+
if(MSVC AND NBL_SANITIZE_ADDRESS)
60+
list(TRANSFORM NBL_DXC_CMAKE_OPTIONS REPLACE "/fp:fast" "/fp:precise")
61+
endif()
5862

5963
if(WIN32)
6064
if(NOT DEFINED HLSL_AUTOCRLF)

3rdparty/openexr

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# For conditions of distribution and use, see copyright notice in nabla.h.in or nabla.h
44
cmake_minimum_required(VERSION 3.31..4.2.0)
55

6+
if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM)
7+
set(CMAKE_POLICY_VERSION_MINIMUM 3.31 CACHE STRING "Minimum policy version for third-party projects")
8+
endif()
9+
610
# TODO: Yas - once we deploy 4.x we will fire `cmake_policy(VERSION <min>[...<max>])` instead of manually picking policies
711
# https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html#policy-version
812
# also we should update deps which throw warnings about < 3.10 compatibility
@@ -46,6 +50,7 @@ option(NBL_STATIC_BUILD "" OFF) # ON for static builds, OFF for shared
4650

4751
option(NBL_COMPILER_DYNAMIC_RUNTIME "" ON)
4852
option(NBL_SANITIZE_ADDRESS OFF)
53+
option(NBL_DEBUG_RTC_ENABLED "Enable Runtime Checks for Debug builds" OFF)
4954

5055
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT $<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>) # ignored on non xMSVC-ABI targets
5156

@@ -173,7 +178,7 @@ option(NBL_BUILD_DPL "Enable DPL (Dynamic Parallelism Library)" OFF)
173178
option(NBL_PCH "Enable pre-compiled header" ON)
174179
option(NBL_FAST_MATH "Enable fast low-precision math" OFF) # the reason OFF is by default now is the var controling it at build time was set AFTER BuildConfigOptions was generated - resulting in the feature being always OFF regardless the value xD - so just for sanity, keeping the same behaviour by default
175180
option(NBL_BUILD_EXAMPLES "Enable building examples" ON)
176-
option(NBL_BUILD_MITSUBA_LOADER "Enable nbl::ext::MitsubaLoader?" OFF) # TODO: once it compies turn this ON by default!
181+
option(NBL_BUILD_MITSUBA_LOADER "Enable nbl::ext::MitsubaLoader?" ON)
177182
option(NBL_BUILD_IMGUI "Enable nbl::ext::ImGui?" ON)
178183
option(NBL_BUILD_DEBUG_DRAW "Enable Nabla Debug Draw extension?" ON)
179184

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"NBL_UPDATE_GIT_SUBMODULE": "OFF",
1616
"NBL_COMPILE_WITH_CUDA": "OFF",
1717
"NBL_BUILD_OPTIX": "OFF",
18-
"NBL_BUILD_MITSUBA_LOADER": "OFF",
18+
"NBL_BUILD_MITSUBA_LOADER": "ON",
1919
"NBL_BUILD_RADEON_RAYS": "OFF",
2020
"_NBL_COMPILE_WITH_OPEN_EXR_": "ON",
2121
"NBL_EXPLICIT_MODULE_LOAD_LOG": "ON",

cmake/adjust/flags.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ function(nbl_adjust_flags)
281281

282282
# global compile options
283283
list(APPEND _D_NBL_COMPILE_OPTIONS_ ${NBL_COMPILE_OPTIONS})
284+
list(APPEND _D_NBL_LINK_OPTIONS_ ${NBL_LINK_OPTIONS})
284285

285286
foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES})
286287
string(TOUPPER "${CONFIG}" CONFIG_U)
@@ -316,15 +317,21 @@ function(nbl_adjust_flags)
316317

317318
# global compile options
318319
list(APPEND _D_NBL_COMPILE_OPTIONS_ ${NBL_COMPILE_OPTIONS})
320+
list(APPEND _D_NBL_LINK_OPTIONS_ ${NBL_LINK_OPTIONS})
319321
foreach(_NBL_OPTION_IMPL_ ${_NBL_OPTIONS_IMPL_})
320322
string(REPLACE "NBL_MAP_" "" NBL_MAP_CONFIGURATION_FROM "NBL_${_NBL_OPTION_IMPL_}")
321323
string(TOUPPER "${NBL_${_NBL_OPTION_IMPL_}}" NBL_MAP_CONFIGURATION_TO)
322324
set(NBL_TO_CONFIG_COMPILE_OPTIONS ${NBL_${NBL_MAP_CONFIGURATION_TO}_COMPILE_OPTIONS})
325+
set(NBL_TO_CONFIG_LINK_OPTIONS ${NBL_${NBL_MAP_CONFIGURATION_TO}_LINK_OPTIONS})
323326

324327
# per configuration compile options with mapping
325328
list(APPEND _D_NBL_COMPILE_OPTIONS_ $<$<CONFIG:${NBL_MAP_CONFIGURATION_FROM}>:${NBL_TO_CONFIG_COMPILE_OPTIONS}>)
329+
list(APPEND _D_NBL_LINK_OPTIONS_ $<$<CONFIG:${NBL_MAP_CONFIGURATION_FROM}>:${NBL_TO_CONFIG_LINK_OPTIONS}>)
326330
endforeach()
327331

328-
set_directory_properties(PROPERTIES COMPILE_OPTIONS "${_D_NBL_COMPILE_OPTIONS_}")
332+
set_directory_properties(PROPERTIES
333+
COMPILE_OPTIONS "${_D_NBL_COMPILE_OPTIONS_}"
334+
LINK_OPTIONS "${_D_NBL_LINK_OPTIONS_}"
335+
)
329336
endif()
330-
endfunction()
337+
endfunction()

cmake/adjust/template/vendor/impl/Clang.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ else()
7777
endif()
7878

7979
if(NBL_SANITIZE_ADDRESS)
80-
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} COMPILE_OPTIONS -fsanitize=address)
80+
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} COMPILE_OPTIONS -fsanitize=address LINK_OPTIONS -fsanitize=address)
8181
endif()
8282

8383
if(NBL_SANITIZE_THREAD)
84-
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} COMPILE_OPTIONS -fsanitize=thread)
84+
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} COMPILE_OPTIONS -fsanitize=thread LINK_OPTIONS -fsanitize=thread)
8585
endif()
8686

8787
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG DEBUG COMPILE_OPTIONS
@@ -106,4 +106,4 @@ else()
106106
-mno-incremental-linker-compatible # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mincremental-linker-compatible
107107
-DNDEBUG
108108
)
109-
endif()
109+
endif()

cmake/adjust/template/vendor/impl/frontend/MSVC.cmake

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,24 @@ if(NBL_SANITIZE_ADDRESS)
2323
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} COMPILE_OPTIONS
2424
/fsanitize=address # https://learn.microsoft.com/en-us/cpp/build/reference/fsanitize?view=msvc-170
2525
)
26-
27-
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG DEBUG COMPILE_OPTIONS
28-
/RTC1 # https://learn.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-170
29-
)
3026
endif()
3127

32-
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG DEBUG COMPILE_OPTIONS
28+
set(_NBL_MSVC_DEBUG_COMPILE_OPTIONS
3329
/Ob0 # https://learn.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion?view=msvc-170
3430
/Od # https://learn.microsoft.com/en-us/cpp/build/reference/od-disable-debug?view=msvc-170
3531
/Oy- # https://learn.microsoft.com/en-us/cpp/build/reference/oy-frame-pointer-omission?view=msvc-170
32+
)
33+
if(NBL_DEBUG_RTC_ENABLED AND NOT NBL_SANITIZE_ADDRESS)
34+
list(APPEND _NBL_MSVC_DEBUG_COMPILE_OPTIONS /RTC1)
35+
endif()
36+
37+
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG DEBUG COMPILE_OPTIONS
38+
${_NBL_MSVC_DEBUG_COMPILE_OPTIONS}
3639

3740
LINK_OPTIONS
3841
/INCREMENTAL # https://learn.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=msvc-170
3942
)
43+
unset(_NBL_MSVC_DEBUG_COMPILE_OPTIONS)
4044

4145
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG RELEASE COMPILE_OPTIONS
4246
/O2 # https://learn.microsoft.com/en-us/cpp/build/reference/o1-o2-minimize-size-maximize-speed?view=msvc-170
@@ -63,4 +67,4 @@ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG RELWITHDEBINFO COMPILE_OP
6367

6468
LINK_OPTIONS
6569
/INCREMENTAL # https://learn.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=msvc-170
66-
)
70+
)

cmake/common.cmake

Lines changed: 102 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,34 @@ include_guard(GLOBAL)
1616

1717
include(ProcessorCount)
1818

19+
# tmp for external projects, to be removed later when I get rid of them (dxc + jpeg currently)
20+
function(nbl_append_sanitize_address_cmake_options out_list)
21+
if(NOT NBL_SANITIZE_ADDRESS)
22+
return()
23+
endif()
24+
25+
if(MSVC)
26+
set(_NBL_ASAN_FLAG "/fsanitize=address")
27+
else()
28+
set(_NBL_ASAN_FLAG "-fsanitize=address")
29+
set(_NBL_ASAN_LINK_SUFFIX " ${_NBL_ASAN_FLAG}")
30+
endif()
31+
32+
list(APPEND ${out_list}
33+
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} ${_NBL_ASAN_FLAG}"
34+
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} ${_NBL_ASAN_FLAG}"
35+
)
36+
if(DEFINED _NBL_ASAN_LINK_SUFFIX)
37+
list(APPEND ${out_list}
38+
"-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}${_NBL_ASAN_LINK_SUFFIX}"
39+
"-DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}${_NBL_ASAN_LINK_SUFFIX}"
40+
)
41+
endif()
42+
unset(_NBL_ASAN_FLAG)
43+
unset(_NBL_ASAN_LINK_SUFFIX)
44+
set(${out_list} "${${out_list}}" PARENT_SCOPE)
45+
endfunction()
46+
1947
# Macro creating project for an executable
2048
# Project and target get its name from directory when this macro gets executed (truncating number in the beginning of the name and making all lower case)
2149
# Created because of common cmake code for examples and tools
@@ -1142,6 +1170,7 @@ option(NSC_DEBUG_EDIF_SOURCE_BIT "Add \"-fspv-debug=source\" to NSC Debug CLI" O
11421170
option(NSC_DEBUG_EDIF_LINE_BIT "Add \"-fspv-debug=line\" to NSC Debug CLI" OFF)
11431171
option(NSC_DEBUG_EDIF_TOOL_BIT "Add \"-fspv-debug=tool\" to NSC Debug CLI" ON)
11441172
option(NSC_DEBUG_EDIF_NON_SEMANTIC_BIT "Add \"-fspv-debug=vulkan-with-source\" to NSC Debug CLI" OFF)
1173+
option(NSC_USE_DEPFILE "Generate depfiles for NSC custom commands" ON)
11451174

11461175
function(NBL_CREATE_NSC_COMPILE_RULES)
11471176
set(COMMENT "this code has been autogenerated with Nabla CMake NBL_CREATE_HLSL_COMPILE_RULES utility")
@@ -1181,6 +1210,7 @@ struct DeviceConfigCaps
11811210
-fspv-target-env=vulkan1.3
11821211
-Wshadow
11831212
-Wconversion
1213+
-Wno-local-type-template-args
11841214
$<$<CONFIG:Debug>:-O0>
11851215
$<$<CONFIG:Release>:-O3>
11861216
$<$<CONFIG:RelWithDebInfo>:-O3>
@@ -1208,6 +1238,7 @@ struct DeviceConfigCaps
12081238

12091239
if(NOT NBL_EMBED_BUILTIN_RESOURCES)
12101240
list(APPEND REQUIRED_OPTIONS
1241+
-no-nbl-builtins
12111242
-I "${NBL_ROOT_PATH}/include"
12121243
-I "${NBL_ROOT_PATH}/3rdparty/dxc/dxc/external/SPIRV-Headers/include"
12131244
-I "${NBL_ROOT_PATH}/3rdparty/boost/superproject/libs/preprocessor/include"
@@ -1216,9 +1247,20 @@ struct DeviceConfigCaps
12161247
endif()
12171248

12181249
set(REQUIRED_SINGLE_ARGS TARGET BINARY_DIR OUTPUT_VAR INPUTS INCLUDE NAMESPACE MOUNT_POINT_DEFINE)
1219-
cmake_parse_arguments(IMPL "" "${REQUIRED_SINGLE_ARGS};LINK_TO" "COMMON_OPTIONS;DEPENDS" ${ARGV})
1250+
set(OPTIONAL_SINGLE_ARGS GLOB_DIR)
1251+
cmake_parse_arguments(IMPL "DISCARD_DEFAULT_GLOB" "${REQUIRED_SINGLE_ARGS};${OPTIONAL_SINGLE_ARGS};LINK_TO" "COMMON_OPTIONS;DEPENDS" ${ARGV})
12201252
NBL_PARSE_REQUIRED(IMPL ${REQUIRED_SINGLE_ARGS})
12211253

1254+
set(IMPL_HLSL_GLOB "")
1255+
if(NOT IMPL_DISCARD_DEFAULT_GLOB)
1256+
set(GLOB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
1257+
if(IMPL_GLOB_DIR)
1258+
set(GLOB_ROOT "${IMPL_GLOB_DIR}")
1259+
endif()
1260+
get_filename_component(GLOB_ROOT "${GLOB_ROOT}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
1261+
file(GLOB_RECURSE IMPL_HLSL_GLOB CONFIGURE_DEPENDS "${GLOB_ROOT}/*.hlsl")
1262+
endif()
1263+
12221264
if(NOT TARGET ${IMPL_TARGET})
12231265
add_library(${IMPL_TARGET} INTERFACE)
12241266
endif()
@@ -1294,6 +1336,10 @@ namespace @IMPL_NAMESPACE@ {
12941336
list(APPEND MP_DEFINES ${IMPL_MOUNT_POINT_DEFINE}="${IMPL_BINARY_DIR}")
12951337
set_target_properties(${IMPL_TARGET} PROPERTIES NBL_MOUNT_POINT_DEFINES "${MP_DEFINES}")
12961338

1339+
set(RTE "NSC Rules")
1340+
set(IN "${RTE}/In")
1341+
set(OUT "${RTE}/Out")
1342+
12971343
string(JSON JSON_LENGTH LENGTH "${IMPL_INPUTS}")
12981344
math(EXPR LAST_INDEX "${JSON_LENGTH} - 1")
12991345

@@ -1480,38 +1526,80 @@ namespace @IMPL_NAMESPACE@ {
14801526
# generate keys and commands for compiling shaders
14811527
set(FINAL_KEY_REL_PATH "$<CONFIG>/${FINAL_KEY}")
14821528
set(TARGET_OUTPUT "${IMPL_BINARY_DIR}/${FINAL_KEY_REL_PATH}")
1529+
set(DEPFILE_PATH "${TARGET_OUTPUT}.d")
1530+
set(NBL_NSC_LOG_PATH "${TARGET_OUTPUT}.log")
1531+
1532+
set(NBL_NSC_DEPFILE_ARGS "")
1533+
if(NSC_USE_DEPFILE)
1534+
set(NBL_NSC_DEPFILE_ARGS -MD -MF "${DEPFILE_PATH}")
1535+
endif()
14831536

14841537
set(NBL_NSC_COMPILE_COMMAND
14851538
"$<TARGET_FILE:nsc>"
14861539
-Fc "${TARGET_OUTPUT}"
14871540
${COMPILE_OPTIONS} ${REQUIRED_OPTIONS} ${IMPL_COMMON_OPTIONS}
1541+
${NBL_NSC_DEPFILE_ARGS}
14881542
"${CONFIG_FILE}"
14891543
)
14901544

1491-
add_custom_command(OUTPUT "${TARGET_OUTPUT}"
1545+
get_filename_component(NBL_NSC_INPUT_NAME "${TARGET_INPUT}" NAME)
1546+
get_filename_component(NBL_NSC_CONFIG_NAME "${CONFIG_FILE}" NAME)
1547+
set(NBL_NSC_BYPRODUCTS "${NBL_NSC_LOG_PATH}")
1548+
if(NSC_USE_DEPFILE)
1549+
list(APPEND NBL_NSC_BYPRODUCTS "${DEPFILE_PATH}")
1550+
endif()
1551+
1552+
set(NBL_NSC_CUSTOM_COMMAND_ARGS
1553+
OUTPUT "${TARGET_OUTPUT}"
1554+
BYPRODUCTS ${NBL_NSC_BYPRODUCTS}
14921555
COMMAND ${NBL_NSC_COMPILE_COMMAND}
14931556
DEPENDS ${DEPENDS_ON}
1494-
COMMENT "Creating \"${TARGET_OUTPUT}\""
1557+
COMMENT "${NBL_NSC_CONFIG_NAME} (${NBL_NSC_INPUT_NAME})"
14951558
VERBATIM
14961559
COMMAND_EXPAND_LISTS
14971560
)
1498-
set_source_files_properties("${TARGET_OUTPUT}" PROPERTIES GENERATED TRUE)
1561+
if(NSC_USE_DEPFILE)
1562+
list(APPEND NBL_NSC_CUSTOM_COMMAND_ARGS DEPFILE "${DEPFILE_PATH}")
1563+
endif()
1564+
add_custom_command(${NBL_NSC_CUSTOM_COMMAND_ARGS})
1565+
set(NBL_NSC_OUT_FILES "${TARGET_OUTPUT}" "${NBL_NSC_LOG_PATH}")
1566+
if(NSC_USE_DEPFILE)
1567+
list(APPEND NBL_NSC_OUT_FILES "${DEPFILE_PATH}")
1568+
endif()
14991569

1500-
set(HEADER_ONLY_LIKE "${CONFIG_FILE}" "${TARGET_INPUT}" "${TARGET_OUTPUT}")
1570+
set_source_files_properties(${NBL_NSC_OUT_FILES} PROPERTIES GENERATED TRUE)
1571+
1572+
set(HEADER_ONLY_LIKE "${CONFIG_FILE}" "${TARGET_INPUT}" ${NBL_NSC_OUT_FILES})
15011573
target_sources(${IMPL_TARGET} PRIVATE ${HEADER_ONLY_LIKE})
15021574

15031575
set_source_files_properties(${HEADER_ONLY_LIKE} PROPERTIES
15041576
HEADER_FILE_ONLY ON
15051577
VS_TOOL_OVERRIDE None
15061578
)
1579+
if(CMAKE_CONFIGURATION_TYPES)
1580+
foreach(_CFG IN LISTS CMAKE_CONFIGURATION_TYPES)
1581+
set(TARGET_OUTPUT_IDE "${IMPL_BINARY_DIR}/${_CFG}/${FINAL_KEY}")
1582+
set(NBL_NSC_OUT_FILES_IDE "${TARGET_OUTPUT_IDE}" "${TARGET_OUTPUT_IDE}.log")
1583+
if(NSC_USE_DEPFILE)
1584+
list(APPEND NBL_NSC_OUT_FILES_IDE "${TARGET_OUTPUT_IDE}.d")
1585+
endif()
1586+
source_group("${OUT}/${_CFG}" FILES ${NBL_NSC_OUT_FILES_IDE})
1587+
endforeach()
1588+
else()
1589+
set(TARGET_OUTPUT_IDE "${IMPL_BINARY_DIR}/${FINAL_KEY}")
1590+
set(NBL_NSC_OUT_FILES_IDE "${TARGET_OUTPUT_IDE}" "${TARGET_OUTPUT_IDE}.log")
1591+
if(NSC_USE_DEPFILE)
1592+
list(APPEND NBL_NSC_OUT_FILES_IDE "${TARGET_OUTPUT_IDE}.d")
1593+
endif()
1594+
source_group("${OUT}" FILES ${NBL_NSC_OUT_FILES_IDE})
1595+
endif()
15071596

15081597
set_source_files_properties("${TARGET_OUTPUT}" PROPERTIES
15091598
NBL_SPIRV_REGISTERED_INPUT "${TARGET_INPUT}"
15101599
NBL_SPIRV_PERMUTATION_CONFIG "${CONFIG_FILE}"
15111600
NBL_SPIRV_BINARY_DIR "${IMPL_BINARY_DIR}"
15121601
NBL_SPIRV_ACCESS_KEY "${FINAL_KEY_REL_PATH}"
15131602
)
1514-
15151603
set_property(TARGET ${IMPL_TARGET} APPEND PROPERTY NBL_SPIRV_OUTPUTS "${TARGET_OUTPUT}")
15161604
return()
15171605
endif()
@@ -1545,12 +1633,15 @@ namespace @IMPL_NAMESPACE@ {
15451633
list(APPEND KEYS ${ACCESS_KEY})
15461634
endforeach()
15471635

1548-
set(RTE "NSC Rules")
1549-
set(IN "${RTE}/In")
1550-
set(OUT "${RTE}/Out")
1551-
15521636
source_group("${IN}" FILES ${CONFIGS} ${INPUTS})
1553-
source_group("${OUT}" FILES ${SPIRVs})
1637+
if(IMPL_HLSL_GLOB)
1638+
target_sources(${IMPL_TARGET} PRIVATE ${IMPL_HLSL_GLOB})
1639+
set_source_files_properties(${IMPL_HLSL_GLOB} PROPERTIES
1640+
HEADER_FILE_ONLY ON
1641+
VS_TOOL_OVERRIDE None
1642+
)
1643+
source_group("HLSL Files" FILES ${IMPL_HLSL_GLOB})
1644+
endif()
15541645

15551646
set(${IMPL_OUTPUT_VAR} ${KEYS} PARENT_SCOPE)
15561647
endfunction()

0 commit comments

Comments
 (0)