Skip to content

Commit f44c0eb

Browse files
committed
make Nabla Clang build work
1 parent 09ceaf6 commit f44c0eb

File tree

12 files changed

+38
-28
lines changed

12 files changed

+38
-28
lines changed

cmake/adjust/template/vendor/CXX_Clang.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ set(NBL_CXX_RELWITHDEBINFO_COMPILE_OPTIONS "")
1515

1616
# Global
1717
list(APPEND NBL_CXX_COMPILE_OPTIONS
18-
-Wno-everything # TMP
1918
-Wextra
2019
-fno-strict-aliasing
2120
-msse4.2

cmake/adjust/template/vendor/C_Clang.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ set(NBL_C_RELEASE_COMPILE_OPTIONS
1414
set(NBL_C_RELWITHDEBINFO_COMPILE_OPTIONS "")
1515

1616
# Global
17-
list(APPEND NBL_C_COMPILE_OPTIONS
18-
-Wno-everything # TMP
17+
list(APPEND NBL_C_COMPILE_OPTIONS
1918
-Wextra
2019
-fno-strict-aliasing
2120
-msse4.2

include/nbl/asset/IRenderpass.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ class NBL_API2 IRenderpass
8383
};
8484

8585
// The arrays pointed to by this array must be terminated by `DepthStencilAttachmentsEnd` value, which implicitly satisfies a few VUIDs
86-
constexpr static inline SDepthStencilAttachmentDescription DepthStencilAttachmentsEnd = {};
86+
static const SDepthStencilAttachmentDescription DepthStencilAttachmentsEnd; // have to initialize out of line because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88165
8787
const SDepthStencilAttachmentDescription* depthStencilAttachments = &DepthStencilAttachmentsEnd;
8888
// The arrays pointed to by this array must be terminated by `ColorAttachmentsEnd` value, which implicitly satisfies a few VUIDs
89-
constexpr static inline SColorAttachmentDescription ColorAttachmentsEnd = {};
89+
static const SColorAttachmentDescription ColorAttachmentsEnd; // have to initialize out of line because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88165
9090
const SColorAttachmentDescription* colorAttachments = &ColorAttachmentsEnd;
9191

9292
struct SSubpassDescription final
@@ -200,7 +200,7 @@ class NBL_API2 IRenderpass
200200
SColorAttachmentsRef colorAttachments[MaxColorAttachments] = {};
201201

202202
// The arrays pointed to by this array must be terminated by `InputAttachmentsEnd` value
203-
constexpr static inline SInputAttachmentRef InputAttachmentsEnd = {};
203+
static const SInputAttachmentRef InputAttachmentsEnd;
204204
const SInputAttachmentRef* inputAttachments = &InputAttachmentsEnd;
205205

206206
struct SPreserveAttachmentRef
@@ -233,7 +233,7 @@ class NBL_API2 IRenderpass
233233
// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkSubpassDescription2.html#VUID-VkSubpassDescription2-pipelineBindPoint-04953
234234
//E_PIPELINE_BIND_POINT pipelineBindPoint : 2 = EPBP_GRAPHICS;
235235
};
236-
constexpr static inline SSubpassDescription SubpassesEnd = {};
236+
static const SSubpassDescription SubpassesEnd;
237237
const SSubpassDescription* subpasses = &SubpassesEnd;
238238

239239
struct SSubpassDependency final
@@ -259,7 +259,7 @@ class NBL_API2 IRenderpass
259259
bool valid() const;
260260
};
261261
// The arrays pointed to by this array must be terminated by `DependenciesEnd` value
262-
constexpr static inline SSubpassDependency DependenciesEnd = {};
262+
static const SSubpassDependency DependenciesEnd;
263263
const SSubpassDependency* dependencies = &DependenciesEnd;
264264

265265

@@ -380,6 +380,12 @@ class NBL_API2 IRenderpass
380380
uint32_t m_loadOpColorAttachmentEnd = ~0u;
381381
};
382382

