-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 0.4: Font rendering & Text layout, User Interface basis, Tracy Profiler & GPU instrumentation, Memory and Performance optimizations #61
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ogging in Azure Pipelines
Print tests and exit statuses on Posix system in Azure
…based implementation
…am bindings (WIP)
…font chars & atlas reset
…X12) by requesting context initialization completion before rendering Simplify tutorials by moving context initialization completion to the beginning of App::Render call with request option Move WaitForFpu call from each tutorial Render to base Graphics::App::Render
…Resources uploading is now waited on GPU instead of CPU.
Enable time-trace clang output for build profiling
…native render pass DX12 feature on Windows
egorodet
changed the title
Version 0.4: Text layout & rendering, User Interface basis, Tracy Profiler & GPU instrumentation, Memory and Performance optimisations
Version 0.4: Text layout & rendering, User Interface basis, Tracy Profiler & GPU instrumentation, Memory and Performance optimizations
Sep 4, 2020
egorodet
changed the title
Version 0.4: Text layout & rendering, User Interface basis, Tracy Profiler & GPU instrumentation, Memory and Performance optimizations
Version 0.4: Font rendering & Text layout, User Interface basis, Tracy Profiler & GPU instrumentation, Memory and Performance optimizations
Sep 5, 2020
…rnals repository to speedup cloning
…prefix with `_ptr` suffix
…dMe.md document and add ScopeTimer documentation
…ommand line arguments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
documentation
Write documentation of some feature
enhancement
New feature or request
infrastructure
Build, tools, automation, etc.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Methane Kit v0.4 Release
This release adds text layout & rendering widget, user Interface basis, integrate Tracy Profiler & add GPU instrumentation, many memory and performance optimizations, Graphics API improvements and bug fixes. It is really BIG!
D
key) demonstrates incremental text mesh updates (can be switched off withU
). Typing speed can be changed with=
and-
keys.H
andV
keys.Methane/Samples/AppSettings.hpp
for all samples and tutorials. MacOS apps now render with VSync ON, while Windows apps with VSync OFF by default.Apps/Common/Shaders/Primitives.hlsl
. As the result this significantly improved rendered image in Asteroids sample (closed Add SRGB gamma correction in samples #58)Font::Library
implements font loading with FreeType 2 libraryFont
class is managingFont::Char
glyph metrics, packing to atlas and rendering toR8Unorm
texture:Text
class implements rendering of text block with a given font and layout settings:Text::Layout
settings supported:Text::Wrap
defines wrapping to new line by characters or by woads or no wrapping.Text::HorizonAlignment
withLeft
,Ridht
andCenter
options.Text::VerticalAlignment
withTop
,Bottom
andCenter
options.Text
is created or updated with non-zerorect
inText::Settings
.Text
is managing internal buffer resources on per-frame basis to perform effective text updates without affecting GPU performance and render without artefacts on previously encoded render commands.Text
items reuse single instances ofRenderState
andSampler
objects for allText
widget instances viaObject::Registry
.Units
enum,UnitPoint
,UnitSize
andUnitRect
classes were added inUserInterface/Types.h
to handle UI layout positions and sizes in different units (Pixels and Dots) and conversions between them.UserInterface::Context
is a wrapper aroundGraphics::RenderContext
and is used for creating all UI items serving both layout and rendering functions.UserInterface::Item
andUserInterface::Container
are base UI classes for all widgets.Panel
widget implements container visualised as semi-opaque rectangle usingGraphics::ScreenQuad
Badge
widget was moved fromGraphics/Extensions
and implements item displaying a texture aligned to screen corner.HeadsUpDisplay
widget implements visualisation of common graphics application performance parameters like FPS, frame time, resolution, frame buffers count, GPU adapter name, etc. (closed Render Context Heads Up Display (HUD) #54)HeadsUpDisplay
widget, which can be turned ON by F4 hot-key.UserInterface::App
UserInterface/AppBase.h/cpp
from template classUserInterface/App
to improve build time.Context
changes:Context::RequestDeferredAction
method was added to requestDeferredAction::UploadResources
orDeferredAction::CompleteInitialization
to be performed when previous frame rendering has completed but next frame rendering was not started yet.Context::GetParallelExecutor
provides Taskflow Executor for all parallel execution in the application.Context::GetObjectsRegistry
returns instance ofObject::Registry
which allows to register named Graphics Objects created in scope of current context and request them by name. This allows to reuse single instance of graphics object (likeRenderState
) for rendering of multiple widgets.CommandQueue
changes:Fence
object.CommandQueue::Execute
receives optional argument with lambda callback function called when command list set execution is completed on GPU.CommandQueueDX
incapsulatesTimestampQueryBuffer
instance, which is used internally to query timestamps of command lists execution which are then exposed withTracy::GpuScope
and can be viewed in Tracy Profiler.CommandList
changes:CommandList::DebugGroup
interface was added to represent named debug group data and effectively reuse its memory in runtime between frames. CMake build optionMETHANE_COMMAND_DEBUG_GROUPS_ENABLED
was added to disable command list debug groups.CommandList::State
enum (Pending, Encoding, Committed, Executing) was added and returned withCommandList::GetState
CommandList::WaitUntilCompleted
method was addedCommandList::GetGpuTimeRange
method was added which can be called on command list in Pending state. DirectX 12 method implementation has to be enabled with optionMETHANE_GPU_INSTRUMENTATION_ENABLED
, butMacOS
implementation works right away.RenderCommandListMT
andBlitCommandListMT
was refactored, duplicated code was moved to the base implementation template classCommandListMT
.RenderState
changes:ViewState
was split fromRenderState
to manage setup of viewports and scissors rects separately from main rendering state.RenderState
groups are now compared withmemcmp
which is slightly improving performance in some cases.RenderCommandList
changes:RenderCommandList::SetViewState
method was added.RenderCommandList::SetValidationEnabled
method was added to disable validation of command list command arguments before encoding to GPU command buffers and increase performance.ParallelRenderCommandList
adds the same command to update per-thread command lists option.Resource
changes:Resource::SubResource::Count
andResource::SubResource::Index
structures were addedResource::SubResource
is derived fromData::Chunk
and extends withIndex
and optionalBytesRange
Resource::GetData
method was added returningSubResource
at givenIndex
and optionalBytesRange
, it can be used only for resources withUsage::Readback
flag.Resource::GetDataSize
method was extended with optionalData::MemoryState
argument (Initialized, Reserved values)Resource::GetSubResourceDataSize
andResource::GetSubResourceDataSize
methods addedby reusing allocated memory between frames.
Resource::ReleasePool
was removed and replaced with retaining shared pointers to resources inCommandListBase::CommandState
kept until execution is completed on GPU. This became possible with accurate execution state tracking of command lists done inCommandQueue
waiting thread.Buffer
changes:Buffer::StorageMode
enum is made a part of buffer settings:Managed
- CPU-GPU buffer with automatic data synchronization managed by graphics runtime. Used for volatile buffers.Private
- GPU buffer asynchronously uploaded through the intermediate shared CPU-GPU buffer. User by default for vertex, index and constant buffers.Texture
changes:Texture::SetData
method implementation and hidden from API user.R8Unorm
and others.RenderPass
changes:RenderPass::ReleaseAttachmentTextures
method releases all texture shared pointers, which is used on frame resizing inGraphics::App
to update existing render pass with new frame buffer textures.ProgramBindings
changes:Program::Argument::Modifiers::Constant
is specified at construction.CommandListSet
interface was added to manageCommandList
object collection for memory reuse and effective execution withCommandQueue::Execute
BufferSet
interface was added to manageBuffer
objects collection for memory reuse and effective setup withRenderCommandList::SetVertexBuffers
Resource::Barriers
was implementedMeshBuffers.hpp
Events
library is used as single notifications mechanism for graphics types:Device
is derivedData::IEmitter<IDeviceCallback>
Context
is derived fromData::IEmitter<IContextCallback>
DescriptorHeap
is derived fromData::Emitter<IDescriptorHeapCallback>
interfainstead of notificationScreenQuad
changes:RenderState
,Sampler
, vertex and indexBuffer
are reused for all screen-quad instances viaObject::Registry
.Graphics::App::Render
callsWaitForGpu
andIsReadyToRender
were moved from derived application classes to base implementation.-e,--emulated-render-pass
was added to disable use of DirectX 12 native render passes replaced with emulated behavior, which is useful for frame capturing with many Graphics Debugging & Profiling tools which do not have proper support of DX render passes (closed Add command line argument to graphics apps to replace DX12 native render pass with emulation #62)Graphics/Helpers
toGraphics/Types
,Graphics/Primitives
andGraphics/Camera
Platform::App
changes:AppViewMT
implementation was improved to minimise drawables retention time and was instrumented to collect drawable present timings withTracy::GpuScope
. Instrumentation is disabled by default under macro definitionTRACY_GPU_PRESENT_INSTRUMENTATION_ENABLED
Emitter<IEventInterface>
template class implements connection to many receivers and emitting functions fromIEventInterface
to all connected receivers.Receiver<IEventInterface>
template class is a base for receivers ofIEventInterface
. Automatic disconnect on receiver destroying even during event emitted calls is supported.Animation::DryUpdate
method added to call update function with previously updated elapsed duration.AnimationPool::SetDryUpdateOnPauseEnabled
calls DryUpdate when animations are paused, which is used for window live resizing with paused animations.Data/Parallel.hpp
header withData::ParallelFor
home-brewed implementation was removed and replaced withtask flow::for_each
implementation from Taskflow library used both in all Methane modules and sample applications.Data/Primitives
library toData/Types
andData/Provider
librariesadd_methane_application
CMake function and is enabled using build optionMETHANE_TRACY_PROFILING_ENABLED
with collection on demand whenMETHANE_TRACY_PROFILING_ON_DEMAND
is ON, otherwise trace collection from app startup (closed Add instrumentation for Tracy realtime profiler #56)ScopeTimer
was optimised for lower overhead, work without dynamic memory allocations and was extended with Tracy plot instrumentation to display collected timings on Tracy charts.Tracy::GpuContext
,Tracy::GpuScope
implemented inMethane/TracyGpu.hpp
. CommandLists have built in GPU instrumentation enabled with CMake optionMETHANE_GPU_INSTRUMENTATION_ENABLED
CommandListBase.cpp
due to no support of overlapping regions appearing during parallel rendering in Asteroids sample.METHANE_ITT_METADATA_ENABLED
via macro definitionITT_ARGUMENTS_METADATA_ENABLED
:ITT_FUNCTION_ARG
andITT_MARKER_ARG
macroses added inIttApiHelper.h
to instrument named arguments of different types.ITT_FUNCTION_TASK
macros automatically adds__file__
and__line__
arguments to all instrumented function tasks when ITT metadata is enabled.RenderContext::Preset
call and include two metadata arguments:Frame-Buffer-Index
andFrame-Index
.ScopeTimer
instrumentation for displaying collected timings on custom chart in traceMETA_*
instrumentation macro definitions were added inMethane/Instrumentation.h
combining both ITT and Tracy instrumentation all together. AllITT_FUNCTION_TASK
instrumentation was replaced withMETA_FUNCTION_TASK
all across Methane Kit sources.META_LOG
is enabled with CMake optionMETHANE_LOGGING_ENABLED
META_SET_THREAD_NAME
macros was added to set thread name both using ITT and Tracy APIs and using OS-specific API. Thread names are set automatically for Main thread and for Command Queue threads waiting for command lists execution.std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t>
in VS2017, which is required for UTF8 string conversion to UTF32 encoding inUserInterface/Font.cpp
.-ftime-trace
which can be analysed either withChrome Trace
viewer or withCompile Score
plugin in Visual Studio. Clang build configurations are added inCMakeSettings.json
for Visual Studio build convenience.MethaneBuildOptions
interface targetPRIVATE
&PUBLIC
access modifiersadd_methane_embedded_fonts
CMake function was added toCMake/MethaneResources.cmake
for embeddeding font resources in applications and libraries.Build\Windows\Build.bat
andBuild\Posix\Build.sh
. Diagrams indot
andpng
formats are written in build output directoryGraphViz
(closed Support Cmake modules dependency diagrams generation with GraphViz #57)RelWithDebInfo
configuration, so samples and tutorials executables are provided with PDBs in published artifacts.