Methane Kit v0.7.1
This is a refactoring release which replaces monolithic "Graphics Core" module with modular RHI (Rendering Hardware Interface) consisting of interfaces, base implementation, DirectX, Vulkan, Metal and Null backend modules and new "Impl" module with PIMPL classes providing convenient way to use RHI with an extra performance boost from inlining API calls directly to final implementation, instead of virtual calls made through abstract interfaces. See performance comparison of FPS in Methane Asteroids benchmark with 3 implementations (all compiled with the same updated compiler optimization flags): v0.7.0 RHI virtual interfaces, v0.7.1 RHI PIMPL classes without inlining and with inline calls to final implementation. All tutorials, graphics primitives and user interface classes were rewritten to use RHI PIMPL classes, which allow to reduce code complexity and improve readability.

Graphics libraries
- RHI PIMPL classes were added as an alternative to using RHI abstract interfaces in your application (see
Modules/Graphics/RHI/Impl). PIMPL classes are more convenient to use since they allow to write code without smart pointers and allow to get more performance with final implementation inlining. CMake optionMETHANE_RHI_PIMPL_INLINE_ENABLEDenables RHI final implementation inlining for PIMPL classes and allows to make direct calls to final RHI implementation without virtual call overhead. PIMPL inlining can gives up to 5% of extra performance in highly loaded rendering scenario. Graphics Coremodule was renamed toGraphics RHI(RHI is a common acronym for Rendering Hardware Interface) and split into several CMake modulesInterface,Base,DirectX,Vulkan,MetalandImpl- this makes architecture even more modular and extensible.- All RHI abstract interfaces were renamed to start with
Iprefix in file and struct names and put underMethane::Graphics::Rhinamespace, for exampleGraphics::Device->Graphics::Rhi::IDevice. - All RHI implementation classes were symmetrically renamed by removing impl. suffix and moving it under impl. namespace, for example
Graphics::DeviceBase->Graphics::Base::Device,Graphics::DeviceDX->Graphics::DirectX::Device. Source files were renamed accordingly:Graphics/DeviceBase.h->Graphics/Base/Device.h,Graphics/DeviceDX.h->Graphics/DirectX/Device.h. This allows to mirror RHI implementations for different APIs with completely symmetrical classes and files naming inside different namespaces. - Removed excessive
Createstatic factory functions ofITextureandIBufferinterfaces using custom setting initialisers. - Add sequential
CreateXvirtual methods in RHI interfaces and use them in implementation ofX::Createstatic factory functions. - Added RHI Null implementation which is going to be used in unit tests.
BLITCommandListwas renamed toTransferCommandList.QueryBufferwas renamed toQueryPool.- Replaced
std::stringwithstd::string_viewinIObject::SetNameandGetNamemethods. - Simplified implementation of and classes for Vulkan and DirectX APIs by replacing template class variants with common class implementation.
User Interface
- Migrated
Font,TextandBadgeclasses to RHI PIMPL classes instead of abstract interfaces and implemented themself in PIMPL style.
Platform libraries
- Fixed X11 window resizing on Linux with Nvidia drivers:
ErrorOutOfDateKHRafter resizing swap-chain on Linux with NVidia proprietary drivers (close #105) Platform/Inputmodule was split into to submodules:Keyboard,Mouse,ControllersandActionControllers. All classes from this modules were moved underPlatform::Inputnamespace.
Data libraries
- Added
Data::EnumMask<EnumType>template class implementing bit-mask operations on enum values used as bits.EnumMasktype is used in Methane Kit public interfaces instead ofmagic_enum::bitwise_operators. - Added
Data::Transmitter<ICallbackType>class which implementsData::IEmitterby transmitting callback connections to some other emitter instance.
External libraries
- CPM.cmake was updated to v0.37. This release fix parallel cmake generation for multiple configuration used in CLion.
- Tracy was updated to v0.9.
- DirectX-Headers was updated to v1.608.2b to use modular headers instead of monolithic
d3dx12.hin DirectX RHI.
Tutorials applications
- All tutorial implementations were rewritten to use RHI PIMPL classes instead of smart pointers to abstract interfaces. It allows to reduce code complexity and make it looks clean and simple.
Tests
- Added unit tests for class from
Data/EnumMask.hpp. - Added unit tests for functions from
Data/EnumMaskUtils.hpp. - Added unit tests for class from
Data/Transmitter.hpp
Builds
- Tracy executable file is automatically added in "Profile" build artifacts (pre-platform executables are taken from Methane Powered Tracy releases).
- Enabled aggressive optimisations in Release builds, including whole program optimisations with link-time code generation, inline functions expansion, disable security checks and others.
- ITT instrumentation is disabled by default in Release builds, but still enabled in Profile builds.
- Add explicit CMake options printing during configuration.
- Windows builds in GitHub Actions are upgraded to use Visual Studio 2022.
- Dependent GitHub actions were updated in yaml scripts to use NodeJS 16.
- CI Sonar Scan builds now use new GitHub action
sonarcloud-github-c-cppto install scanner binaries.build-wrappertool is not used anymore, it was replaced with Ninja compilation data base generated by CMake.
Documentation
- Tutorials README documentation was updated to reflect PIMPL RHI classes usage instead of pointers to abstract interfaces.
- Added Data, Platform, Graphics and UserInterface modules dependency diagrams in folder README.md files using Mermaid markdown.
- Updated High-Level Architecture diagram, RHI classes diagram and GraphViz module relations diagram.