diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index c4c67eb5..a70332c2 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -2,9 +2,9 @@ name: Validation Build on: push: - branches: - - 'master' - - 'dev' +# branches: +# - 'master' +# - 'dev' paths-ignore: - '**.md' - '**.glsl' diff --git a/CMakeLists.txt b/CMakeLists.txt index 7983f1bd..0ea5fbfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13 FATAL_ERROR) include(CMakeDependentOption) @@ -22,7 +22,8 @@ foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${OUTPUT_DIR}) endforeach() -option(GATLING_BUILD_HDGATLING "Build the gatling hydra render delegate." ON) +option(GTL_BUILD_HDGATLING "Build the gatling hydra render delegate." ON) +option(GTL_VERBOSE "Enable verbose logging." OFF) if(${GATLING_BUILD_HDGATLING}) find_package(USD REQUIRED HINTS ${USD_ROOT} NAMES pxr) diff --git a/cmake/BuildConfig.cmake b/cmake/BuildConfig.cmake index 38dabd28..3af763b5 100644 --- a/cmake/BuildConfig.cmake +++ b/cmake/BuildConfig.cmake @@ -22,3 +22,20 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of buil # Append list of configs for multi-output generators like VS list(APPEND CMAKE_CONFIGURATION_TYPES "Develop") + + +# TODO: define GTL_COMPILE_OPTIONS that is then manually set for each target +# TODO: define GTL_LINK_OPTIONS -> target_link_options (CMake 3.13). e.g. warnings as errors? +if(MSVC) + set(GTL_COMPILE_OPTIONS "")#"/Wall") + # Disable "not enough arguments for function-like macro invocation" warning caused + # by the transitive inclusion of boost headers and non-conformant MSVC preprocessor + # behaviour. See USD's msvcdefaults.cmake file for a detailed comment. + set(GTL_COMPILE_OPTIONS "${GTL_COMPILE_OPTIONS}" "/wd4003") +else() + set(GTL_COMPILE_OPTIONS "-Wall" "-Wextra" "-Wformat-security") +endif() + +# TODO: for headers, either use a #pragma OR in case of USD/pxr, add to the target additionally + + diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 492a1f75..0b76f69e 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -116,6 +116,7 @@ set(OPENEXR_INSTALL OFF) set(OPENEXR_INSTALL_TOOLS OFF) set(OPENEXR_INSTALL_EXAMPLES OFF) add_subdirectory(openexr) +target_compile_options(OpenEXR PRIVATE "-Wno-#warnings") # # stb diff --git a/extern/efsw b/extern/efsw index 527ddca9..0c70ed2c 160000 --- a/extern/efsw +++ b/extern/efsw @@ -1 +1 @@ -Subproject commit 527ddca9a95d6d3a01975849e7e09cdec7752921 +Subproject commit 0c70ed2cd069a18d534989e8ae1c25ee39cba1f1 diff --git a/src/cgpu/CMakeLists.txt b/src/cgpu/CMakeLists.txt index 9be36056..93a90d9f 100644 --- a/src/cgpu/CMakeLists.txt +++ b/src/cgpu/CMakeLists.txt @@ -24,6 +24,12 @@ target_link_libraries( spirv-reflect-static ) +target_compile_options( + cgpu + PRIVATE + ${GTL_COMPILE_OPTIONS} +) + set_target_properties( cgpu PROPERTIES diff --git a/src/cgpu/impl/Cgpu.cpp b/src/cgpu/impl/Cgpu.cpp index 3d3b0f9d..efe1406e 100644 --- a/src/cgpu/impl/Cgpu.cpp +++ b/src/cgpu/impl/Cgpu.cpp @@ -27,18 +27,23 @@ #include +#include +#include + #ifdef __clang__ #pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wmissing-field-initializers" // Silence nullability log spam on AppleClang #pragma clang diagnostic ignored "-Wnullability-completeness" #endif -// Uncomment for VMA debug logging -//#define VMA_DEBUG_LOG_FORMAT(format, ...) do { \ -// fprintf(stderr, (format), __VA_ARGS__); \ -// fprintf(stderr, "\n"); \ -// GB_LOG((format), __VA_ARGS__); \ -// } while (false) +#ifdef GTL_VERBOSE +#define VMA_DEBUG_LOG_FORMAT(format, ...) do { \ + GB_DEBUG_DYN("[VMA] {}", GB_FMT_SPRINTF((format), __VA_ARGS__)); \ + } while (false) +#endif #define VMA_IMPLEMENTATION #include @@ -373,6 +378,7 @@ namespace gtl /* API method implementation. */ +#ifndef NDEBUG static bool cgpuFindLayer(const char* name, size_t layerCount, VkLayerProperties* layers) { for (size_t i = 0; i < layerCount; i++) @@ -384,6 +390,7 @@ namespace gtl } return false; } +#endif static bool cgpuFindExtension(const char* name, size_t extensionCount, VkExtensionProperties* extensions) { @@ -407,7 +414,7 @@ namespace gtl .pObjectName = name }; - VkResult result = vkSetDebugUtilsObjectNameEXT(device, &info); + [[maybe_unused]] VkResult result = vkSetDebugUtilsObjectNameEXT(device, &info); assert(result == VK_SUCCESS); } @@ -689,7 +696,7 @@ namespace gtl GbSmallVector queueFamilies(queueFamilyCount); vkGetPhysicalDeviceQueueFamilyProperties(idevice->physicalDevice, &queueFamilyCount, queueFamilies.data()); - int32_t queueFamilyIndex = -1; + uint32_t queueFamilyIndex = UINT32_MAX; for (uint32_t i = 0; i < queueFamilyCount; ++i) { const VkQueueFamilyProperties* queue_family = &queueFamilies[i]; @@ -699,7 +706,7 @@ namespace gtl queueFamilyIndex = i; } } - if (queueFamilyIndex == -1) + if (queueFamilyIndex == UINT32_MAX) { iinstance->ideviceStore.free(handle); CGPU_RETURN_ERROR("no suitable queue family"); @@ -945,7 +952,7 @@ namespace gtl .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, .pNext = nullptr, .flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, - .queueFamilyIndex = (uint32_t) queueFamilyIndex, + .queueFamilyIndex = queueFamilyIndex, }; result = idevice->table.vkCreateCommandPool( @@ -1941,7 +1948,7 @@ namespace gtl for (uint32_t i = 0; i < groups.size(); i++) { - VkRayTracingShaderGroupCreateInfoKHR createInfo = { + VkRayTracingShaderGroupCreateInfoKHR sgCreateInfo = { .sType = VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR, .pNext = nullptr, .type = VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR, @@ -1951,7 +1958,8 @@ namespace gtl .intersectionShader = VK_SHADER_UNUSED_KHR, .pShaderGroupCaptureReplayHandle = nullptr, }; - groups[i] = createInfo; + + groups[i] = sgCreateInfo; } bool anyNullClosestHitShader = false; @@ -2257,7 +2265,7 @@ namespace gtl .pNext = nullptr, .geometryType = VK_GEOMETRY_TYPE_TRIANGLES_KHR, .geometry = asGeomData, - .flags = createInfo.isOpaque ? VK_GEOMETRY_OPAQUE_BIT_KHR : VkGeometryFlagsKHR(0), + .flags = VkGeometryFlagsKHR(createInfo.isOpaque ? VK_GEOMETRY_OPAQUE_BIT_KHR : 0) }; bool creationSuccessul = cgpuCreateTopOrBottomAs(device, VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR, @@ -2366,7 +2374,7 @@ namespace gtl } }, }, - .flags = areAllBlasOpaque ? VK_GEOMETRY_OPAQUE_BIT_KHR : VkGeometryFlagsKHR(0), + .flags = VkGeometryFlagsKHR(areAllBlasOpaque ? VK_GEOMETRY_OPAQUE_BIT_KHR : 0) }; if (!cgpuCreateTopOrBottomAs(device, VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, &asGeom, createInfo.instanceCount, &itlas->buffer, &itlas->as)) @@ -3322,6 +3330,7 @@ namespace gtl VkSubmitInfo2KHR submitInfo = { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR, .pNext = nullptr, + .flags = 0, .waitSemaphoreInfoCount = (uint32_t) waitSubmitInfos.size(), .pWaitSemaphoreInfos = waitSubmitInfos.data(), .commandBufferInfoCount = 1, diff --git a/src/gb/CMakeLists.txt b/src/gb/CMakeLists.txt index 8de7fdc7..c9442760 100644 --- a/src/gb/CMakeLists.txt +++ b/src/gb/CMakeLists.txt @@ -26,5 +26,15 @@ target_link_libraries( quill ) +target_compile_options( + gb + PRIVATE + ${GTL_COMPILE_OPTIONS} +) + +if(GTL_VERBOSE) + target_compile_definitions(gb PUBLIC GTL_VERBOSE=1) +endif() + # Required since library is linked into hdGatling DSO set_target_properties(gb PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/src/gb/gtl/gb/Fmt.h b/src/gb/gtl/gb/Fmt.h index 79182f7e..9630aec0 100644 --- a/src/gb/gtl/gb/Fmt.h +++ b/src/gb/gtl/gb/Fmt.h @@ -18,5 +18,7 @@ #pragma once #include +#include #define GB_FMT(fmt, ...) fmtquill::format(fmt, __VA_ARGS__) +#define GB_FMT_SPRINTF(fmt, ...) fmtquill::sprintf(fmt, __VA_ARGS__) diff --git a/src/gb/gtl/gb/Log.h b/src/gb/gtl/gb/Log.h index 78cf9654..1f27fa59 100644 --- a/src/gb/gtl/gb/Log.h +++ b/src/gb/gtl/gb/Log.h @@ -26,9 +26,11 @@ #include #include -#define GB_LOG(fmt, ...) QUILL_LOG_INFO(gtl::gbGetLogger(), fmt, ##__VA_ARGS__) -#define GB_WARN(fmt, ...) QUILL_LOG_WARNING(gtl::gbGetLogger(), fmt, ##__VA_ARGS__) #define GB_ERROR(fmt, ...) QUILL_LOG_ERROR(gtl::gbGetLogger(), fmt, ##__VA_ARGS__) +#define GB_WARN(fmt, ...) QUILL_LOG_WARNING(gtl::gbGetLogger(), fmt, ##__VA_ARGS__) +#define GB_LOG(fmt, ...) QUILL_LOG_INFO(gtl::gbGetLogger(), fmt, ##__VA_ARGS__) +#define GB_DEBUG(fmt, ...) QUILL_LOG_DEBUG(gtl::gbGetLogger(), fmt, ##__VA_ARGS__) +#define GB_DEBUG_DYN(fmt, ...) QUILL_LOG_DYNAMIC(gtl::gbGetLogger(), quill::LogLevel::Debug, fmt, ##__VA_ARGS__) namespace gtl { diff --git a/src/gb/impl/Log.cpp b/src/gb/impl/Log.cpp index c5cd9721..81c9c3e8 100644 --- a/src/gb/impl/Log.cpp +++ b/src/gb/impl/Log.cpp @@ -39,6 +39,9 @@ namespace gtl const char* logPattern = "[%(time)] (%(log_level)) %(message)"; const char* timestampFormat = "%H:%M:%S.%Qms"; s_logger = quill::Frontend::create_or_get_logger("root", std::move(sink), logPattern, timestampFormat); +#ifdef GTL_VERBOSE + s_logger->set_log_level(quill::LogLevel::Debug); +#endif quill::BackendOptions options; options.thread_name = "GbLog"; diff --git a/src/ggpu/CMakeLists.txt b/src/ggpu/CMakeLists.txt index 539ec0e1..8785d528 100644 --- a/src/ggpu/CMakeLists.txt +++ b/src/ggpu/CMakeLists.txt @@ -30,6 +30,12 @@ target_link_libraries( cgpu ) +target_compile_options( + ggpu + PRIVATE + ${GTL_COMPILE_OPTIONS} +) + set_target_properties( ggpu PROPERTIES diff --git a/src/ggpu/gtl/ggpu/LinearDataStore.h b/src/ggpu/gtl/ggpu/LinearDataStore.h index 40aef49a..f3fab8ad 100644 --- a/src/ggpu/gtl/ggpu/LinearDataStore.h +++ b/src/ggpu/gtl/ggpu/LinearDataStore.h @@ -85,6 +85,5 @@ namespace gtl GbHandleStore m_handleStore; GgpuSyncBuffer m_buffer; - uint8_t* m_mappedMem = nullptr; }; } diff --git a/src/ggpu/gtl/ggpu/SyncBuffer.h b/src/ggpu/gtl/ggpu/SyncBuffer.h index 43a41dca..27cb4132 100644 --- a/src/ggpu/gtl/ggpu/SyncBuffer.h +++ b/src/ggpu/gtl/ggpu/SyncBuffer.h @@ -77,7 +77,6 @@ namespace gtl private: CgpuDevice m_device; GgpuStager& m_stager; - GgpuDelayedResourceDestroyer& m_delayedResourceDestroyer; uint64_t m_elementSize; UpdateStrategy m_updateStrategy; diff --git a/src/ggpu/impl/LinearDataStore.cpp b/src/ggpu/impl/LinearDataStore.cpp index 6400f92c..08e01948 100644 --- a/src/ggpu/impl/LinearDataStore.cpp +++ b/src/ggpu/impl/LinearDataStore.cpp @@ -20,7 +20,7 @@ namespace { // https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 - uint32_t _NextPowerOfTwo(uint32_t v) + uint64_t _NextPowerOfTwo(uint64_t v) { v--; v |= v >> 1; @@ -28,6 +28,7 @@ namespace v |= v >> 4; v |= v >> 8; v |= v >> 16; + v |= v >> 32; v++; return v; } @@ -107,8 +108,8 @@ namespace gtl // A resize is very unlikely and can be expensive if (byteOffset >= m_buffer.byteSize()) { - uint32_t minSize = m_elementSize * m_minCapacity; - uint32_t newSize = std::max(_NextPowerOfTwo(byteOffset), minSize); + uint64_t minSize = m_elementSize * m_minCapacity; + uint64_t newSize = std::max(_NextPowerOfTwo(byteOffset), minSize); bool result = false; @@ -146,6 +147,9 @@ namespace gtl cgpuDestroyCommandBuffer(m_device, commandBuffer); if (semaphore.handle) cgpuDestroySemaphore(m_device, semaphore); + + if (!result) + byteOffset = UINT64_MAX; } return byteOffset; diff --git a/src/ggpu/impl/Stager.cpp b/src/ggpu/impl/Stager.cpp index 5f1e65db..00797682 100644 --- a/src/ggpu/impl/Stager.cpp +++ b/src/ggpu/impl/Stager.cpp @@ -157,7 +157,7 @@ namespace gtl bool GgpuStager::stageToImage(const uint8_t* src, uint64_t size, CgpuImage dst, uint32_t width, uint32_t height, uint32_t depth) { - uint64_t rowCount = height; + uint32_t rowCount = height; uint64_t rowSize = size / rowCount; if (rowSize > BUFFER_HALF_SIZE) @@ -170,7 +170,7 @@ namespace gtl while (rowsStaged < rowCount) { uint64_t remainingSpace = BUFFER_HALF_SIZE - m_stagedBytes; - uint64_t maxCopyRowCount = remainingSpace / rowSize; // truncate + uint32_t maxCopyRowCount = uint32_t(remainingSpace / rowSize); // truncate if (maxCopyRowCount == 0) { @@ -179,13 +179,13 @@ namespace gtl return false; } - maxCopyRowCount = BUFFER_HALF_SIZE / rowSize; // truncate + maxCopyRowCount = uint32_t(BUFFER_HALF_SIZE / rowSize); // truncate } - uint64_t remainingRowCount = rowCount - rowsStaged; - uint64_t copyRowCount = std::min(remainingRowCount, maxCopyRowCount); + uint32_t remainingRowCount = rowCount - rowsStaged; + uint32_t copyRowCount = std::min(remainingRowCount, maxCopyRowCount); - auto copyFunc = [this, dst, rowsStaged, width, depth, copyRowCount](uint64_t srcOffset, uint64_t dstOffset, uint64_t size) { + auto copyFunc = [this, dst, rowsStaged, width, depth, copyRowCount](uint64_t srcOffset, [[maybe_unused]] uint64_t dstOffset, [[maybe_unused]] uint64_t size) { CgpuBufferImageCopyDesc desc; desc.bufferOffset = srcOffset; desc.texelOffsetX = 0; diff --git a/src/ggpu/impl/SyncBuffer.cpp b/src/ggpu/impl/SyncBuffer.cpp index d56549dc..a71e7d2e 100644 --- a/src/ggpu/impl/SyncBuffer.cpp +++ b/src/ggpu/impl/SyncBuffer.cpp @@ -30,18 +30,17 @@ namespace gtl CgpuBufferUsageFlags bufferUsage) : m_device(device) , m_stager(stager) - , m_delayedResourceDestroyer(delayedResourceDestroyer) , m_elementSize(elementSize) , m_updateStrategy(updateStrategy) + , m_deviceBuffer(m_device, + delayedResourceDestroyer, + bufferUsage | CGPU_BUFFER_USAGE_FLAG_TRANSFER_DST, + CGPU_MEMORY_PROPERTY_FLAG_DEVICE_LOCAL) , m_hostBuffer(m_device, delayedResourceDestroyer, CGPU_BUFFER_USAGE_FLAG_STORAGE_BUFFER | CGPU_BUFFER_USAGE_FLAG_TRANSFER_SRC, CGPU_MEMORY_PROPERTY_FLAG_HOST_VISIBLE | CGPU_MEMORY_PROPERTY_FLAG_HOST_COHERENT | (updateStrategy == UpdateStrategy::PersistentMapping ? CGPU_MEMORY_PROPERTY_FLAG_DEVICE_LOCAL : 0)) - , m_deviceBuffer(m_device, - delayedResourceDestroyer, - bufferUsage | CGPU_BUFFER_USAGE_FLAG_TRANSFER_DST, - CGPU_MEMORY_PROPERTY_FLAG_DEVICE_LOCAL) { } @@ -54,7 +53,7 @@ namespace gtl assert(m_updateStrategy == UpdateStrategy::PersistentMapping || m_deviceBuffer.size() == 0); } - uint8_t* GgpuSyncBuffer::read(uint64_t byteOffset, uint64_t byteSize) + uint8_t* GgpuSyncBuffer::read(uint64_t byteOffset, [[maybe_unused]] uint64_t byteSize) // TODO: remove byteSize? { assert((byteOffset + byteSize) <= m_size); return &m_mappedHostMem[byteOffset]; diff --git a/src/gi/CMakeLists.txt b/src/gi/CMakeLists.txt index 008f26a4..705b6cb6 100644 --- a/src/gi/CMakeLists.txt +++ b/src/gi/CMakeLists.txt @@ -52,6 +52,12 @@ function(configure_target TARGET) SPIRV ) + target_compile_options( + ${TARGET} + PRIVATE + ${GTL_COMPILE_OPTIONS} + ) + if(OpenMP_CXX_FOUND) target_link_libraries(${TARGET} PRIVATE OpenMP::OpenMP_CXX) endif() @@ -76,7 +82,7 @@ target_compile_definitions( GI_REF_IMAGE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/testenv" ) -if(${GATLING_BUILD_HDGATLING}) +if(${GTL_BUILD_HDGATLING}) install( FILES "${MDL_SHARED_LIB}" DESTINATION "./hdGatling/resources" diff --git a/src/gi/impl/Gi.cpp b/src/gi/impl/Gi.cpp index d2ecb2ae..b0363edf 100644 --- a/src/gi/impl/Gi.cpp +++ b/src/gi/impl/Gi.cpp @@ -204,8 +204,9 @@ namespace gtl class ShaderFileListener : public efsw::FileWatchListener { public: - void handleFileAction(efsw::WatchID watchId, const std::string& dir, const std::string& filename, - efsw::Action action, std::string oldFilename) override + void handleFileAction([[maybe_unused]] efsw::WatchID watchId, [[maybe_unused]] const std::string& dir, + [[maybe_unused]] const std::string& filename, efsw::Action action, + [[maybe_unused]] std::string oldFilename) override { switch (action) { @@ -971,7 +972,7 @@ namespace gtl std::atomic_bool threadWorkFailed = false; #pragma omp parallel for - for (int i = 0; i < hitGroupCompInfos.size(); i++) + for (int i = 0; i < int(hitGroupCompInfos.size()); i++) { const McMaterial* material = params.materials[i]->mcMat; @@ -1043,7 +1044,7 @@ namespace gtl // 3. Generate final hit shader GLSL sources. threadWorkFailed = false; #pragma omp parallel for - for (int i = 0; i < hitGroupCompInfos.size(); i++) + for (int i = 0; i < int(hitGroupCompInfos.size()); i++) { const McMaterial* material = params.materials[i]->mcMat; @@ -1112,7 +1113,7 @@ namespace gtl hitShaders.reserve(hitGroupCompInfos.size()); hitGroups.reserve(hitGroupCompInfos.size() * 2); - for (int i = 0; i < hitGroupCompInfos.size(); i++) + for (int i = 0; i < int(hitGroupCompInfos.size()); i++) { const HitGroupCompInfo& compInfo = hitGroupCompInfos[i]; @@ -2007,7 +2008,7 @@ namespace gtl return light; } - void giDestroyDomeLight(GiScene* scene, GiDomeLight* light) + void giDestroyDomeLight([[maybe_unused]]/*TODO:use?*/ GiScene* scene, GiDomeLight* light) { delete light; } diff --git a/src/gi/impl/GlslShaderCompiler.cpp b/src/gi/impl/GlslShaderCompiler.cpp index d466ef75..19f9b6ea 100644 --- a/src/gi/impl/GlslShaderCompiler.cpp +++ b/src/gi/impl/GlslShaderCompiler.cpp @@ -57,17 +57,17 @@ namespace gtl { } - IncludeResult* includeSystem(const char* headerName, - const char* includerName, - size_t inclusionDepth) override + IncludeResult* includeSystem([[maybe_unused]] const char* headerName, + [[maybe_unused]] const char* includerName, + [[maybe_unused]] size_t inclusionDepth) override { // There's no reason to support this right now. return nullptr; } IncludeResult* includeLocal(const char* headerName, - const char* includerName, - size_t inclusionDepth) override + [[maybe_unused]] const char* includerName, + [[maybe_unused]] size_t inclusionDepth) override { fs::path filePath = m_rootPath / headerName; diff --git a/src/gi/impl/GlslShaderGen.cpp b/src/gi/impl/GlslShaderGen.cpp index 0b5511a2..6e59156b 100644 --- a/src/gi/impl/GlslShaderGen.cpp +++ b/src/gi/impl/GlslShaderGen.cpp @@ -160,7 +160,7 @@ namespace gtl bool _MakeMaterialGenInfo(const McGlslGenResult& codeGenResult, const std::string& resourcePathPrefix, - fs::path shaderPath, + [[maybe_unused]] fs::path shaderPath, // TODO: remove? GiGlslShaderGen::MaterialGenInfo& genInfo) { // Append resource path prefix for file-backed MDL modules. diff --git a/src/gi/impl/TextureManager.cpp b/src/gi/impl/TextureManager.cpp index 8c70a934..96cc5434 100644 --- a/src/gi/impl/TextureManager.cpp +++ b/src/gi/impl/TextureManager.cpp @@ -133,7 +133,7 @@ namespace gtl bool result; - for (int i = 0; i < texCount; i++) + for (size_t i = 0; i < texCount; i++) { fflush(stdout); CgpuImage image; @@ -148,8 +148,6 @@ namespace gtl auto& imageVector = createInfo.is3d ? images3d : images2d; - int binding = textureResource.binding; - const char* filePath = textureResource.filePath.c_str(); if (strcmp(filePath, "") == 0) { diff --git a/src/gt/CMakeLists.txt b/src/gt/CMakeLists.txt index 8b9cb8d8..7d01816a 100644 --- a/src/gt/CMakeLists.txt +++ b/src/gt/CMakeLists.txt @@ -20,3 +20,9 @@ target_link_libraries( PRIVATE gb ) + +target_compile_options( + gt + PRIVATE + ${GTL_COMPILE_OPTIONS} +) diff --git a/src/hdGatling/CMakeLists.txt b/src/hdGatling/CMakeLists.txt index 96391db7..cc1b85b2 100644 --- a/src/hdGatling/CMakeLists.txt +++ b/src/hdGatling/CMakeLists.txt @@ -59,6 +59,12 @@ target_compile_definitions( "$<$,$>:TBB_USE_DEBUG>" ) +target_compile_options( + hdGatling + PRIVATE + ${GTL_COMPILE_OPTIONS} +) + # Workaround for https://github.com/PixarAnimationStudios/USD/issues/1279 if(MSVC_VERSION GREATER_EQUAL 1920) target_compile_options(hdGatling PRIVATE "/Zc:inline-") diff --git a/src/hdGatling/light.cpp b/src/hdGatling/light.cpp index 595a347b..7b2ec81d 100644 --- a/src/hdGatling/light.cpp +++ b/src/hdGatling/light.cpp @@ -37,7 +37,8 @@ PXR_NAMESPACE_OPEN_SCOPE namespace { - float _AreaEllipsoid(const GfMatrix4d& t, float radiusX, float radiusY, float radiusZ) +//TODO: use transform or remove + float _AreaEllipsoid([[maybe_unused]] const GfMatrix4d& t, float radiusX, float radiusY, float radiusZ) { float ab = powf(radiusX * radiusY, 1.6f); float ac = powf(radiusX * radiusZ, 1.6f); @@ -106,7 +107,7 @@ HdGatlingSphereLight::HdGatlingSphereLight(const SdfPath& id, GiScene* scene) } void HdGatlingSphereLight::Sync(HdSceneDelegate* sceneDelegate, - HdRenderParam* renderParam, + [[maybe_unused]] HdRenderParam* renderParam, HdDirtyBits* dirtyBits) { const SdfPath& id = GetId(); @@ -146,7 +147,7 @@ void HdGatlingSphereLight::Sync(HdSceneDelegate* sceneDelegate, *dirtyBits = HdChangeTracker::Clean; } -void HdGatlingSphereLight::Finalize(HdRenderParam* renderParam) +void HdGatlingSphereLight::Finalize([[maybe_unused]] HdRenderParam* renderParam) { giDestroySphereLight(_scene, _giSphereLight); } @@ -161,7 +162,7 @@ HdGatlingDistantLight::HdGatlingDistantLight(const SdfPath& id, GiScene* scene) } void HdGatlingDistantLight::Sync(HdSceneDelegate* sceneDelegate, - HdRenderParam* renderParam, + [[maybe_unused]] HdRenderParam* renderParam, HdDirtyBits* dirtyBits) { const SdfPath& id = GetId(); @@ -201,7 +202,7 @@ void HdGatlingDistantLight::Sync(HdSceneDelegate* sceneDelegate, *dirtyBits = HdChangeTracker::Clean; } -void HdGatlingDistantLight::Finalize(HdRenderParam* renderParam) +void HdGatlingDistantLight::Finalize([[maybe_unused]] HdRenderParam* renderParam) { giDestroyDistantLight(_scene, _giDistantLight); } @@ -216,7 +217,7 @@ HdGatlingRectLight::HdGatlingRectLight(const SdfPath& id, GiScene* scene) } void HdGatlingRectLight::Sync(HdSceneDelegate* sceneDelegate, - HdRenderParam* renderParam, + [[maybe_unused]] HdRenderParam* renderParam, HdDirtyBits* dirtyBits) { const SdfPath& id = GetId(); @@ -264,7 +265,7 @@ void HdGatlingRectLight::Sync(HdSceneDelegate* sceneDelegate, *dirtyBits = HdChangeTracker::Clean; } -void HdGatlingRectLight::Finalize(HdRenderParam* renderParam) +void HdGatlingRectLight::Finalize([[maybe_unused]] HdRenderParam* renderParam) { giDestroyRectLight(_scene, _giRectLight); } @@ -279,7 +280,7 @@ HdGatlingDiskLight::HdGatlingDiskLight(const SdfPath& id, GiScene* scene) } void HdGatlingDiskLight::Sync(HdSceneDelegate* sceneDelegate, - HdRenderParam* renderParam, + [[maybe_unused]] HdRenderParam* renderParam, HdDirtyBits* dirtyBits) { const SdfPath& id = GetId(); @@ -324,7 +325,7 @@ void HdGatlingDiskLight::Sync(HdSceneDelegate* sceneDelegate, *dirtyBits = HdChangeTracker::Clean; } -void HdGatlingDiskLight::Finalize(HdRenderParam* renderParam) +void HdGatlingDiskLight::Finalize([[maybe_unused]] HdRenderParam* renderParam) { giDestroyDiskLight(_scene, _giDiskLight); } @@ -338,7 +339,7 @@ HdGatlingDomeLight::HdGatlingDomeLight(const SdfPath& id, GiScene* scene) } void HdGatlingDomeLight::Sync(HdSceneDelegate* sceneDelegate, - HdRenderParam* renderParam, + [[maybe_unused]] HdRenderParam* renderParam, HdDirtyBits* dirtyBits) { if (!HdChangeTracker::IsDirty(*dirtyBits)) @@ -414,7 +415,7 @@ void HdGatlingDomeLight::Sync(HdSceneDelegate* sceneDelegate, } } -void HdGatlingDomeLight::Finalize(HdRenderParam* renderParam) +void HdGatlingDomeLight::Finalize([[maybe_unused]] HdRenderParam* renderParam) { DestroyDomeLight(renderParam); } @@ -448,7 +449,7 @@ HdGatlingSimpleLight::HdGatlingSimpleLight(const SdfPath& id, GiScene* scene) } void HdGatlingSimpleLight::Sync(HdSceneDelegate* sceneDelegate, - HdRenderParam* renderParam, + [[maybe_unused]] HdRenderParam* renderParam, HdDirtyBits* dirtyBits) { const SdfPath& id = GetId(); @@ -485,7 +486,7 @@ void HdGatlingSimpleLight::Sync(HdSceneDelegate* sceneDelegate, *dirtyBits = HdChangeTracker::Clean; } -void HdGatlingSimpleLight::Finalize(HdRenderParam* renderParam) +void HdGatlingSimpleLight::Finalize([[maybe_unused]] HdRenderParam* renderParam) { if (_giSphereLight) { diff --git a/src/hdGatling/light.h b/src/hdGatling/light.h index b6214d5f..96d2b31b 100644 --- a/src/hdGatling/light.h +++ b/src/hdGatling/light.h @@ -138,7 +138,6 @@ class HdGatlingSimpleLight final : public HdGatlingLight private: GiSphereLight* _giSphereLight = nullptr; - GiDomeLight* _giDomeLight = nullptr; }; diff --git a/src/hdGatling/mdlDiscoveryPlugin.cpp b/src/hdGatling/mdlDiscoveryPlugin.cpp index e3c9bfee..9db61425 100644 --- a/src/hdGatling/mdlDiscoveryPlugin.cpp +++ b/src/hdGatling/mdlDiscoveryPlugin.cpp @@ -22,7 +22,7 @@ PXR_NAMESPACE_OPEN_SCOPE -NdrNodeDiscoveryResultVec HdGatlingMdlDiscoveryPlugin::DiscoverNodes(const Context& ctx) +NdrNodeDiscoveryResultVec HdGatlingMdlDiscoveryPlugin::DiscoverNodes([[maybe_unused]] const Context& ctx) { NdrNodeDiscoveryResultVec result; diff --git a/src/hdGatling/mesh.cpp b/src/hdGatling/mesh.cpp index 8518640a..f1c17429 100644 --- a/src/hdGatling/mesh.cpp +++ b/src/hdGatling/mesh.cpp @@ -111,7 +111,7 @@ namespace VtVec3fArray bitangents(tangentCount, GfVec3f(0.0f)); VtVec3fArray normals(tangentCount, GfVec3f(0.0f)); - for (int i = 0; i < meshFaces.size(); i++) + for (size_t i = 0; i < meshFaces.size(); i++) { const auto& f = meshFaces[i]; @@ -147,9 +147,9 @@ namespace b = GfVec3f::XAxis(); } - int outIndex0 = meshNormals.indexed ? f[0] : (i * 3 + 0); - int outIndex1 = meshNormals.indexed ? f[1] : (i * 3 + 1); - int outIndex2 = meshNormals.indexed ? f[2] : (i * 3 + 2); + size_t outIndex0 = meshNormals.indexed ? f[0] : (i * 3 + 0); + size_t outIndex1 = meshNormals.indexed ? f[1] : (i * 3 + 1); + size_t outIndex2 = meshNormals.indexed ? f[2] : (i * 3 + 2); // Assets can author out-of-range indices (f.i. Intel's Sponza scene). Skip those. if (outIndex0 >= tangentCount || outIndex1 >= tangentCount || outIndex2 >= tangentCount) @@ -172,7 +172,7 @@ namespace meshTangents.resize(tangentCount); meshBitangentSigns.resize(tangentCount); - for (int i = 0; i < tangentCount; i++) + for (size_t i = 0; i < tangentCount; i++) { const GfVec3f& n = meshNormals.array[i].GetNormalized(); @@ -248,7 +248,7 @@ namespace bitangent = GfVec3f(b, nSign + n[1] * n[1] * a, -n[1]); } - void _CalculateFallbackTangents(const VtVec3iArray& meshFaces, + void _CalculateFallbackTangents([[maybe_unused]] const VtVec3iArray& meshFaces, // TODO: remove const _VertexAttr& meshNormals, VtVec3fArray& meshTangents, VtFloatArray& meshBitangentSigns) @@ -258,7 +258,7 @@ namespace meshTangents.resize(normalCount); meshBitangentSigns.resize(normalCount); - for (int i = 0; i < normalCount; i++) + for (size_t i = 0; i < normalCount; i++) { const GfVec3f normal = meshNormals.array[i]; @@ -492,13 +492,13 @@ TfToken HdGatlingMesh::_FindPrimvarByRole(HdSceneDelegate* sceneDelegate, } template -VtValue _ExpandBufferElements(const HdVtBufferSource& buffer, int elementExpansion) +VtValue _ExpandBufferElements(const HdVtBufferSource& buffer, size_t elementExpansion) { VtArray result(buffer.GetNumElements() * elementExpansion); - for (int i = 0; i < buffer.GetNumElements(); i++) + for (size_t i = 0; i < buffer.GetNumElements(); i++) { - for (int j = 0; j < elementExpansion; j++) + for (size_t j = 0; j < elementExpansion; j++) { result[i * elementExpansion + j] = ((T*) buffer.GetData())[i]; } @@ -507,7 +507,7 @@ VtValue _ExpandBufferElements(const HdVtBufferSource& buffer, int elementExpansi return VtValue(std::move(result)); } -VtValue _ExpandBufferElements(const HdVtBufferSource& buffer, HdType type, int elementExpansion) +VtValue _ExpandBufferElements(const HdVtBufferSource& buffer, HdType type, size_t elementExpansion) { if (type == HdTypeFloatVec4) { @@ -586,7 +586,7 @@ bool HdGatlingMesh::_ReadTriangulatedPrimvar(HdSceneDelegate* sceneDelegate, uint8_t* srcPtr = (uint8_t*) HdGetValueData(boxedValues); size_t elementSize = HdDataSizeOfType(type); - for (int faceIndex = 0; faceIndex < primitiveParams.size(); faceIndex++) + for (size_t faceIndex = 0; faceIndex < primitiveParams.size(); faceIndex++) { int oldFaceIndex = HdMeshUtil::DecodeFaceIndexFromCoarseFaceParam(primitiveParams[faceIndex]); diff --git a/src/hdGatling/renderDelegate.cpp b/src/hdGatling/renderDelegate.cpp index 687db7b2..d838c588 100644 --- a/src/hdGatling/renderDelegate.cpp +++ b/src/hdGatling/renderDelegate.cpp @@ -136,7 +136,7 @@ HdCommandDescriptors HdGatlingRenderDelegate::GetCommandDescriptors() const return COMMAND_DESCRIPTORS; } -bool HdGatlingRenderDelegate::InvokeCommand(const TfToken& command, const HdCommandArgs& args) +bool HdGatlingRenderDelegate::InvokeCommand(const TfToken& command, [[maybe_unused]] const HdCommandArgs& args) { if (command == HdGatlingCommandTokens->printLicenses) { diff --git a/src/hdGatling/renderPass.cpp b/src/hdGatling/renderPass.cpp index 505de64f..f2a98c9c 100644 --- a/src/hdGatling/renderPass.cpp +++ b/src/hdGatling/renderPass.cpp @@ -166,7 +166,7 @@ bool HdGatlingRenderPass::IsConverged() const } void HdGatlingRenderPass::_BakeMeshes(HdRenderIndex* renderIndex, - GfMatrix4d rootTransform, + [[maybe_unused]] GfMatrix4d rootTransform, // TODO: remove std::vector& materials, std::vector& meshes, std::vector& instances) @@ -284,9 +284,9 @@ void HdGatlingRenderPass::_BakeMeshes(HdRenderIndex* renderIndex, GfMatrix4d T = prototypeTransform * transforms[i]; float instanceTransform[3][4] = { - (float) T[0][0], (float) T[1][0], (float) T[2][0], (float) T[3][0], - (float) T[0][1], (float) T[1][1], (float) T[2][1], (float) T[3][1], - (float) T[0][2], (float) T[1][2], (float) T[2][2], (float) T[3][2] + { (float) T[0][0], (float) T[1][0], (float) T[2][0], (float) T[3][0] }, + { (float) T[0][1], (float) T[1][1], (float) T[2][1], (float) T[3][1] }, + { (float) T[0][2], (float) T[1][2], (float) T[2][2], (float) T[3][2] } }; GiMeshInstance instance; diff --git a/src/hdGatling/rendererPlugin.cpp b/src/hdGatling/rendererPlugin.cpp index 2c1576bc..171c4090 100644 --- a/src/hdGatling/rendererPlugin.cpp +++ b/src/hdGatling/rendererPlugin.cpp @@ -69,6 +69,7 @@ namespace return giInitialize(params) == GiStatus::Ok; } +#if PXR_VERSION <= 2311 mx::DocumentPtr _LoadMtlxStdLib() { mx::DocumentPtr mtlxStdLib = mx::createDocument(); @@ -84,6 +85,7 @@ namespace return mtlxStdLib; } +#endif } // Needs to be defined in pxr namespace due to being publicly declared in header @@ -201,7 +203,7 @@ void HdGatlingRendererPlugin::DeleteRenderDelegate(HdRenderDelegate* renderDeleg } #if PXR_VERSION >= 2302 -bool HdGatlingRendererPlugin::IsSupported(bool gpuEnabled) const +bool HdGatlingRendererPlugin::IsSupported([[maybe_unused]] bool gpuEnabled) const #else bool HdGatlingRendererPlugin::IsSupported() const #endif diff --git a/src/imgio/CMakeLists.txt b/src/imgio/CMakeLists.txt index 0bd997c9..d127d82b 100644 --- a/src/imgio/CMakeLists.txt +++ b/src/imgio/CMakeLists.txt @@ -38,3 +38,9 @@ target_link_libraries( OpenEXR::OpenEXR stb ) + +target_compile_options( + imgio + PRIVATE + ${GTL_COMPILE_OPTIONS} +) diff --git a/src/imgio/impl/ExrDecoder.cpp b/src/imgio/impl/ExrDecoder.cpp index fae71e7d..34847f65 100644 --- a/src/imgio/impl/ExrDecoder.cpp +++ b/src/imgio/impl/ExrDecoder.cpp @@ -19,10 +19,13 @@ #include "ErrorCodes.h" #include "Image.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include #include #include #include +#pragma clang diagnostic pop #include #include @@ -32,9 +35,9 @@ namespace class _MemStream : public Imf::IStream { private: - uint64_t m_pos; - uint64_t m_size; char* m_data; + uint64_t m_size; + uint64_t m_pos; public: _MemStream(char* data, size_t size) diff --git a/src/imgio/impl/HdrDecoder.cpp b/src/imgio/impl/HdrDecoder.cpp index b2419950..05ddd6e3 100644 --- a/src/imgio/impl/HdrDecoder.cpp +++ b/src/imgio/impl/HdrDecoder.cpp @@ -19,10 +19,14 @@ #include "ErrorCodes.h" #include "Image.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" #define STB_IMAGE_IMPLEMENTATION #define STBI_FAILURE_USERMSG #define STBI_ONLY_HDR #include +#pragma clang diagnostic pop #include #include diff --git a/src/mc/CMakeLists.txt b/src/mc/CMakeLists.txt index 5511f588..4c0f6f24 100644 --- a/src/mc/CMakeLists.txt +++ b/src/mc/CMakeLists.txt @@ -43,6 +43,12 @@ target_link_libraries( MaterialXGenMdl ) +target_compile_options( + mc + PRIVATE + ${GTL_COMPILE_OPTIONS} +) + if(DEFINED PXR_VERSION) target_compile_definitions( mc diff --git a/src/mc/impl/Backend.cpp b/src/mc/impl/Backend.cpp index fd45c5b5..eaffbef9 100644 --- a/src/mc/impl/Backend.cpp +++ b/src/mc/impl/Backend.cpp @@ -17,7 +17,14 @@ #include "Backend.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" +#pragma clang diagnostic ignored "-Wsign-compare" #include +#pragma clang diagnostic pop #include #include @@ -48,7 +55,6 @@ namespace gtl mi::neuraylib::Target_function_description("backface.emission.emission", "mdl_backface_edf_emission"), mi::neuraylib::Target_function_description("backface.emission.intensity", "mdl_backface_edf_emission_intensity") }; - const static char* MATERIAL_STATE_NAME = "State"; class McBackend::_Impl { @@ -123,7 +129,7 @@ namespace gtl uint32_t binding = 0; // We start at 1 because index 0 is the invalid texture. - for (int i = 1; i < texCount; i++) + for (size_t i = 1; i < texCount; i++) { #if MI_NEURAYLIB_API_VERSION >= 51 if (!targetCode->get_texture_is_body_resource(i)) @@ -194,7 +200,7 @@ namespace gtl } } - std::string extractTargetCodeTextureFilePath(mi::base::Handle targetCode, int i) + std::string extractTargetCodeTextureFilePath(mi::base::Handle targetCode, size_t i) { const char* url = targetCode->get_texture_url(i); if (!url) @@ -263,7 +269,7 @@ namespace gtl { GbSmallVector fDescs; - for (int i = 0; i < MC_DF_FLAG_COUNT; i++) + for (size_t i = 0; i < MC_DF_FLAG_COUNT; i++) { if (dfFlags & (1 << i)) { diff --git a/src/mc/impl/MdlLogger.cpp b/src/mc/impl/MdlLogger.cpp index 93dc7961..3c432d14 100644 --- a/src/mc/impl/MdlLogger.cpp +++ b/src/mc/impl/MdlLogger.cpp @@ -17,35 +17,19 @@ #include "MdlLogger.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" #include +#pragma clang diagnostic pop #include #include namespace { - const char* _MiMessageSeverityToCStr(mi::base::Message_severity severity) - { - switch (severity) - { - case mi::base::MESSAGE_SEVERITY_FATAL: - return "fatal"; - case mi::base::MESSAGE_SEVERITY_ERROR: - return "error"; - case mi::base::MESSAGE_SEVERITY_WARNING: - return "warning"; - case mi::base::MESSAGE_SEVERITY_INFO: - return "info"; - case mi::base::MESSAGE_SEVERITY_VERBOSE: - return "verbose"; - case mi::base::MESSAGE_SEVERITY_DEBUG: - return "debug"; - default: - break; - } - return ""; - } - const char* _MiMessageKindToCStr(mi::neuraylib::IMessage::Kind kind) { switch (kind) @@ -72,15 +56,18 @@ namespace namespace gtl { void McMdlLogger::message(mi::base::Message_severity level, - const char* moduleCategory, - const mi::base::Message_details& details, + [[maybe_unused]] const char* moduleCategory, + [[maybe_unused]] const mi::base::Message_details& details, const char* message) { #ifdef NDEBUG const mi::base::Message_severity minLogLevel = mi::base::MESSAGE_SEVERITY_ERROR; +#elif defined(GTL_VERBOSE) + const mi::base::Message_severity minLogLevel = mi::base::MESSAGE_SEVERITY_INFO; #else const mi::base::Message_severity minLogLevel = mi::base::MESSAGE_SEVERITY_WARNING; #endif + if (level > minLogLevel) { return; @@ -98,11 +85,15 @@ namespace gtl if (level <= mi::base::MESSAGE_SEVERITY_ERROR) { - GB_ERROR("{}", message); + GB_ERROR("[MDL] {}", message); + } + else if (level <= mi::base::MESSAGE_SEVERITY_WARNING) + { + GB_WARN("[MDL] {}", message); } else { - GB_LOG("{}", message); + GB_DEBUG("[MDL] {}", message); } } diff --git a/src/mc/impl/MdlLogger.h b/src/mc/impl/MdlLogger.h index b45cea73..3db38905 100644 --- a/src/mc/impl/MdlLogger.h +++ b/src/mc/impl/MdlLogger.h @@ -17,9 +17,15 @@ #pragma once +#pragma clang diagnostic push +//#pragma clang diagnostic ignored "-Wdeprecated-copy" +//#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" #include #include #include +#pragma clang diagnostic pop namespace gtl { diff --git a/src/mc/impl/MdlMaterialCompiler.cpp b/src/mc/impl/MdlMaterialCompiler.cpp index ed5694ad..e1890662 100644 --- a/src/mc/impl/MdlMaterialCompiler.cpp +++ b/src/mc/impl/MdlMaterialCompiler.cpp @@ -21,7 +21,12 @@ #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" #include +#pragma clang diagnostic pop #include #include @@ -109,7 +114,7 @@ namespace gtl void McMdlMaterialCompiler::addStandardSearchPaths() { - for (const std::string s : m_mdlSearchPaths) + for (const std::string& s : m_mdlSearchPaths) { if (m_config->add_mdl_path(s.c_str())) { diff --git a/src/mc/impl/MdlMaterialCompiler.h b/src/mc/impl/MdlMaterialCompiler.h index 8473d1c5..5ef5d267 100644 --- a/src/mc/impl/MdlMaterialCompiler.h +++ b/src/mc/impl/MdlMaterialCompiler.h @@ -22,6 +22,10 @@ #include #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" #include #include #include @@ -31,6 +35,7 @@ #include #include #include +#pragma clang diagnostic pop #include "MdlLogger.h" diff --git a/src/mc/impl/MdlNeurayLoader.cpp b/src/mc/impl/MdlNeurayLoader.cpp index 41c6c5e2..97353029 100644 --- a/src/mc/impl/MdlNeurayLoader.cpp +++ b/src/mc/impl/MdlNeurayLoader.cpp @@ -17,7 +17,12 @@ #include "MdlNeurayLoader.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" #include +#pragma clang diagnostic pop #ifdef MI_PLATFORM_WINDOWS #include diff --git a/src/mc/impl/MdlNeurayLoader.h b/src/mc/impl/MdlNeurayLoader.h index fced80eb..2b00eeaa 100644 --- a/src/mc/impl/MdlNeurayLoader.h +++ b/src/mc/impl/MdlNeurayLoader.h @@ -17,8 +17,12 @@ #pragma once +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" #include #include +#pragma clang diagnostic pop #include diff --git a/src/mc/impl/MdlRuntime.cpp b/src/mc/impl/MdlRuntime.cpp index fc364025..e76014a9 100644 --- a/src/mc/impl/MdlRuntime.cpp +++ b/src/mc/impl/MdlRuntime.cpp @@ -20,7 +20,10 @@ #include "MdlLogger.h" #include "MdlNeurayLoader.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" #include +#pragma clang diagnostic pop namespace gtl { diff --git a/src/mc/impl/MdlRuntime.h b/src/mc/impl/MdlRuntime.h index b6aaeae4..e37b709c 100644 --- a/src/mc/impl/MdlRuntime.h +++ b/src/mc/impl/MdlRuntime.h @@ -17,6 +17,10 @@ #pragma once +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-function" #include #include #include @@ -25,6 +29,7 @@ #include #include #include +#pragma clang diagnostic pop #include #include