Summary
In Methane Kit v0.8.0, several significant enhancements have been introduced:
- Improved Program Bindings Configuration: The configuration of program bindings has been enhanced by defining argument access frequency directly within HLSL argument space modifiers. Previously, this was configured in the C++ program settings.
- Enhanced Performance for Metal RHI: Performance of program bindings for Metal RHI has been improved by supporting the Argument Buffers API. This allows for more efficient writing of binding commands in command encoders.
- Simplified Shader Argument Buffers Initialization: A simplified interface for initializing shader argument buffers using root constants has been added. This enables direct data assignment to program argument bindings and handles all buffer management within Methane RHI. For small constants "Push Constants" native API is also supported via RHI of program bindings.
Tutorials
- Root-constants were applied across all tutorials instead of uniform buffers to simplify code.
- Console Compute tutorial was extended with game rule selection using root constant value interface of program bindings.
- ParallelRendering app can be built in two versions: first one is using addressable buffer views like before and second one is using root constants but with lower performance.
Graphics libraries
- Shader argument access types were added in HLSL shaders as register space definitions (
META_ARG_CONSTANT
,META_ARG_FRAME_CONSTANT
,META_ARG_MUTABLE
), to replace shader arguments configurationRhi::ProgramArgumentAccessors
inProgramSettings
. RHI shader arguments reflection uses these register space definitions to add default argument accessors configuration, so that it is not necessary to be defined in user code ofProgramSettings
. Rhi::RootConstant
class was added as a storage of constant data (derived fromData::Chunk
), which can be set to buffer argument bindings, defined withProgramArgumentValueType::RootConstantBuffer
inRhi::ProgramArgumentAccessors
.Rhi::IProgramBindings::SetRootConstant
allows to set root constant data for such argument bindings. Internally managedRhi::RootConstantBuffer
objects significantly simplify user code by eliminating the need in creating separate uniform buffers. Support ofRoot32BitConstants
in DirectX andPushConstants
in Vulkan andSetBytes
in Metal was added viaRhi::ProgramArgumentValueType::RootConstantValue
(close #140).Metal::ProgramBindings
in Metal RHI were extended with Metal Argument Buffers API support for more efficient shader argument bindings, similar to descriptor tables in DirectX 12 and descriptor sets in Vulkan. CMake optionMETHANE_METAL_ARGUMENT_BUFFERS_ENABLED
was added to allow switching between direct resource binding and argument buffers (enabled by default). Metal argument buffers are created independently for groups of shader arguments with different argument access types. (close #138)Metal::ProgramBindings
were refactored to reduce code duplication with help of templates.ProgramArgument
andProgramArgumentAccessor
types were moved fromIProgram.h
header toProgramArgument.h/cpp
.ProgramArgumentAccessModifier
enum was renamed toProgramArgumentValueType
.- Shader argument declaration macros were added in
ProgramArgument.h
to simplify program argument accessors setup:META_PROGRAM_ARG_*
(ROOT_CONSTANT
,ROOT_FRAME_CONSTANT
,ROOT_MUTABLE
,RESOURCE_CONSTANT
,RESOURCE_FRAME_CONSTANT
,RESOURCE_MUTABLE
, etc.). CommandListDebugGroup
sub-group names now usestd::string_view
ScreenQuad
was migrated to root constants instead of uniform buffer.- Fixes:
- Fixed Vulkan validation issues revealed by Vulkan SDK 1.3.290.0.
- Fixed DirectX 12 GPU timestamp queries for DirectX, fixed invalid initial state of the read-back buffer.
- Fixed Metal crash due to executing state of the current frame command lists and sporadic frame synchronization issue. VSync was disabled by default for Metal.
- Fixed Vulkan RHI build with newer Vulkan SDK versions > 300.
Data libraries
- Added support of prioritizing receivers in emitter list with
priority
argument of methodEmitter<ICallback>::Connect(Receiver<ICallback>& receiver, uint32_t priority)
.
Common changes
- Renamed all macroses
META_CHECK_ARG_*
by removal of ARG suffix toMETA_CHECK_*
. - Apply hidden friend function pattern to binary operators by recommendation from SonarCloud.
User Interface libraries
- Text program bindings now use root constants instead of manually created uniform buffers.
Tests
- Added unit-tests to cover more classes of the "Graphics RHI" layer (continue #122):
ViewState
test was addedFence
test was extendedBufferSet
test was addedCommandKit
test was addedCommandListDebugGroup
test was addedProgramBindings
test was extended with root constant bindings.
Data::EventsTest
was extended to check prioritizing of connected receivers.
External libraries
- DirectXShaderCompilerBinary was updated to
v1.7.2308
- SPIRVCross was updated to
v1.3.296.0
- MetalShaderConverterBinary binaries were added
v1.1
- CPM.cmake was updated to
v0.40.5
- Tracy was updated to
v0.11.2.1
- VulkanHeaders were updated to
v1.3.296
- DirectXHeaders was updated to
v1.3.296.0
- DirectXTex was updated to
v2.0.6
(oct 2024) - FreeType2 was updated to
v2.13.3
- FMT was updated to
v11.0.2
- CLI11 was updated latest mainline from
10.12.2024
- IttApi was updated to
v3.25.3
- Catch2 was updated to
v3.7.1
- MagicEnum was updated to
v0.9.7
- FTXUI was updated to
v5.0.0
- BoostNowide was updated to
v1.87.0
- HLSL++ was updated to
v3.5.3
- TaskFlow was updated to
v3.8.0
Build
- Fixed memory leak of command encoders in Metal applications when RHI PIMPL inlining was disabled. Issue was root caused to
-fobjc-arc
compiler flag (ARC: automatic reference counting) was not set inMethaneBuildOptions
target, as the result ARC was not enabled for the whole application, which led to leaking of some recurrently created Metal objects. - Experimental support of Apple's Metal Shader Converter was added to be used instead of SPIRV-Cross. Unfortunately, it does not work correctly in all cases and is disabled by default under CMake option
METHANE_METAL_SHADER_CONVERTER_ENABLED
. - Updated
CMakeModules/FindWindowsSDK.cmake
with fix for ARM64 architecture detection with VS2022 and Ninja and detection of the latest Windows SDK version 10.0.22621. - Added support of XCode 16 for MacOS Sequoia 15. Also fixed MacOS build compatibility with older Xcode versions.
- Apple application RPATH
/usr/local/lib
was added to findlibvulkan.1.lib
- Added CMake option
METHANE_METAL_FRAMES_SYNC_WITH_DISPATCH_SEMAPHORE
Build\Windows\Build.bat
was extended with more build options.
Continuous Integration
- Allow manual dispatch of CI Build, CodeQL and Sonar Scan workflows in GitHub Actions.
- Switched Sonar-Scan action back to
macos-13
hosted runners to use Intel h/w, instead of M1/ARM, which is not supported yet. - Update all GitHub actions to use latest version of Node.js.
- Fixed CodeCov coverage results upload.
- CodeQL scan was re-enabled on Windows.
- Vulkan SDK was updated to v1.3.290.0 in macOS CI.
Documentation
- Updated all tutorials documentation according to latest code changes and with help of Copilot enhancements.
- Added documentation to
CubeMapArray
andParallelRendering
tutorials.
Note
For MacOS users: In case of error "App Is Damaged and Can't Be Opened" on attempt to run bundled application, try removing application from quarantine using the following command:
sudo xattr -d com.apple.quarantine MethaneHelloTriangle.app
open MethaneHelloTriangle.app
🎄 🎄 🎄 ⛄ 🎅 Happy New Year! 🎅 ⛄ 🎄 🎄 🎄