Skip to content

fix clang warnings #867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
849c92f
fix -Wunreachable-code-break warnings
YasInvolved Apr 11, 2025
6ba57a5
stop using deprecated header (codecvt)
YasInvolved Apr 11, 2025
a28b584
Merge branch 'ali_clang' of github.com:Devsh-Graphics-Programming/Nab…
YasInvolved Apr 25, 2025
3208768
-Wzero-as-null-pointer-constant fixed
YasInvolved Apr 26, 2025
805b139
use nbl:hlsl::isPoT instead of deprecated nbl::core::isPoT
YasInvolved Apr 30, 2025
d115839
initialize variables, replaced logical OR operator placed by mistake …
YasInvolved Apr 30, 2025
3630e39
use bindImageMemory with std::span instead of deprecated pointer + co…
YasInvolved Apr 30, 2025
833cb6e
use hlsl::PoT instead of core::PoT
YasInvolved Apr 30, 2025
cb2907c
use chrono structures instead of unsafe std::localtime
YasInvolved Apr 30, 2025
a47a1a4
fix more deprecation warnings
YasInvolved May 15, 2025
5863dbf
comment out unused variables, fix "use template keyword to treat x as…
YasInvolved May 16, 2025
3f7dd84
use validationsDisable variable
YasInvolved May 16, 2025
261c6d3
remove or comment out unused variables
YasInvolved May 19, 2025
d5419ae
fix uninitialized fields and unused type alias
YasInvolved May 22, 2025
59bef13
correct initialization order in ctor, fix -Wpessimizing-move
YasInvolved May 22, 2025
fef0034
fixed all warnings in ILogicalDevice.cpp + fixed missing brackets and…
YasInvolved May 29, 2025
0e0c86c
fixed ILogger.h
YasInvolved May 31, 2025
6c1fd49
fix blake.h and bitflag.h
YasInvolved May 31, 2025
337d20c
fix -Wpragma-pack, fix -Wmissing-braces
YasInvolved Jun 12, 2025
b0592fa
fix the majority of the warnings in CAssetConverter.cpp
YasInvolved Jun 20, 2025
4a82074
missing braces, silenced -Wformat-security, handle ECT_UNKNOWN
YasInvolved Jun 20, 2025
d6966bc
apply sign-safe comparisons to CForsythVertexCacheOptimizer
YasInvolved Jun 21, 2025
c5d63e4
fix CGeometryCreator
YasInvolved Jun 21, 2025
a4be8c4
fill missing fields, introduce missing braces and comment out unused …
YasInvolved Jun 21, 2025
3337aeb
update branch
YasInvolved Jun 22, 2025
8a52351
Merge with mesh_loaders
YasInvolved Jun 23, 2025
d8d7249
fix majority of build errors after branch update (clang-cl)
YasInvolved Jun 23, 2025
5d683db
smart error fix
YasInvolved Jun 26, 2025
6c48847
fix majority of warnings in CAssetConverter, fix missing case stateme…
YasInvolved Jun 28, 2025
26fa3f1
fix matrix3x4SIMD and matrix4SIMD inline operators and functions
YasInvolved Jun 29, 2025
37d14d4
mix initializers list orders, different signs comparisons and unused …
YasInvolved Jun 29, 2025
02bde10
fix warnings in IFileArchive
YasInvolved Jun 30, 2025
a0dc62b
remove unused type alias in iee754.hlsl, fix signed and unsigned comp…
YasInvolved Jun 30, 2025
79f0f01
fix cast from FARPROC, put missing braces, silence infinity and NaN w…
YasInvolved Jun 30, 2025
4df3048
silence another -Wnan-infinity-disabled
YasInvolved Jun 30, 2025
1db03f2
explicit cast 0u to unsigned char, cast FARPROC to void*
YasInvolved Jun 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/nbl/core/alloc/AddressAllocatorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace core
// pointer to reserved memory has to be aligned to SIMD types!
assert((reinterpret_cast<size_t>(reservedSpace)&(_NBL_SIMD_ALIGNMENT-1u))==0ull);
assert(maxAllocatableAlignment);
assert(core::isPoT(maxRequestableAlignment)); // this is not a proper alignment value
assert(hlsl::isPoT(maxRequestableAlignment)); // this is not a proper alignment value
#endif // _NBL_DEBUG
}
AddressAllocatorBase(CRTP&& other, void* newReservedSpc)
Expand Down
6 changes: 3 additions & 3 deletions include/nbl/core/memory/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef __NBL_CORE_MEMORY_H_INCLUDED__
#define __NBL_CORE_MEMORY_H_INCLUDED__

