Skip to content

Commit 93405e9

Browse files
author
kevyuu
committed
Merge branch 'master' into raytracing_pipeline
# Conflicts: # include/nbl/builtin/hlsl/enums.hlsl # src/nbl/asset/utils/CHLSLCompiler.cpp
2 parents b2188dc + 683f622 commit 93405e9

File tree

236 files changed

+213685
-240700
lines changed

Some content is hidden

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

236 files changed

+213685
-240700
lines changed

3rdparty/Vulkan-Headers

Submodule Vulkan-Headers updated 61 files

3rdparty/dxc/dxc

Submodule dxc updated 162 files

CMakeLists.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,64 @@ option(NBL_BUILD_BULLET "Enable Bullet Physics building and integration?" OFF)
193193
option(NBL_BUILD_DOCS "Enable building documentation?" OFF) # No one has doxygen installed, plus we dont know when was the last time we generated working doxy and we'll use SphinX in the future
194194
option(NBL_ENABLE_PROJECT_JSON_CONFIG_VALIDATION "" ON)
195195
option(NBL_EMBED_BUILTIN_RESOURCES "Embed built-in resources?" ON)
196+
option(NBL_ENABLE_DOCKER_INTEGRATION "Enables docker integration, if client is not found Docker Desktop will be installed" OFF)
197+
198+
if (NBL_ENABLE_DOCKER_INTEGRATION)
199+
if (NOT CMAKE_HOST_WIN32)
200+
message(FATAL_ERROR "NBL_ENABLE_DOCKER_INTEGRATION works only with Windows host machines. Please disable this option")
201+
endif()
202+
203+
find_program(DOCKER_EXECUTABLE docker REQUIRED)
204+
205+
if (DOCKER_EXECUTABLE)
206+
message(STATUS "Found docker executable: ${DOCKER_EXECUTABLE}")
207+
else()
208+
execute_process(COMMAND powershell -Command "& {
209+
Invoke-WebRequest -Uri https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe -OutFile DockerDesktopInstaller.exe;
210+
$exitCode = Start-Process -Wait -FilePath .\\DockerDesktopInstaller.exe -ArgumentList 'install','--quiet','--accept-license','--backend=wsl-2','--always-run-service';
211+
Remove-Item -Force DockerDesktopInstaller.exe;
212+
exit $exitCode;
213+
}" RESULT_VARIABLE DOCKER_INSTALLER_EXIT_CODE)
214+
215+
if (DOCKER_INSTALLER_EXIT_CODE NOT EQUAL 0)
216+
message(FATAL_ERROR "Docker installer exited with non-zero return code")
217+
endif()
218+
endif()
219+
220+
message(STATUS "Docker endpoint healty check..")
221+
set(DDT_MAX_ATTEMPTS 10)
222+
set(DDT_DOCKER_RESPONDING False)
223+
foreach(ATTEMPT RANGE 1 ${DDT_MAX_ATTEMPTS})
224+
message(STATUS "Attempt ${ATTEMPT} of ${DDT_MAX_ATTEMPTS}: Checking Docker Endpoint")
225+
NBL_DOCKER(info)
226+
227+
if (DOCKER_EXIT_CODE EQUAL 0)
228+
set(DDT_DOCKER_RESPONDING True)
229+
message(STATUS "Docker endpoint detected, the engine is running.")
230+
message(STATUS "${DOCKER_OUTPUT_VAR}")
231+
break()
232+
endif()
233+
234+
NBL_WAIT_FOR(5)
235+
endforeach()
236+
237+
if (NOT DDT_DOCKER_RESPONDING)
238+
message(FATAL_ERROR "Docker Daemon is not responding. Please make sure it's running in the background!")
239+
endif()
240+
241+
set(DNT_NETWORK_NAME "docker_default")
242+
NBL_DOCKER(network inspect ${DNT_NETWORK_NAME})
243+
if (NOT DOCKER_EXIT_CODE EQUAL 0)
244+
message(STATUS "Default docker network doesn't exist, creating \"${DNT_NETWORK_NAME}\" network..")
245+
NBL_DOCKER(network create -d nat ${DNT_NETWORK_NAME})
246+
247+
if (NOT DOCKER_EXIT_CODE EQUAL 0)
248+
message(STATUS "Could not create default docker \"${DNT_NETWORK_NAME}\" network!")
249+
endif()
250+
endif()
251+
252+
message(STATUS "Default docker network: \"${DNT_NETWORK_NAME}\"")
253+
endif()
196254

