From b09aa3ed818bac4a810f3015534f92e0f898cc04 Mon Sep 17 00:00:00 2001 From: Panagiotis Christopoulos Charitos Date: Wed, 12 Jun 2024 21:30:43 +0200 Subject: [PATCH] Fix the clang build --- AnKi/Gr/Common.h | 2 +- AnKi/Gr/Vulkan/VkCommandBuffer.cpp | 5 ++--- AnKi/Gr/Vulkan/VkGraphicsState.cpp | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/AnKi/Gr/Common.h b/AnKi/Gr/Common.h index a15d6eacd..280611c36 100644 --- a/AnKi/Gr/Common.h +++ b/AnKi/Gr/Common.h @@ -1035,7 +1035,7 @@ class ShaderReflection void validate() const { m_descriptor.validate(); - for(VertexAttributeSemantic semantic : EnumIterable()) + for([[maybe_unused]] VertexAttributeSemantic semantic : EnumIterable()) { ANKI_ASSERT(!m_vertex.m_vertexAttributeMask.get(semantic) || m_vertex.m_vkVertexAttributeLocations[semantic] != kMaxU8); } diff --git a/AnKi/Gr/Vulkan/VkCommandBuffer.cpp b/AnKi/Gr/Vulkan/VkCommandBuffer.cpp index d8536606a..be6d67eea 100644 --- a/AnKi/Gr/Vulkan/VkCommandBuffer.cpp +++ b/AnKi/Gr/Vulkan/VkCommandBuffer.cpp @@ -684,7 +684,7 @@ void CommandBuffer::traceRays(const BufferView& sbtBuffer, U32 sbtRecordSize32, ANKI_ASSERT(hitGroupSbtRecordCount > 0); ANKI_ASSERT(width > 0 && height > 0 && depth > 0); ANKI_ASSERT(self.m_rtProg); - const ShaderProgramImpl& sprog = static_cast(*self.m_rtProg); + [[maybe_unused]] const ShaderProgramImpl& sprog = static_cast(*self.m_rtProg); ANKI_ASSERT(rayTypeCount == sprog.getMissShaderCount() && "All the miss shaders should be in use"); ANKI_ASSERT((hitGroupSbtRecordCount % rayTypeCount) == 0); @@ -1087,8 +1087,7 @@ void CommandBuffer::setPushConstants(const void* data, U32 dataSize) { ANKI_VK_SELF(CommandBufferImpl); ANKI_ASSERT(data && dataSize && dataSize % 16 == 0); - const ShaderProgramImpl& prog = self.getBoundProgram(); - ANKI_ASSERT(prog.getReflection().m_descriptor.m_pushConstantsSize == dataSize + ANKI_ASSERT(static_cast(prog).getReflection().m_descriptor.m_pushConstantsSize == dataSize && "The bound program should have push constants equal to the \"dataSize\" parameter"); self.commandCommon(); diff --git a/AnKi/Gr/Vulkan/VkGraphicsState.cpp b/AnKi/Gr/Vulkan/VkGraphicsState.cpp index fd48e58d3..98b5b44fb 100644 --- a/AnKi/Gr/Vulkan/VkGraphicsState.cpp +++ b/AnKi/Gr/Vulkan/VkGraphicsState.cpp @@ -169,7 +169,7 @@ void GraphicsPipelineFactory::flushState(GraphicsStateTracker& state, VkCommandB // Find the PSO VkPipeline pso = VK_NULL_HANDLE; { - RLockGuard lock(m_mtx); + RLockGuard lock(m_mtx); auto it = m_map.find(state.m_globalHash); if(it != m_map.getEnd()) @@ -394,7 +394,7 @@ void GraphicsPipelineFactory::flushState(GraphicsStateTracker& state, VkCommandB // Now try to add the PSO to the hashmap { - WLockGuard lock(m_mtx); + WLockGuard lock(m_mtx); auto it = m_map.find(state.m_globalHash); if(it == m_map.getEnd())