Repository navigation
Methane Kit v0.8.2 #162
egorodet
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Methane Kit v0.8.2 update restores build compatibility with the latest compilers, updates all external dependencies and fixes a large number of graphics API validation errors, thread-safety issues and runtime stability bugs, most of which were found with the newly added automated applications run test:
VS2026-*CMake presets were added along with the existingVS2022-*presets.ID3D12InfoQueue1message callback in DirectX 12,VK_EXT_debug_utilsmessenger in Vulkan andMTLLogStatewith command buffer error reporting in Metal. New test scriptBuild/Unix/CI/RunApplicationsTest.shruns all applications and fails on any validation or runtime error printed to the console output. It's not used in CI yet, because build environment has no GUI and GPU support.Base::CommandQueueTracking,Vulkan::QueueFamilyReservation,Vulkan::CommandListSetand in the timestamp query pools, which caused sporadic hangs and crashes in multi-threaded rendering.Graphics libraries
Base::CommandQueueTracking:GetNextExecutingCommandListSet()was replaced withPopNextExecutingCommandListSet(), which atomically pops the command list set and waits for it, eliminating the race betweenWaitUntilCompleted,CompleteExecutionand the background execution-waiting thread; template helperProcessExecutingCommandListSetandIsExecutingOnFrameIndexwere added for the FIFO-ordered frame completion. Timestamp query pool initialization was guarded with a mutex andICommandQueue::GetTimestampQueryPoolPtr()now returnsPtrby value instead of a reference, which could dangle.Base::RenderCommandList::UpdateDrawingState, which incorrectly skipped tracking of the primitive type change.CommandListSet::GetCombinedName()was madeconstandBase::CommandQueueTrackingexecution thread was switched tostd::jthread.Methane/StbImage.hwrapper header, which suppresses external code compiler warnings and disables SIMD in GCC debug builds, replacing ad-hocstb_image.hinclusions inImageLoader.cppandAppLin.cpp.Camera::ResetOrientationand reduced enums verbosity inQuadMeshwithusing enum(SonarQube issues).Base::Context: lazily created default command kits were guarded with a mutex;m_requested_actionandm_is_completing_initializationwere replaced with atomics, with the deferred action escalated by a compare-exchange loop and cleared only when performed.Base::CommandKit: lazily created command queue, lists, fences and list sets were guarded with a mutex, with the*Unlocked()helpers added for the nested access.Base::CommandQueueTracking:CompleteCommandListSetExecution()does not pop the executing queue any more, becausePopNextExecutingCommandListSet()already pops the command list set atomically with waiting for it.Base::RenderPass: stencil attachment texture is invalidated onUpdate()together with the other attachment texture caches, under the mutex guarding their initialization.GetFrameScissorRect()computes bounds in a signed 64-bit type and clamps them to the render attachment size, fixing the unsigned underflow of the offset and extent for a frame rect moved outside of the attachment.Rhi::TextureViewandRhi::CommandListSetconstructors were madeexplicit.DirectX RHI
ID3D12InfoQueue1to print DirectX 12 validation messages to the platform debug output and unregistered on device release.COPYtype: resources are kept inCommonstate, which is implicitly promoted by the copy queue, fixing validation errorD3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE.RenderStatepipeline description:ForcedSampleCountis left zero (errorCREATEGRAPHICSPIPELINESTATE_INVALID_FORCED_SAMPLE_COUNT) andDSVFormatalways matches the render pattern depth attachment format (errorCOMMAND_LIST_DRAW_DEPTH_STENCIL_VIEW_NOT_SET).Vulkan RHI
vk::Fencewas removed fromRenderContext::FrameSync; image acquisition now waits for completion of the render submission which consumed the image-available semaphore, satisfyingVUID-vkAcquireNextImageKHR-semaphore-01779. Bounded acquisition timeout and retries count were added instead of the infiniteUINT64_MAXtimeout.CommandListSetexecution-completed semaphore is created lazily and is signalled only for the command list sets targeting a specific frame buffer, fixingVUID-vkQueueSubmit-pSignalSemaphores-00067caused by permanently signalled semaphores of non-frame command lists.VUID-vkDestroySurfaceKHR-surface-01266) and the swap-chain is re-initialized directly to avoid recursive re-entrance toGetNextFrameBufferIndex().VULKAN_HPP_DEFAULT_DISPATCHERis no longer specialized withvk::Device, because the single global dispatcher was resolving device-level entry points of the last created device and dispatched calls to a wrong ICD on multi-GPU systems. Native device handle is now updated inRenderContext::Initialize()and descriptor pools are destroyed instead of being reset, because they can not be reused with another device.VK_GOOGLE_HLSL_FUNCTIONALITY_1andVK_GOOGLE_USER_TYPEdevice extensions were enabled and SPIRV byte code is stripped of the reflection instructions withRemoveHlslReflectionFromSpirv()when they are not supported, fixingVUID-VkShaderModuleCreateInfo-pCode-08742.ProgramBindingswas fixed to iterate per-binding instead of using a single flat descriptors count, which caused out-of-bounds descriptor access with non-contiguous bindings.srcStageMask/dstStageMaskare replaced witheTopOfPipe/eBottomOfPipe, fixingVUID-vkCmdPipelineBarrier-srcStageMask-03937anddstStageMask-03937.RenderStatedetectsVK_KHR_portability_subsetand enables primitive restart for strip and dynamic topologies on devices which can not disable it, silencing MoltenVK warning "Metal does not support disabling primitive restart".RenderPass::CreateNativeFrameBuffernow validates attachment texture dimensions against the render pass frame size.VkSubmitInfowithVkTimelineSemaphoreSubmitInfoand stale message-ID filters of the debug messenger callback, which are not needed with the current Vulkan SDK. Debug messenger callback signature was migrated tovk::types.RenderContext.mmandPlatformExt.mmon Apple platforms (workaround ofvulkan.hppconstant-expression issue withCAMetalLayer) and added explicit release of the Metal view in theRenderContextdestructor.Vulkan::TimestampQueryPooltakes the first CPU time domain supported by the device from the platform preference list instead of one hard-coded domain, because MoltenVK exposesCLOCK_MONOTONIC_RAWonly.MTLCounterSampleBufferand fall back to emulated timestamps.Metal RHI
Metal::DebugMessageswhich prints GPU shader validation messages (MTLLogState,MTLFunctionLog) and command buffer execution errors to the platform debug output when the Metal debug layer is enabled withMTL_DEBUG_LAYER/MTL_SHADER_VALIDATIONenvironment variables.CommandQueue::CreateNativeCommandBuffer()with per-encoder execution status error reporting enabled in debug builds.Metal::ProgramArgumentBindingnative resources were moved to the immutableNativeResourceViewssnapshot, which is built locally and published under the mutex, so thatMetal::ProgramBindingsreaders keep using the previous one until it is complete.Platform libraries
Platform::SetPrintToConsoleEnabled()and application command line flag--print_debug_messages_to_console, which redirects debug output tostd::coutinstead ofOutputDebugStringon Windows andNSLogon MacOS, so that graphics API validation messages can be captured by the CI test script.AppDelegatedisables window state restoration, which is not implemented, and opts in to the secure restorable state coding to silence the AppKit warning.Common changes
Tutorial applications
ConsoleComputetutorial withadd_prerequisite_binaries(...)extended with theIS_CONSOLE_APPargument.ConsoleComputenow waits for the compute command list completion instead of the whole context, fixing the GPU wait done in the invalid command list state, usesstd::jthreadfor the UI refresh thread and declares the image format in theGameOfLife.hlslcompute shader.Typographytutorial crash on resizing done before the text items were created byInit().AppBase::IsResizing()returnsfalseafter an initialization error, so that partially constructed application state is not resized.Tests
RenderCommandListdrawing with multiple primitive types in a single command list (DrawandDrawIndexed), which cover the fixed primitive type change tracking bug.RenderPassunit-tests were extended to cover invalidation of the attachment texture caches on settings update, with a separate stencil attachment added to the test render pattern.External libraries
v1.9.2602v1.4.357.0v1.619.5v2.1.1(may 2026)v0.14.1v12.2.0v7.0.3v4.1.0v3.9v3.15.3v2.7.2v0.9.8v3.28.2v0.43.1v4.6.0methanebranchBuild
VS2026-*CMake configure and build presets usingVisual Studio 18 2026generator for Win64/Win32 x DX/VK x Default/Profile/Scan variants (require CMake 4.2+).Build\Windows\Build.batuses Visual Studio 2026 generator by default,--vs2022option was added for backward compatibility. Support of Visual Studio 2019 build was dropped.Build/Unix/CI/InstallMacOsPrerequisites.shscript, which downloads and installs the Metal Toolchain required since Xcode 26.CMake/MethaneModules.cmakefor the different spellings ofCMAKE_SYSTEM_PROCESSOR.Continuous Integration
VS2026-*presets on Windows and were updated to the latest GitHub actions:actions/checkout@v7,actions/cache@v6,actions/upload-artifact@v7,github/codeql-action/*@v4.RunSonarScanner.shscript toSonarSource/sonarqube-scan-action@v8.2.0with separate steps for push and pull-request events; images were excluded from the analysis to fix invalid encoding errors.Build/Unix/CI/RunApplicationsTest.shscript, which runs all applications in GUI mode and checks the console output for the graphics API validation and runtime errors on all platforms.v1.4.350.1and Tracy release binaries tov0.14.0.1.Documentation
Build/README.mdwith the new build presets, andExternals/README.mdwith the updated dependency versions.CLAUDE.mdwith the project guidance for Claude Code.This discussion was created from the release Methane Kit v0.8.2.
All reactions