Skip to content

Commit ea429a8

Browse files
author
devsh
committed
Merge remote-tracking branch 'origin/master' into bindless_blit
2 parents 395ac58 + 45db070 commit ea429a8

File tree

6 files changed

+40
-31
lines changed

6 files changed

+40
-31
lines changed

include/nbl/builtin/hlsl/type_traits.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ struct unsigned_integer_of_size<8>
695695
using type = uint64_t;
696696
};
697697
template<uint16_t bytesize>
698-
using unsigned_integer_of_size_t = unsigned_integer_of_size<bytesize>::type;
698+
using unsigned_integer_of_size_t = typename unsigned_integer_of_size<bytesize>::type;
699699

700700
}
701701
}

include/nbl/core/hash/blake.h

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
#ifndef _NBL_CORE_HASH_BLAKE3_H_INCLUDED_
55
#define _NBL_CORE_HASH_BLAKE3_H_INCLUDED_
66

7-
87
#include "blake3.h"
98

109
#include <span>
1110

12-
1311
namespace nbl::core
1412
{
1513
struct blake3_hash_t final
@@ -21,7 +19,7 @@ struct blake3_hash_t final
2119
uint8_t data[BLAKE3_OUT_LEN];
2220
};
2321

24-
class blake3_hasher final
22+
class NBL_API2 blake3_hasher final
2523
{
2624
template<typename T, typename Dummy=void>
2725
struct update_impl
@@ -39,31 +37,17 @@ class blake3_hasher final
3937
::blake3_hasher m_state;
4038

4139
public:
42-
inline blake3_hasher()
43-
{
44-
::blake3_hasher_init(&m_state);
45-
}
40+
blake3_hasher();
4641

47-
inline blake3_hasher& update(const void* data, const size_t bytes)
48-
{
49-
::blake3_hasher_update(&m_state,data,bytes);
50-
return *this;
51-
}
42+
blake3_hasher& update(const void* data, const size_t bytes);
5243

5344
template<typename T>
54-
blake3_hasher& operator<<(const T& input)
55-
{
56-
update_impl<T>::__call(*this,input);
45+
blake3_hasher& operator<<(const T& input) {
46+
update_impl<T>::__call(*this, input);
5747
return *this;
5848
}
5949

60-
explicit inline operator blake3_hash_t() const
61-
{
62-
blake3_hash_t retval;
63-
// the blake3 docs say that the hasher can be finalized multiple times
64-
::blake3_hasher_finalize(&m_state,retval.data,sizeof(retval));
65-
return retval;
66-
}
50+
explicit operator blake3_hash_t() const;
6751
};
6852

6953
// Useful specializations

include/nbl/video/utilities/SIntendedSubmitInfo.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ struct SIntendedSubmitInfo final : core::Uncopyable
251251
}
252252
}
253253
// could have just called begin to reset but also need to reset with the release resources flag
254-
recordingCmdBuf->cmdbuf->reset(IGPUCommandBuffer::RESET_FLAGS::RELEASE_RESOURCES_BIT);
255-
recordingCmdBuf->cmdbuf->begin(IGPUCommandBuffer::USAGE::ONE_TIME_SUBMIT_BIT);
254+
if (!recordingCmdBuf->cmdbuf->reset(IGPUCommandBuffer::RESET_FLAGS::RELEASE_RESOURCES_BIT))
255+
return false;
256+
if (!recordingCmdBuf->cmdbuf->begin(IGPUCommandBuffer::USAGE::ONE_TIME_SUBMIT_BIT))
257+
return false;
256258

257259
return true;
258260
}

src/nbl/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ unset(NABLA_HEADERS_PUBLIC2 ${NBL_TMP_FULL_PATHS})
119119

120120
set(NBL_CORE_SOURCES
121121
${NBL_ROOT_PATH}/src/nbl/core/IReferenceCounted.cpp
122+
${NBL_ROOT_PATH}/src/nbl/core/hash/blake.cpp
122123
)
123124
set(NBL_SYSTEM_SOURCES
124125
${NBL_ROOT_PATH}/src/nbl/system/DefaultFuncPtrLoader.cpp
@@ -388,11 +389,6 @@ if(_NBL_BUILD_DPL_)
388389
target_link_libraries(Nabla INTERFACE tbb tbbmalloc tbbmalloc_proxy)
389390
endif()
390391

391-
# blake3
392-
target_link_libraries(Nabla PUBLIC
393-
blake3
394-
)
395-
396392
# boost
397393
target_include_directories(Nabla PUBLIC "${BOOST_PREPROCESSOR_INCLUDE}")
398394

src/nbl/asset/utils/CHLSLCompiler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,13 @@ std::string CHLSLCompiler::preprocessShader(std::string&& code, IShader::E_SHADE
352352
}
353353
catch (boost::wave::preprocess_exception& e)
354354
{
355-
preprocessOptions.logger.log("Boost.Wave %s exception caught!",system::ILogger::ELL_ERROR,e.what());
355+
preprocessOptions.logger.log("%s exception caught. %s [%s:%d:%d]",system::ILogger::ELL_ERROR,e.what(),e.description(),e.file_name(),e.line_no(),e.column_no());
356+
return {};
356357
}
357358
catch (...)
358359
{
359360
preprocessOptions.logger.log("Unknown exception caught!",system::ILogger::ELL_ERROR);
361+
return {};
360362
}
361363

362364
// for debugging cause MSVC doesn't like to show more than 21k LoC in TextVisualizer

src/nbl/core/hash/blake.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "nbl/core/hash/blake.h"
2+
3+
namespace nbl::core
4+
{
5+
6+
blake3_hasher::blake3_hasher()
7+
{
8+
::blake3_hasher_init(&m_state);
9+
}
10+
11+
blake3_hasher& blake3_hasher::update(const void* data, const size_t bytes)
12+
{
13+
::blake3_hasher_update(&m_state, data, bytes);
14+
return *this;
15+
}
16+
17+
blake3_hasher::operator blake3_hash_t() const
18+
{
19+
blake3_hash_t retval;
20+
// the blake3 docs say that the hasher can be finalized multiple times
21+
::blake3_hasher_finalize(&m_state, retval.data, sizeof(retval));
22+
return retval;
23+
}
24+
25+
}

0 commit comments

Comments
 (0)