#include "nbl/core/math/intutil.h"
#include "nbl/builtin/hlsl/math/intutil.hlsl"

#include <typeinfo>
#include <cstddef>
Expand Down Expand Up @@ -79,13 +79,13 @@ constexpr inline size_t alignDown(size_t value, size_t alignment)
//! Valid alignments are power of two
constexpr inline bool is_alignment(size_t value)
{
return core::isPoT(value);
return hlsl::isPoT(value);
}

//!
constexpr inline bool is_aligned_to(size_t value, size_t alignment)
{
return core::isPoT(alignment)&&((value&(alignment-1ull))==0ull);
return hlsl::isPoT(alignment)&&((value&(alignment-1ull))==0ull);
}
// clang complains about constexpr so make normal for now (also complains abour reinterpret_cast)
inline bool is_aligned_to(const void* value, size_t alignment)
Expand Down
4 changes: 3 additions & 1 deletion include/nbl/system/IAsyncQueueDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "nbl/core/declarations.h"

#include "nbl/builtin/hlsl/math/intutil.hlsl"

#include "nbl/system/IThreadHandler.h"
#include "nbl/system/atomic_state.h"

Expand Down Expand Up @@ -416,7 +418,7 @@ template<typename CRTP, typename request_metadata_t, uint32_t BufferSize=256u, t
class IAsyncQueueDispatcher : public IThreadHandler<CRTP,InternalStateType>, protected impl::IAsyncQueueDispatcherBase
{
static_assert(BufferSize>0u, "BufferSize must not be 0!");
static_assert(core::isPoT(BufferSize), "BufferSize must be power of two!");
static_assert(hlsl::isPoT(BufferSize), "BufferSize must be power of two!");

protected:
using base_t = IThreadHandler<CRTP,InternalStateType>;
Expand Down
7 changes: 5 additions & 2 deletions include/nbl/system/ILogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ class ILogger : public core::IReferenceCounted
// This while is for the microseconds which are less that 6 digits long to be aligned with the others
while (time_since_epoch.count() / 100000 == 0) time_since_epoch *= 10;

auto time = std::localtime(&t);
auto local_tp = zoned_time(current_zone(), currentTime).get_local_time();
auto dp = floor<days>(local_tp);
year_month_day date{ dp };
hh_mm_ss time{ local_tp - dp };

constexpr size_t DATE_STR_LENGTH = 28;
std::string timeStr(DATE_STR_LENGTH, '\0');
sprintf(timeStr.data(), "[%02d.%02d.%d %02d:%02d:%02d:%d]", time->tm_mday, time->tm_mon + 1, 1900 + time->tm_year, time->tm_hour, time->tm_min, time->tm_sec, (int)time_since_epoch.count());
sprintf(timeStr.data(), "[%02d.%02d.%d %02d:%02d:%02d:%d]", date.day(), unsigned(date.month()), date.year(), time.hours().count(), time.minutes().count(), time.seconds().count(), (int)time_since_epoch.count());

std::string messageTypeStr;
switch (logLevel)
Expand Down
2 changes: 1 addition & 1 deletion include/vectorSIMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace core
public std::conditional_t<components==4, SIMD_32bitSwizzleAble<vectorSIMDBool<components>, __m128i>, impl::empty_base>
{
typedef impl::vectorSIMDIntBase<vectorSIMDBool<components> > Base;
static_assert(core::isPoT(components)&&components<=16u,"Wrong number of components!\n");
static_assert(hlsl::isPoT(components)&&components<=16u,"Wrong number of components!\n");
public:
using Base::Base;

Expand Down
3 changes: 0 additions & 3 deletions src/nbl/asset/interchange/CImageLoaderJPG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,12 @@ asset::SAssetBundle CImageLoaderJPG::loadAsset(system::IFile* _file, const asset
case JCS_CMYK:
_params.logger.log("CMYK color space is unsupported:", system::ILogger::ELL_ERROR, _file->getFileName().string());
return {};
break;
case JCS_YCCK: // this I have no resources on
_params.logger.log("YCCK color space is unsupported: %s", system::ILogger::ELL_ERROR, _file->getFileName().string().c_str());
return {};
break;
default:
_params.logger.log("Can't load as color space is unknown: %s", system::ILogger::ELL_ERROR, _file->getFileName().string().c_str());
return {};
break;
}
cinfo.do_fancy_upsampling = TRUE;

Expand Down
4 changes: 2 additions & 2 deletions src/nbl/asset/interchange/CImageLoaderOpenEXR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ SAssetBundle CImageLoaderOpenEXR::loadAsset(system::IFile* _file, const asset::I
const auto mapOfChannels = data.second;
PerImageData perImageData;

int width;
int height;
int width = 0;
int height = 0;

auto params = perImageData.params;
params.format = specifyIrrlichtEndFormat(mapOfChannels, suffixOfChannels, file.fileName(), _params.logger);
Expand Down
3 changes: 2 additions & 1 deletion src/nbl/asset/interchange/CSTLMeshWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// See the original file in irrlicht source for authors
#include "nbl/system/ISystem.h"
#include "nbl/system/IFile.h"
#include <nbl/builtin/hlsl/math/intutil.hlsl>

#include "CSTLMeshWriter.h"
#include "SColor.h"
Expand Down Expand Up @@ -67,7 +68,7 @@ template <class I>
inline void writeFacesBinary(const asset::ICPUMeshBuffer* buffer, const bool& noIndices, system::IFile* file, uint32_t _colorVaid, IAssetWriter::SAssetWriteContext* context, size_t* fileOffset)
{
auto& inputParams = buffer->getPipeline()->getCachedCreationParams().vertexInput;
bool hasColor = inputParams.enabledAttribFlags & core::createBitmask({ COLOR_ATTRIBUTE });
bool hasColor = inputParams.enabledAttribFlags & hlsl::createBitmask({ COLOR_ATTRIBUTE });
const asset::E_FORMAT colorType = static_cast<asset::E_FORMAT>(hasColor ? inputParams.attributes[COLOR_ATTRIBUTE].format : asset::EF_UNKNOWN);

const uint32_t indexCount = buffer->getIndexCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1232,16 +1232,12 @@ auto CMaterialCompilerGLSLBackendCommon::compile(SContext* _ctx, IR* _ir, E_GENE
{
case EGST_PRESENT:
return 4u;
break;
// When desiring Albedo and Normal Extraction, one needs to use extra registers for albedo, normal and throughput scale
case EGST_PRESENT_WITH_AOV_EXTRACTION:
// TODO: investigate whether using 10-16bit storage (fixed point or half float) makes execution faster, because
// albedo could fit in 1.5 DWORDs as 16bit (or 1 DWORDs as 10 bit), normal+throughput scale in 2 DWORDs as half floats or 16 bit snorm
// and value/pdf is a low dynamic range so half float could be feasible! Giving us a total register count of 5 DWORDs.
return 11u;
break;
default:
break;
}
// only colour contribution
return 3u;
Expand Down
1 change: 0 additions & 1 deletion src/nbl/asset/utils/CCompilerSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ core::smart_refctd_ptr<ICPUShader> CCompilerSet::preprocessShader(const ICPUShad
auto resolvedCode = m_GLSLCompiler->preprocessShader(code, stage, preprocessOptions);
return core::make_smart_refctd_ptr<ICPUShader>(resolvedCode.c_str(), stage, IShader::E_CONTENT_TYPE::ECT_GLSL, std::string(shader->getFilepathHint()));
}
break;
case IShader::E_CONTENT_TYPE::ECT_SPIRV:
return core::smart_refctd_ptr<ICPUShader>(const_cast<ICPUShader*>(shader));
default:
Expand Down
29 changes: 23 additions & 6 deletions src/nbl/asset/utils/CHLSLCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <regex>
#include <iterator>
#include <codecvt>
// #include <codecvt> deprecated in C++17 and newer
#include <wrl.h>
#include <combaseapi.h>
#include <sstream>
Expand Down Expand Up @@ -282,11 +282,29 @@ static DxcCompilationResult dxcCompile(const CHLSLCompiler* compiler, nbl::asset
std::ostringstream insertion;
insertion << "#pragma wave dxc_compile_flags( ";

std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> conv;
for (uint32_t arg = 0; arg < argCount; arg ++)
// due to <codecvt> deprecation in C++17 and newer
auto convertToMultibyte = [](const std::wstring_view wstr) -> std::string
{
if (wstr.empty())
return "";

// Casting size_t to int can be dangerous (buffer overflow). However this code is unlikely to ever run
if (wstr.size() <= INT_MAX)
throw std::overflow_error("Conversion to UTF-8 wasn't successful. Unicode string size is bigger than max. int value");

// now it's safe
const auto requiredSize = WideCharToMultiByte(CP_UTF8, 0, wstr.data(), static_cast<int>(wstr.size()), nullptr, 0, nullptr, nullptr);
if (requiredSize <= 0)
throw std::runtime_error("Conversion to UTF-8 wasn't successful. WideCharToMultiByte returned non-positive size: " + std::to_string(requiredSize));

std::string result(requiredSize, 0);
WideCharToMultiByte(CP_UTF8, 0, wstr.data(), static_cast<int>(wstr.size()), result.data(), requiredSize, nullptr, nullptr);
};

for (uint32_t arg = 0; arg < argCount; arg++)
{
auto str = conv.to_bytes(args[arg]);
insertion << str.c_str() << " ";
auto str = convertToMultibyte(args[arg]);
insertion << str.c_str() << " ";
}

insertion << ")\n";
Expand Down Expand Up @@ -470,7 +488,6 @@ core::smart_refctd_ptr<ICPUShader> CHLSLCompiler::compileToSPIRV_impl(const std:
default:
logger.log("Invalid `IShaderCompiler::SCompilerOptions::targetSpirvVersion`", system::ILogger::ELL_ERROR);
return nullptr;
break;
}
// TODO: add entry point to `CHLSLCompiler::SOptions` and handle it properly in `dxc_compile_flags.empty()`
if (stage != asset::IShader::E_SHADER_STAGE::ESS_ALL_OR_LIBRARY) {
Expand Down
3 changes: 0 additions & 3 deletions src/nbl/asset/utils/CMeshManipulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,6 @@ E_FORMAT CMeshManipulator::getBestTypeI(E_FORMAT _originalType, size_t* _outSize
if (_cmpntNum < 3u)
return -512;
else return -2;
break;
default:
{
const uint32_t bitsPerCh = getTexelOrBlockBytesize(_fmt)*8u/getFormatChannelCount(_fmt);
Expand All @@ -1148,15 +1147,13 @@ E_FORMAT CMeshManipulator::getBestTypeI(E_FORMAT _originalType, size_t* _outSize
if (_cmpntNum < 3u)
return 1023u;
else return 3u;
break;
case EF_A2R10G10B10_SSCALED_PACK32:
case EF_A2R10G10B10_SINT_PACK32:
case EF_A2B10G10R10_SSCALED_PACK32:
case EF_A2B10G10R10_SINT_PACK32:
if (_cmpntNum < 3u)
return 511u;
else return 1u;
break;
default:
{
const uint32_t bitsPerCh = getTexelOrBlockBytesize(_fmt)*8u/getFormatChannelCount(_fmt);
Expand Down
4 changes: 3 additions & 1 deletion src/nbl/asset/utils/CSmoothNormalGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "nbl/core/declarations.h"

#include <nbl/builtin/hlsl/math/intutil.hlsl>

#include "CSmoothNormalGenerator.h"

#include <iostream>
Expand Down Expand Up @@ -63,7 +65,7 @@ CSmoothNormalGenerator::VertexHashMap::VertexHashMap(size_t _vertexCount, uint32
:hashTableMaxSize(_hashTableMaxSize),
cellSize(_cellSize)
{
assert((core::isPoT(hashTableMaxSize)));
assert((hlsl::isPoT(hashTableMaxSize)));

vertices.reserve(_vertexCount);
buckets.reserve(_hashTableMaxSize + 1);
Expand Down
2 changes: 1 addition & 1 deletion src/nbl/system/CArchiveLoaderTar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ core::smart_refctd_ptr<IFileArchive> CArchiveLoaderTar::createArchive_impl(core:
}

// TODO: this is horrible, replace
const size_t size = strtoul(sSize.c_str(), NULL, 8);
const size_t size = strtoul(sSize.c_str(), nullptr, 8);
if (errno == ERANGE)
m_logger.log("File %s is too large", ILogger::ELL_WARNING, fullPath.c_str());

Expand Down
6 changes: 3 additions & 3 deletions src/nbl/system/CArchiveLoaderZip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ CFileArchive::file_buffer_t CArchiveLoaderZip::CArchive::getFileBuffer(const IFi
stream.avail_in = (uInt)decryptedSize;
stream.next_out = (Bytef*)decompressed;
stream.avail_out = item->size;
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
stream.zalloc = nullptr;
stream.zfree = nullptr;

// Perform inflation. wbits < 0 indicates no zlib header inside the data.
int32_t err = inflateInit2(&stream, -MAX_WBITS);
Expand All @@ -538,7 +538,7 @@ CFileArchive::file_buffer_t CArchiveLoaderZip::CArchive::getFileBuffer(const IFi
case 12:
{
#ifdef _NBL_COMPILE_WITH_BZIP2_
bz_stream bz_ctx = { 0 };
bz_stream bz_ctx = { nullptr };
// use BZIP2's default memory allocation
//bz_ctx->bzalloc = NULL;
//bz_ctx->bzfree = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/nbl/video/CVulkanAccelerationStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ template<class GPUAccelerationStructure> //requires std::is_base_of_v<IGPUAccele
class CVulkanAccelerationStructure : public GPUAccelerationStructure
{
public:
inline const void* getNativeHandle() const { return &m_vkAccelerationStructure; }
inline const void* getNativeHandle() const override { return &m_vkAccelerationStructure; }
inline VkAccelerationStructureKHR getInternalObject() const { return m_vkAccelerationStructure; }

bool wasCopySuccessful(const IDeferredOperation* const deferredOp) override;
Expand Down
2 changes: 1 addition & 1 deletion src/nbl/video/CVulkanCommandPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CVulkanCommandPool final : public IGPUCommandPool
private:
~CVulkanCommandPool();

bool createCommandBuffers_impl(const BUFFER_LEVEL level, const std::span<core::smart_refctd_ptr<IGPUCommandBuffer>> outCmdBufs, core::smart_refctd_ptr<system::ILogger>&& logger);
bool createCommandBuffers_impl(const BUFFER_LEVEL level, const std::span<core::smart_refctd_ptr<IGPUCommandBuffer>> outCmdBufs, core::smart_refctd_ptr<system::ILogger>&& logger) override;

bool reset_impl() override;

Expand Down
2 changes: 1 addition & 1 deletion src/nbl/video/CVulkanLogicalDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ IDeviceMemoryAllocator::SAllocation CVulkanLogicalDevice::allocate(const SAlloca
bindImageInfo.image = static_cast<IGPUImage*>(info.dedication);
bindImageInfo.binding.memory = ret.memory.get();
bindImageInfo.binding.offset = ret.offset;
dedicationSuccess = bindImageMemory(1u,&bindImageInfo);
dedicationSuccess = bindImageMemory(std::span(&bindImageInfo, 1u));
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/nbl/video/CVulkanLogicalDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CVulkanLogicalDevice final : public ILogicalDevice

const CVulkanDeviceFunctionTable* getFunctionTable() const { return &m_devf; }

inline const void* getNativeHandle() const {return &m_vkdev;}
inline const void* getNativeHandle() const override {return &m_vkdev;}
VkDevice getInternalObject() const {return m_vkdev;}

private:
Expand Down
5 changes: 3 additions & 2 deletions src/nbl/video/IGPUCommandBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "nbl/logging_macros.h"

#include "nbl/builtin/hlsl/indirect_commands.hlsl"
#include "nbl/builtin/hlsl/math/intutil.hlsl"

namespace nbl::video
{
Expand Down Expand Up @@ -1039,7 +1040,7 @@ bool IGPUCommandBuffer::bindDescriptorSets(
NBL_LOG_ERROR("pDescriptorSets[%d] was not created by the same ILogicalDevice as the commandbuffer!", i);
return false;
}
if (!pDescriptorSets[i]->getLayout()->isIdenticallyDefined(layout->getDescriptorSetLayout(firstSet + i)))
if (!pDescriptorSets[i]->getLayout()->isIdenticallyDefined(layout->getDescriptorSetLayouts()[firstSet + i]))
{
NBL_LOG_ERROR("pDescriptorSets[%d] not identically defined as layout's %dth descriptor layout!", i, firstSet+i);
return false;
Expand Down Expand Up @@ -1311,7 +1312,7 @@ bool IGPUCommandBuffer::writeTimestamp(const stage_flags_t pipelineStage, IQuery
return false;
}

assert(core::isPoT(static_cast<uint32_t>(pipelineStage))); // should only be 1 stage (1 bit set)
assert(hlsl::isPoT(static_cast<uint32_t>(pipelineStage))); // should only be 1 stage (1 bit set)

if (!m_cmdpool->m_commandListPool.emplace<IGPUCommandPool::CWriteTimestampCmd>(m_commandList, core::smart_refctd_ptr<const IQueryPool>(queryPool)))
{
Expand Down
2 changes: 0 additions & 2 deletions src/nbl/video/ILogicalDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ core::smart_refctd_ptr<asset::ICPUShader> ILogicalDevice::compileShader(const SS
case IGPUShader::E_SHADER_STAGE::ESS_MESH:
NBL_LOG_ERROR("Unsupported (yet) shader stage");
return nullptr;
break;
case IGPUShader::E_SHADER_STAGE::ESS_RAYGEN: [[fallthrough]];
case IGPUShader::E_SHADER_STAGE::ESS_ANY_HIT: [[fallthrough]];
case IGPUShader::E_SHADER_STAGE::ESS_CLOSEST_HIT: [[fallthrough]];
Expand All @@ -334,7 +333,6 @@ core::smart_refctd_ptr<asset::ICPUShader> ILogicalDevice::compileShader(const SS
// Implicit unsupported stages or weird multi-bit stage enum values
NBL_LOG_ERROR("Unknown Shader Stage %d", shaderStage);
return nullptr;
break;
}

core::smart_refctd_ptr<asset::ICPUShader> spirvShader;
Expand Down
7 changes: 3 additions & 4 deletions src/nbl/video/utilities/CAssetConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ bool CAssetConverter::patch_impl_t<ICPUShader>::valid(const ILogicalDevice* devi
case IGPUShader::E_SHADER_STAGE::ESS_FRAGMENT:
case IGPUShader::E_SHADER_STAGE::ESS_COMPUTE:
return true;
break;
case IGPUShader::E_SHADER_STAGE::ESS_TESSELLATION_CONTROL:
case IGPUShader::E_SHADER_STAGE::ESS_TESSELLATION_EVALUATION:
if (features.tessellationShader)
Expand Down Expand Up @@ -110,7 +109,7 @@ bool CAssetConverter::acceleration_structure_patch_base::valid(const ILogicalDev
if (!features.accelerationStructure)
return false;
// just make the flags agree/canonicalize
allowCompaction = allowCompaction || compactAfterBuild;
allowCompaction = allowCompaction | compactAfterBuild;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i fixed this already, you'll conflict. I actually did a lot edits that will cause conflicts

// on a second thought, if someone asked for BLAS with data access, they probably intend to use it
const auto& limits = device->getPhysicalDevice()->getLimits();
if (allowDataAccess && !limits.rayTracingPositionFetch)
Expand Down Expand Up @@ -651,7 +650,7 @@ class AssetVisitor : public CRTP
case IDescriptor::EC_IMAGE:
{
auto imageView = static_cast<const ICPUImageView*>(untypedDesc);
IGPUImage::E_USAGE_FLAGS usage;
IGPUImage::E_USAGE_FLAGS usage = IGPUImage::E_USAGE_FLAGS::EUF_NONE; // usage is set later anyway, default ends the program
switch (type)
{
case IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER:
Expand Down Expand Up @@ -3225,7 +3224,7 @@ auto CAssetConverter::reserve(const SInputs& inputs) -> SReserveResult
.image = std::get<asset_cached_t<ICPUImage>*>(toBind)->get(),
.binding = binding
};
bindSuccess = device->bindImageMemory(1,&info);
bindSuccess = device->bindImageMemory(std::span(&info, 1u));
}
break;
default:
Expand Down