From ec8df09d5241aaf9322b64d77da858d65025903d Mon Sep 17 00:00:00 2001 From: Sergey Yablokov Date: Tue, 5 Mar 2024 20:46:19 +0100 Subject: [PATCH] Remove unused variable --- internal/Dx/MemoryAllocatorDX.cpp | 1 + internal/SceneCPU.cpp | 1 + internal/SceneDX.cpp | 2 ++ internal/SceneGPU.h | 1 + internal/SceneVK.cpp | 1 + internal/Vk/MemoryAllocatorVK.cpp | 1 + internal/simd/simd_vec_sse.h | 3 +-- 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/Dx/MemoryAllocatorDX.cpp b/internal/Dx/MemoryAllocatorDX.cpp index 10d464f22..aacf04fcb 100644 --- a/internal/Dx/MemoryAllocatorDX.cpp +++ b/internal/Dx/MemoryAllocatorDX.cpp @@ -56,6 +56,7 @@ bool Ray::Dx::MemoryAllocator::AllocateNewPool(const uint32_t size) { const uint16_t pool_ndx = alloc_.AddPool(size); assert(pool_ndx == pools_.size() - 1); + (void)pool_ndx; } return SUCCEEDED(hr); } diff --git a/internal/SceneCPU.cpp b/internal/SceneCPU.cpp index b8c77bb1a..759d5f607 100644 --- a/internal/SceneCPU.cpp +++ b/internal/SceneCPU.cpp @@ -1390,6 +1390,7 @@ void Ray::Cpu::Scene::RebuildLightTree_nolock() { if (use_wide_bvh_) { const uint32_t root_node = FlattenBVH_r(light_nodes_.data(), 0, 0xffffffff, light_wnodes_); assert(root_node == 0); + (void)root_node; light_nodes_.clear(); } } diff --git a/internal/SceneDX.cpp b/internal/SceneDX.cpp index 9c0812d5a..5e0f4cbb3 100644 --- a/internal/SceneDX.cpp +++ b/internal/SceneDX.cpp @@ -80,6 +80,7 @@ void Ray::Dx::Scene::PrepareBindlessTextures_nolock() { const uint32_t off = bindless_tex_data_.srv_descr_pool.Alloc(bindless_textures_.capacity()).first; assert(off == 0); + (void)off; ID3D12Device *device = ctx_->device(); ID3D12DescriptorHeap *srv_descr_heap = bindless_tex_data_.srv_descr_pool.heap(); @@ -263,6 +264,7 @@ std::pair Ray::Dx::Scene::Build_HWRT_BLAS_nolock(const uint3 rt_blas_buffers_.emplace_back("RT BLAS Buffer", ctx_, eBufType::AccStructure, buf_size); const uint16_t pool_index = rt_blas_mem_alloc_.AddPool(buf_size); assert(pool_index == rt_blas_buffers_.size() - 1); + (void)pool_index; // try to allocate again mem_alloc = rt_blas_mem_alloc_.Alloc(AccStructAlignment, compact_size); assert(mem_alloc.offset != 0xffffffff); diff --git a/internal/SceneGPU.h b/internal/SceneGPU.h index cb6479baa..9dedcfcf5 100644 --- a/internal/SceneGPU.h +++ b/internal/SceneGPU.h @@ -2068,6 +2068,7 @@ inline void Ray::NS::Scene::RebuildLightTree_nolock() { aligned_vector temp_light_wnodes; const uint32_t root_node = FlattenBVH_r(temp_lnodes.data(), 0, 0xffffffff, temp_light_wnodes); assert(root_node == 0); + (void)root_node; light_wnodes_.Append(temp_light_wnodes.data(), temp_light_wnodes.size()); } diff --git a/internal/SceneVK.cpp b/internal/SceneVK.cpp index 41ff14bb5..ee82a59cb 100644 --- a/internal/SceneVK.cpp +++ b/internal/SceneVK.cpp @@ -432,6 +432,7 @@ std::pair Ray::Vk::Scene::Build_HWRT_BLAS_nolock(const uint3 rt_blas_buffers_.emplace_back("RT BLAS Buffer", ctx_, eBufType::AccStructure, buf_size); const uint16_t pool_index = rt_blas_mem_alloc_.AddPool(buf_size); assert(pool_index == rt_blas_buffers_.size() - 1); + (void)pool_index; // try to allocate again mem_alloc = rt_blas_mem_alloc_.Alloc(AccStructAlignment, uint32_t(compact_size)); assert(mem_alloc.offset != 0xffffffff); diff --git a/internal/Vk/MemoryAllocatorVK.cpp b/internal/Vk/MemoryAllocatorVK.cpp index 1e5e1a39c..e70624c6e 100644 --- a/internal/Vk/MemoryAllocatorVK.cpp +++ b/internal/Vk/MemoryAllocatorVK.cpp @@ -66,6 +66,7 @@ bool Ray::Vk::MemoryAllocator::AllocateNewPool(const uint32_t size) { const uint16_t pool_ndx = alloc_.AddPool(size); assert(pool_ndx == pools_.size() - 1); + (void)pool_ndx; } return res == VK_SUCCESS; } diff --git a/internal/simd/simd_vec_sse.h b/internal/simd/simd_vec_sse.h index 8d1986847..43b244660 100644 --- a/internal/simd/simd_vec_sse.h +++ b/internal/simd/simd_vec_sse.h @@ -714,9 +714,8 @@ template <> class simd_vec { #endif } template force_inline void set(const unsigned v) { - const int ndx = (i & 3); #if defined(USE_SSE41) - vec_ = _mm_insert_epi32(vec_, v, ndx); + vec_ = _mm_insert_epi32(vec_, v, i & 3); #else comp_[i] = v; #endif