197255
set(THIRD_PARTY_SOURCE_DIR "${PROJECT_SOURCE_DIR}/3rdparty")
198256
set(THIRD_PARTY_BINARY_DIR "${PROJECT_BINARY_DIR}/3rdparty")

README.md

Lines changed: 272 additions & 249 deletions
Large diffs are not rendered by default.

cmake/adjust/flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,6 @@ function(nbl_adjust_flags)
200200
list(APPEND _D_NBL_COMPILE_OPTIONS_ $<$<CONFIG:${NBL_MAP_CONFIGURATION_FROM}>:${NBL_TO_CONFIG_COMPILE_OPTIONS}>)
201201
endforeach()
202202

203-
set_directory_properties(PROPERTIES COMPILE_OPTIONS ${_D_NBL_COMPILE_OPTIONS_})
203+
set_directory_properties(PROPERTIES COMPILE_OPTIONS "${_D_NBL_COMPILE_OPTIONS_}")
204204
endif()
205205
endfunction()

cmake/common.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,4 +1334,16 @@ macro(NBL_TARGET_FORCE_ASSEMBLER_EXECUTABLE _NBL_TARGET_ _NBL_ASM_DIALECT_ _NBL_
13341334
TARGET_DIRECTORY "${_NBL_TARGET_}"
13351335
PROPERTIES LANGUAGE "${_NBL_ASM_DIALECT_}"
13361336
)
1337+
endmacro()
1338+
1339+
macro(NBL_WAIT_FOR SLEEP_DURATION)
1340+
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${SLEEP_DURATION})
1341+
endmacro()
1342+
1343+
# helper macro for calling docker, takes args as a list of strings
1344+
macro(NBL_DOCKER)
1345+
execute_process(COMMAND ${DOCKER_EXECUTABLE} ${ARGN}
1346+
RESULT_VARIABLE DOCKER_EXIT_CODE
1347+
OUTPUT_VARIABLE DOCKER_OUTPUT_VAR
1348+
)
13371349
endmacro()

cmake/submodules/update.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ execute_process(COMMAND "${GIT_EXECUTABLE}" ${NBL_CONFIG_SETUP_CMD} submodule up
139139

140140
# tests
141141
NBL_WRAPPER_COMMAND_EXCLUSIVE("" ./tests FALSE "")
142+
143+
# docker
144+
NBL_WRAPPER_COMMAND_EXCLUSIVE("" ./docker FALSE "")
142145
endmacro()
143146

144147
NBL_IMPL_INIT_COMMON_SUBMODULES()

examples_tests

Submodule examples_tests updated 59 files

include/nbl/asset/ICPUSampler.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ class ICPUSampler : public ISampler, public IAsset
3737
};
3838
switch (wrapModes[i])
3939
{
40-
case ISampler::ETC_REPEAT:
40+
case ISampler::E_TEXTURE_CLAMP::ETC_REPEAT:
4141
repeat();
4242
break;
43-
case ISampler::ETC_CLAMP_TO_EDGE:
44-
texelCoord[i] = core::clamp<int32_t,int32_t>(texelCoord[i],0,mipLastCoord[i]);
43+
case ISampler::E_TEXTURE_CLAMP::ETC_CLAMP_TO_EDGE:
44+
texelCoord[i] = core::clamp<int32_t, int32_t>(texelCoord[i], 0, mipLastCoord[i]);
4545
break;
46-
case ISampler::ETC_MIRROR_CLAMP_TO_EDGE:
47-
texelCoord[i] = core::clamp<int32_t,int32_t>(texelCoord[i],-int32_t(mipExtent[i]),mipExtent[i]+mipLastCoord[i]);
46+
case ISampler::E_TEXTURE_CLAMP::ETC_MIRROR_CLAMP_TO_EDGE:
47+
texelCoord[i] = core::clamp<int32_t, int32_t>(texelCoord[i], -int32_t(mipExtent[i]), mipExtent[i] + mipLastCoord[i]);
4848
[[fallthrough]];
49-
case ISampler::ETC_MIRROR:
49+
case ISampler::E_TEXTURE_CLAMP::ETC_MIRROR:
5050
{
5151
int32_t repeatID = (originalWasNegative+texelCoord[i])/int32_t(mipExtent[i]);
5252
repeat();

0 commit comments

Comments
 (0)