383+
constexpr inline IRenderpass::SCreationParams::SDepthStencilAttachmentDescription IRenderpass::SCreationParams::DepthStencilAttachmentsEnd = {};
384+
constexpr inline IRenderpass::SCreationParams::SColorAttachmentDescription IRenderpass::SCreationParams::ColorAttachmentsEnd = {};
385+
constexpr inline IRenderpass::SCreationParams::SSubpassDescription::SInputAttachmentRef IRenderpass::SCreationParams::SSubpassDescription::InputAttachmentsEnd = {};
386+
constexpr inline IRenderpass::SCreationParams::SSubpassDescription IRenderpass::SCreationParams::SubpassesEnd = {};
387+
constexpr inline IRenderpass::SCreationParams::SSubpassDependency IRenderpass::SCreationParams::DependenciesEnd = {};
388+
383389
inline bool IRenderpass::compatible(const IRenderpass* other) const
384390
{
385391
// If you find yourself spending a lot of time here in your profile, go ahead and implement a precomputed hash and store it in the renderpass

include/nbl/asset/filters/CBlitImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ class CBlitImageFilter :
464464

465465
auto phaseCount = IBlitUtilities::getPhaseCount(inExtentLayerCount.xyz, outExtentLayerCount.xyz, inImageType);
466466
phaseCount = hlsl::max(phaseCount,hlsl::uint32_t3(1,1,1));
467-
const auto axisOffsets = blit_utils_t::template getScaledKernelPhasedLUTAxisOffsets(phaseCount,real_window_size);
467+
const auto axisOffsets = blit_utils_t::getScaledKernelPhasedLUTAxisOffsets(phaseCount,real_window_size);
468468
constexpr auto MaxAxisCount = 3;
469469
lut_value_t* scaledKernelPhasedLUTPixel[MaxAxisCount];
470470
for (auto i = 0; i < MaxAxisCount; ++i)

include/nbl/asset/filters/kernels/WeightFunctions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,12 @@ class CWeightFunction1D final : public impl::IWeightFunction1D<decltype(std::dec
337337
inline void stretchAndScale(const float stretchFactor)
338338
{
339339
stretch(stretchFactor);
340-
this->scale(base_t::value_t(1)/stretchFactor);
340+
this->scale(typename base_t::value_t(1)/stretchFactor);
341341
}
342342

343343
inline base_t::value_t weight(const float x) const
344344
{
345-
return static_cast<double>(this->getTotalScale()*function_t::weight<derivative>(x*this->getInvStretch()));
345+
return static_cast<double>(this->getTotalScale()*function_t::template weight<derivative>(x*this->getInvStretch()));
346346
}
347347

348348
// Integral of `weight(x) dx` from -INF to +INF

include/nbl/asset/utils/CSPIRVIntrospector.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,13 @@ class NBL_API2 CSPIRVIntrospector : public core::Uncopyable
208208
// `memberStrides[i]` only relevant if `memberTypes[i]->isArray()`
209209
inline ptr_t<member_stride_t,Mutable> memberStrides() const {return memberOffsets()+memberCount;}
210210
using member_matrix_info_t = MatrixInfo;
211-
inline ptr_t<member_matrix_info_t,Mutable> memberMatrixInfos() const {return reinterpret_cast<ptr_t<member_matrix_info_t,Mutable>&>(memberStrides()+memberCount); }
211+
inline ptr_t<member_matrix_info_t,Mutable> memberMatrixInfos() const
212+
{
213+
auto t = memberStrides() + memberCount;
214+
215+
return reinterpret_cast<ptr_t<member_matrix_info_t,Mutable>&>(t);
216+
217+
}
212218

213219
constexpr static inline size_t StoragePerMember = sizeof(member_type_t)+sizeof(member_name_t)+sizeof(member_size_t)+sizeof(member_offset_t)+sizeof(member_stride_t)+sizeof(member_matrix_info_t);
214220

include/nbl/video/ILogicalDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ inline bool ILogicalDevice::validateMemoryBarrier(const uint32_t queueFamilyInde
15021502
return false;
15031503
};
15041504
// CANNOT CHECK: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier2-oldLayout-01197
1505-
if (mismatchedLayout.operator()<false>(barrier.oldLayout) || mismatchedLayout.operator()<true>(barrier.newLayout))
1505+
if (mismatchedLayout.template operator()<false>(barrier.oldLayout) || mismatchedLayout.template operator()<true>(barrier.newLayout))
15061506
return false;
15071507
}
15081508

include/nbl/video/utilities/CSubpassKiln.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class CSubpassKiln
198198
if (begin==end)
199199
return;
200200

201-
bake_impl(cmdbuf->getOriginDevice()->getPhysicalDevice()->getLimits().indirectDrawCount, drawIndirectBuffer, drawCountBuffer)(cmdbuf, begin, end);
201+
bake_impl(cmdbuf->getOriginDevice()->getPhysicalDevice()->getLimits().drawIndirectCount, drawIndirectBuffer, drawCountBuffer)(cmdbuf, begin, end);
202202
}
203203

204204
protected:

src/nbl/video/CVulkanCommandBuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ bool CVulkanCommandBuffer::beginRenderPass_impl(const SRenderpassBeginInfo& info
661661
.renderArea = info.renderArea,
662662
// Implicitly but could be optimizedif needed
663663
// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkRenderPassBeginInfo.html#VUID-VkRenderPassBeginInfo-clearValueCount-00902
664-
.clearValueCount = vk_clearValues.size()/sizeof(VkClearValue),
664+
.clearValueCount = static_cast<uint32_t>(vk_clearValues.size()/sizeof(VkClearValue)),
665665
// Implicit
666666
// https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkRenderPassBeginInfo.html#VUID-VkRenderPassBeginInfo-clearValueCount-04962
667667
.pClearValues = vk_clearValues.data()

src/nbl/video/CVulkanDeviceMemoryBacked.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CVulkanDeviceMemoryBacked<Interface>::CVulkanDeviceMemoryBacked(
4040
assert(vkHandle!=VK_NULL_HANDLE);
4141
}
4242

43-
template CVulkanDeviceMemoryBacked<IGPUBuffer>;
44-
template CVulkanDeviceMemoryBacked<IGPUImage>;
43+
template class CVulkanDeviceMemoryBacked<IGPUBuffer>;
44+
template class CVulkanDeviceMemoryBacked<IGPUImage>;
4545

4646
}

0 commit comments

Comments
 (0)