|
Foundation
|
Renderer implementing a Frame Graph system with automatic resource tracking and synchronization. More...
#include <Renderer.hpp>
Classes | |
| struct | ExecutePerThreadCommandLists |
| struct | FrameSyncObjects |
| struct | RendererSetup |
| Helper class containing all states pertaining to Renderer's Setup phase. More... | |
Public Types | |
| enum class | State { Undefined , Setup , PostSetup , Execute } |
Public Member Functions | |
| Renderer ()=delete | |
| Renderer (RendererDesc const &desc, RHIApplicationHandle< RHIDevice > device, RHIDeviceHandle< RHISwapchain > swapchain, Allocator *allocator) | |
| void | BeginSetup () |
| Begins the setup phase of the render graph. | |
| template<typename T , typename... Args> requires std::is_base_of_v<RenderPass, T> | |
| PassHandle | CreatePassImpl (StringView name, RHIDeviceQueueType queue, size_t priority, Args &&... args) |
| Create a render pass from a RenderPass* implementation and add it to the render graph. | |
| template<typename FSetup , typename FRecord > | |
| PassHandle | CreatePass (StringView name, RHIDeviceQueueType queue, size_t priority, FSetup &&setup, FRecord &&record) |
| Create a render pass from a Setup(Renderer*, PassHandle) and Record(Renderer*, PassHandle,
RHICommandList*) lambda. | |
| template<typename T > | |
| ResourceHandle | CreateResource (StringView name, T const &desc) |
| Create a new resource to be used in the render graph. | |
| ResourceHandle | CreateSampler (RHIDeviceSampler::SamplerDesc const &desc) const |
| Creates a sampler with the specified name and descriptor. | |
| void | BindPass (PassHandle pass, PassHandle other) |
| Declares an inter-pass dependency, where the other pass should execute-before the current pass. | |
| void | BindShader (PassHandle pass, RHIShaderStage stage, StringView entry_point, const char *shader_path, Span< const char > specializationData={}) const |
| Binds shader file path to a certain pass at a certain stage. | |
| void | BindPushConstant (PassHandle pass, RHIShaderStage stage, size_t offset, size_t size) const |
| Declares a range of Push Constant used in a stage. | |
| void | BindVertexInput (PassHandle pass, RHIPipelineState::PipelineStateDesc::VertexInput const &info) const |
| Associates Vertex Input description with this pass. | |
| void | BindBufferUniform (PassHandle pass, ResourceHandle buffer, RHIPipelineStage stage, StringView bind_point) const |
| Binds a uniform buffer to a specified binding point in a rendering pass. | |
| void | BindBufferStorageRead (PassHandle pass, ResourceHandle buffer, RHIPipelineStage stage, StringView bind_point) const |
| Binds a read-only storage buffer to a specified binding point. | |
| void | BindBufferUnordered (PassHandle pass, ResourceHandle buffer, RHIPipelineStage stage, StringView bind_point) const |
| Binds a buffer for unordered (UAV) access from shaders (read and/or write in any order). | |
| void | BindBufferShaderRead (PassHandle pass, ResourceHandle buffer, RHIPipelineStage stage) const |
| Declares this pass has shaders that will read from this buffer. e.g. Vertex, Index. | |
| void | BindBufferCopyDst (PassHandle pass, ResourceHandle buffer) const |
| Declares that this pass will write to the buffer via copy. | |
| void | BindBufferCopySrc (PassHandle pass, ResourceHandle buffer) const |
| Declares that this pass will read from the buffer via copy. | |
| void | BindTextureSampler (PassHandle pass, ResourceHandle sampler, StringView bind_point) const |
| Binds a sampler to the shader. | |
| void | BindDescriptorSet (PassHandle pass, StringView bind_point, RHIDeviceDescriptorSetLayout *layout) |
| Manually bind an existing descriptor set (layout) to the pipeline. | |
| ResourceHandle | BindTextureSRV (PassHandle pass, ResourceHandle texture, StringView bind_point, RHIPipelineStage stage, RHITextureViewDesc const &desc) const |
| Binds a texture as a Shader Resource View (read-only sampling / fetch). | |
| ResourceHandle | BindTextureUAV (PassHandle pass, ResourceHandle texture, StringView bind_point, RHIPipelineStage stage, RHITextureViewDesc const &desc) const |
| Binds a texture for unordered (UAV) read-write access in shaders. | |
| ResourceHandle | BindTextureRTV (PassHandle pass, ResourceHandle texture, RHITextureViewDesc const &desc, RHIPipelineState::PipelineStateDesc::Attachment::Blending const &blending={}) const |
| Binds a texture as a Render Target View (color attachment) for a graphics pass. | |
| ResourceHandle | BindTextureDSV (PassHandle pass, ResourceHandle texture, RHITextureViewDesc const &desc) const |
| Binds a texture as a Depth-Stencil View for a graphics pass. | |
| void | BindBackbufferRTV (PassHandle pass, RHIPipelineState::PipelineStateDesc::Attachment::Blending const &blending={}) const |
| void | BindBackbufferUAV (PassHandle pass, int set_index) const |
| Binds the backbuffer as RW access at binding 0 of set index. | |
| void | BindTextureCopyDst (PassHandle pass, ResourceHandle texture, RHITextureSubresourceRange const &range={}) const |
| Declares that this pass will write to the texture via copy / blit (transfer destination). | |
| void | BindTextureCopySrc (PassHandle pass, ResourceHandle texture, RHITextureSubresourceRange const &range={}) const |
| Declares that this pass will read from the texture via copy / blit (transfer source). | |
| void | PassSetRasterizerFlags (PassHandle pass, RHIPipelineState::PipelineStateDesc::Rasterizer const &rasterizer={}, RHIPipelineState::PipelineStateDesc::DepthStencil const &depth_stencil={}) const |
| Sets the rasterizer and depth-stencil state for a graphics pass. | |
| void | EndSetup () |
| Finish setting up the render graph. | |
| RHIExtent2D | GetSwapchainExtent () const |
| Get the current swapchain extents. | |
| RHIExtent3D | GetSwapchainExtent3D () const |
| Get the current swapchain extents as a 3D extent with depth 1. | |
| Variant< RHIBuffer *, RHITexture * > | DerefResource (const ResourceHandle handle) const |
| Dereference a resource handle to its underlying RHI resource. | |
| RHITextureView * | DerefTextureView (const ResourceHandle handle) const |
| Dereference a texture view handle to its underlying RHI texture view. | |
| RHIDeviceSampler * | DerefSampler (const ResourceHandle handle) const |
| Dereference a sampler handle to its underlying RHI sampler. | |
| RHIPipelineState * | DerefPipelineState (const PassHandle pass) const |
| Dereference the automatically built pipeline state object handle associated with a given pass. | |
| Vector< RHIDeviceDescriptorSet * > const & | DerefDescriptorSets (const PassHandle pass) const |
| Dereference the built descriptor sets associated with a given pass. | |
| Allocator * | GetAllocator () const |
| RHIExtent3D | CmdGetComputeLocalSize (PassHandle pass) const |
| Helper that retrieves the local size declared by a compute pass. | |
| void | CmdDispatch (PassHandle pass, RHICommandList *cmd, RHIExtent3D thread_size) const |
| Helper that dispatches a compute shader with the specified THREAD count. | |
| void | CmdSetPipeline (PassHandle pass, RHICommandList *cmd) const |
| Helper that sets the current pass's PSO and descriptor sets to the current command list. | |
| void | CmdBindDescriptorSet (PassHandle pass, RHICommandList *cmd, uint32_t set_index, RHIDeviceDescriptorSet *descriptor_set) const |
| Helper that binds a single descriptor set to the current command list. | |
| void | CmdBindDescriptorSet (PassHandle pass, RHICommandList *cmd, StringView bind_point, RHIDeviceDescriptorSet *descriptor_set) const |
| Helper that binds a single descriptor set to the set of the specified bind point. | |
| void | CmdBeginGraphics (PassHandle pass, RHICommandList *cmd, RHIExtent2D const &extent, Span< const Optional< RHIClearColor > > clear_rtv={}, Optional< RHIClearDepthStencil > const &clear_dsv=RHIClearDepthStencil{0.0f, 0u}) |
| Helper that pushes correct descriptor sets and PSO to the current command list, and pushes correct BeginGraphics() commands with declared RTVs and DSVs to the current command list. | |
| template<typename T > | |
| void | CmdSetPushConstant (PassHandle pass, RHICommandList *cmd, RHIShaderStage stage, size_t offset, T const &data) |
| Helper that sets a Push Constant range data with a single l-value. | |
| State | GetState () const |
| Retrieves the current state of the renderer. | |
| uint32_t | GetFrameSwaps () const |
| Get the number of frames that can be simultaneously in-flight. | |
| uint64_t | GetFrame () const |
| Retrieves the current frame number. | |
| uint32_t | GetSwap () const |
| Retrieves the current swap index at the time of ExecuteFrame(). | |
| uint64_t | GetSync () const |
| Retrieves the current synchronization index. | |
| TrackedPass const & | GetTrackedPass (PassHandle pass) |
| Retrieves an internal tracked pass associated with the given handle, read-only. | |
| bool | IsAsyncComputeEnabled () const |
| Returns whether async compute is enabled. | |
| bool | IsPresentEnabled () const |
| Returns whether the swapchain is enabled. | |
| void | SetSwapchain (RHIDeviceHandle< RHISwapchain > swapchain) |
| Update the swapchain to a new one. You must call this when the window is resized or the swapchain is invalidated. | |
| void | BeginExecute () |
| Resets the temporary execution allocator , and waits for the possibly multi-buffered next frame to finish rendering. | |
| void | ExecuteFrame () |
| Executes all passes in the render graph for one frame. | |
| void | EndExecute () |
| Ends the execution phase and performs GPU submission, possibly with a RHIDeviceQueue::Present. | |
| String | DbgDumpGraphviz () const |
| String | DbgDumpActivePasses () const |
| String | DbgDumpExecutionGroups () const |
| Span< const uint64_t > | DbgProfilePassTiming (uint64_t sync, float &resolutionNS) const |
| Retrieves timings for all passes executed in the last frame associated with the specified sync index. The values are refreshed upon BeginExecute() call. | |
| uint64_t | DbgProfilePresentTiming (uint64_t sync, float &resolutionNS) const |
| Retrieves the total ticks between two subsequent swapchain presents by EndExecute, measured on CPU with system's high-resolution timer. The value is refreshed upon EndExecute() call. | |
Private Types | |
| using | ExecuteBarrierList = Vector< Pair< Variant< RHIBuffer *, RHITexture * >, RHICommandList::TransitionDesc > > |
| using | ExecuteBarrierPCmdOrPBarrierList = Variant< RHICommandList *, ExecuteBarrierList * > |
Renderer implementing a Frame Graph system with automatic resource tracking and synchronization.
The Renderer is responsible for managing rendering passes, resources, and synchronization on both the Graphics queue and an optional Async Compute queue (if enabled and supported).
Do note - that the Transfer queue is not used in the Renderer. As such, you're free to use it for asynchronous resource uploads.
|
private |
|
private |
|
delete |
| Renderer::Renderer | ( | RendererDesc const & | desc, |
| RHIApplicationHandle< RHIDevice > | device, | ||
| RHIDeviceHandle< RHISwapchain > | swapchain, | ||
| Allocator * | allocator | ||
| ) |
| void Renderer::BeginExecute | ( | ) |
| void Renderer::BeginSetup | ( | ) |
Begins the setup phase of the render graph.
| void Renderer::BindBackbufferRTV | ( | PassHandle | pass, |
| RHIPipelineState::PipelineStateDesc::Attachment::Blending const & | blending = {} |
||
| ) | const |
@breif Binds the backbuffer as the first Render Target.
This can be automatically bound to the pipeline with CmdBeginGraphics().
| void Renderer::BindBackbufferUAV | ( | PassHandle | pass, |
| int | set_index | ||
| ) | const |
Binds the backbuffer as RW access at binding 0 of set index.
| void Renderer::BindBufferCopyDst | ( | PassHandle | pass, |
| ResourceHandle | buffer | ||
| ) | const |
Declares that this pass will write to the buffer via copy.
This MUST be called before calling cmd->CopyBuffer(), etc. at Record time.
| void Renderer::BindBufferCopySrc | ( | PassHandle | pass, |
| ResourceHandle | buffer | ||
| ) | const |
Declares that this pass will read from the buffer via copy.
This MUST be called before calling cmd->CopyBuffer(), etc. at Record time.
| void Renderer::BindBufferShaderRead | ( | PassHandle | pass, |
| ResourceHandle | buffer, | ||
| RHIPipelineStage | stage | ||
| ) | const |
Declares this pass has shaders that will read from this buffer. e.g. Vertex, Index.
This by itself has no effect on binding. You need to call cmd->BindVertexBuffer(), cmd->BindIndexBuffer() at Record time to use the buffer.
| void Renderer::BindBufferStorageRead | ( | PassHandle | pass, |
| ResourceHandle | buffer, | ||
| RHIPipelineStage | stage, | ||
| StringView | bind_point | ||
| ) | const |
Binds a read-only storage buffer to a specified binding point.
This is only available at Setup time.
Bind points are effectively shader variable names, which will be automatically dereferenced.
This can be automatically bound to the pipeline with CmdSetPipeline()
| void Renderer::BindBufferUniform | ( | PassHandle | pass, |
| ResourceHandle | buffer, | ||
| RHIPipelineStage | stage, | ||
| StringView | bind_point | ||
| ) | const |
Binds a uniform buffer to a specified binding point in a rendering pass.
This is only available at Setup time.
Bind points are effectively shader variable names, which will be automatically dereferenced.
This can be automatically bound to the pipeline with CmdSetPipeline()
| void Renderer::BindBufferUnordered | ( | PassHandle | pass, |
| ResourceHandle | buffer, | ||
| RHIPipelineStage | stage, | ||
| StringView | bind_point | ||
| ) | const |
Binds a buffer for unordered (UAV) access from shaders (read and/or write in any order).
This is only available at Setup time.
Bind points are effectively shader variable names, which will be automatically dereferenced.
This can be automatically bound to the pipeline with CmdSetPipeline()
| void Renderer::BindDescriptorSet | ( | PassHandle | pass, |
| StringView | bind_point, | ||
| RHIDeviceDescriptorSetLayout * | layout | ||
| ) |
Manually bind an existing descriptor set (layout) to the pipeline.
| void Renderer::BindPass | ( | PassHandle | pass, |
| PassHandle | other | ||
| ) |
Declares an inter-pass dependency, where the other pass should execute-before the current pass.
| void Renderer::BindPushConstant | ( | PassHandle | pass, |
| RHIShaderStage | stage, | ||
| size_t | offset, | ||
| size_t | size | ||
| ) | const |
Declares a range of Push Constant used in a stage.
This is only available at Setup time.
You MUST bind a valid range if Push Constants are used in shaders, i.e. before calling CmdSetPushConstant()
| void Renderer::BindShader | ( | PassHandle | pass, |
| RHIShaderStage | stage, | ||
| StringView | entry_point, | ||
| const char * | shader_path, | ||
| Span< const char > | specializationData = {} |
||
| ) | const |
Binds shader file path to a certain pass at a certain stage.
This is only available at Setup time. No allocation, or parsing of shader is performed until EndSetup() is called.
Shaders are unique per stage, and may be omitted e.g. there's only a copy.
| specializationData | Binary blob of specialization data, if any. Must be bound in shader at ID 0, offset 0. |
| void Renderer::BindTextureCopyDst | ( | PassHandle | pass, |
| ResourceHandle | texture, | ||
| RHITextureSubresourceRange const & | range = {} |
||
| ) | const |
Declares that this pass will write to the texture via copy / blit (transfer destination).
Sets TransferWrite access over the specified subresource range (all if empty). No view is created; raw resource state tracking is updated.
| void Renderer::BindTextureCopySrc | ( | PassHandle | pass, |
| ResourceHandle | texture, | ||
| RHITextureSubresourceRange const & | range = {} |
||
| ) | const |
Declares that this pass will read from the texture via copy / blit (transfer source).
Sets TransferRead access over the specified subresource range (all if empty). No view is created; raw resource state tracking is updated.
| ResourceHandle Renderer::BindTextureDSV | ( | PassHandle | pass, |
| ResourceHandle | texture, | ||
| RHITextureViewDesc const & | desc | ||
| ) | const |
Binds a texture as a Depth-Stencil View for a graphics pass.
Only one DSV may be active per pass. Layout transitions include depth / stencil write or read. Returns the created/assigned view handle (auto-created if needed).
This can be automatically bound to the pipeline with CmdBeginGraphics().
| ResourceHandle Renderer::BindTextureRTV | ( | PassHandle | pass, |
| ResourceHandle | texture, | ||
| RHITextureViewDesc const & | desc, | ||
| RHIPipelineState::PipelineStateDesc::Attachment::Blending const & | blending = {} |
||
| ) | const |
Binds a texture as a Render Target View (color attachment) for a graphics pass.
The pass must execute on a graphics-capable queue. Multiple RTVs may be bound. Returns the created/assigned view handle (auto-created if needed).
This can be automatically bound to the pipeline with CmdBeginGraphics().
The order of multiple render targets is the same as the insertion order of the RTVs.
| void Renderer::BindTextureSampler | ( | PassHandle | pass, |
| ResourceHandle | sampler, | ||
| StringView | bind_point | ||
| ) | const |
Binds a sampler to the shader.
Bind points are effectively shader variable names, which will be automatically dereferenced.
| ResourceHandle Renderer::BindTextureSRV | ( | PassHandle | pass, |
| ResourceHandle | texture, | ||
| StringView | bind_point, | ||
| RHIPipelineStage | stage, | ||
| RHITextureViewDesc const & | desc | ||
| ) | const |
Binds a texture as a Shader Resource View (read-only sampling / fetch).
Bind points are effectively shader variable names, which will be automatically dereferenced.
No view is created until EndSetup() is called.
| ResourceHandle Renderer::BindTextureUAV | ( | PassHandle | pass, |
| ResourceHandle | texture, | ||
| StringView | bind_point, | ||
| RHIPipelineStage | stage, | ||
| RHITextureViewDesc const & | desc | ||
| ) | const |
Binds a texture for unordered (UAV) read-write access in shaders.
Bind points are effectively shader variable names, which will be automatically dereferenced.
Declares ShaderRead | ShaderWrite access and sets layout to General (or equivalent), bound as StorageImage, and creates a view.
No view is created until EndSetup() is called.
| void Renderer::BindVertexInput | ( | PassHandle | pass, |
| RHIPipelineState::PipelineStateDesc::VertexInput const & | info | ||
| ) | const |
Associates Vertex Input description with this pass.
This is only available at Setup time.
This only applies to passes on Graphics queues. And will throw otherwise.
You MUST bind a valid VertexInput at creation time if cmd->Draw[Indexed] is used.
This can be automatically bound to the pipeline with CmdBeginGraphics().
|
private |
|
private |
| void Renderer::CmdBeginGraphics | ( | PassHandle | pass, |
| RHICommandList * | cmd, | ||
| RHIExtent2D const & | extent, | ||
| Span< const Optional< RHIClearColor > > | clear_rtv = {}, |
||
| Optional< RHIClearDepthStencil > const & | clear_dsv = RHIClearDepthStencil{0.0f, 0u} |
||
| ) |
Helper that pushes correct descriptor sets and PSO to the current command list, and pushes correct BeginGraphics() commands with declared RTVs and DSVs to the current command list.
| void Renderer::CmdBindDescriptorSet | ( | PassHandle | pass, |
| RHICommandList * | cmd, | ||
| StringView | bind_point, | ||
| RHIDeviceDescriptorSet * | descriptor_set | ||
| ) | const |
Helper that binds a single descriptor set to the set of the specified bind point.
| void Renderer::CmdBindDescriptorSet | ( | PassHandle | pass, |
| RHICommandList * | cmd, | ||
| uint32_t | set_index, | ||
| RHIDeviceDescriptorSet * | descriptor_set | ||
| ) | const |
Helper that binds a single descriptor set to the current command list.
| void Renderer::CmdDispatch | ( | PassHandle | pass, |
| RHICommandList * | cmd, | ||
| RHIExtent3D | thread_size | ||
| ) | const |
Helper that dispatches a compute shader with the specified THREAD count.
This is equivalent to calling:
| RHIExtent3D Renderer::CmdGetComputeLocalSize | ( | PassHandle | pass | ) | const |
Helper that retrieves the local size declared by a compute pass.
Calling this on a non-CS/Task/Mesh bound queue is incorrect, and will throw.
| void Renderer::CmdSetPipeline | ( | PassHandle | pass, |
| RHICommandList * | cmd | ||
| ) | const |
Helper that sets the current pass's PSO and descriptor sets to the current command list.
|
inline |
Helper that sets a Push Constant range data with a single l-value.
|
inline |
Create a render pass from a Setup(Renderer*, PassHandle) and Record(Renderer*, PassHandle, RHICommandList*) lambda.
NOTE: Prefer using this over CreatePass<T>() for stateless passes
This can be called inside a pass's Setup() function, or after CreatePass() but before EndSetup().
| queue | Queue to prefer running this pass in - this is a hint, and might be ignored if async compute is disabled. |
| priority | Priority of this pass. Higher priority passes are scheduled earlier. |
| setup | Lambda of type void(PassHandle self, Renderer*) called at Setup time. |
| record | Lambda of type void(PassHandle self, Renderer*, RHICommandList*) called at Record time. |
|
inline |
Create a render pass from a RenderPass* implementation and add it to the render graph.
This is only available at Setup time.
| T | Type of RenderPass to create. |
| queue | Queue to prefer running this pass in - this is a hint, and might be ignored if async compute is disabled. |
| priority | Priority of this pass. Higher priority passes are scheduled earlier. |
|
inline |
Create a new resource to be used in the render graph.
This is only available at Setup time. No allocation is performed until EndSetup() is called.
All resources created by a pass that is not culled will be created, regardless of usage.
Resources can be imported by passing in RHIDeviceRef<RHIBuffer> or RHIDeviceRef<RHITexture>.
| desc | Resources can be created by passing in RHIBufferDesc, RHITextureDesc, and can be imported by passing in RHIDeviceRef<RHIBuffer>, RHIDeviceRef<RHITexture>, or raw, pinned pointers RHIBuffer*, or RHITexture* |
| ResourceHandle Renderer::CreateSampler | ( | RHIDeviceSampler::SamplerDesc const & | desc | ) | const |
Creates a sampler with the specified name and descriptor.
This is only available at Setup time. No allocation is performed until EndSetup() is called.
createSampler() should be generally preferred over this.
|
private |
|
private |
| String Renderer::DbgDumpActivePasses | ( | ) | const |
| String Renderer::DbgDumpExecutionGroups | ( | ) | const |
| String Renderer::DbgDumpGraphviz | ( | ) | const |
Retrieves timings for all passes executed in the last frame associated with the specified sync index. The values are refreshed upon BeginExecute() call.
Retrieves the total ticks between two subsequent swapchain presents by EndExecute, measured on CPU with system's high-resolution timer. The value is refreshed upon EndExecute() call.
|
private |
Explicitly declares that this pass will access the buffer in the specified stage with the specified access.
This is only available at Setup time.
This does not bind the buffer to any shader - use BindBuffer...() for that.
|
private |
Declares that this pass will access the texture in the specified stage with the specified access.
This is only available at Setup time.
This does not bind the texture to any shader - use BindTexture...() for that.
|
inline |
Dereference the built descriptor sets associated with a given pass.
|
inline |
Dereference the automatically built pipeline state object handle associated with a given pass.
|
inline |
Dereference a resource handle to its underlying RHI resource.
This should only be called inside a pass's Record() function, or after EndSetup().
|
inline |
Dereference a sampler handle to its underlying RHI sampler.
This should only be called inside a pass's Record() function, or after EndSetup().
|
inline |
Dereference a texture view handle to its underlying RHI texture view.
This should only be called inside a pass's Record() function, or after EndSetup().
| void Renderer::EndExecute | ( | ) |
Ends the execution phase and performs GPU submission, possibly with a RHIDeviceQueue::Present.
ref RHISwapchainResizeException if swapchain is resized and has not been recreated.
| void Renderer::EndSetup | ( | ) |
Finish setting up the render graph.
The last created pass is used as the epilogue (final) pass, and will be used to determine active passes and resource lifetimes.
You must call this before Execute().
|
private |
| thread_id | -1 for main thread, [0, kRecordThreadpoolSize] for workers |
|
private |
Executes barriers for a whole buffer.
|
private |
Executes all barriers for a pass.
|
private |
Executes barriers for a subresource range of a texture.
|
private |
| void Renderer::ExecuteFrame | ( | ) |
Executes all passes in the render graph for one frame.
This includes recording command lists, submitting them to the appropriate queues, and presenting the swapchain if enabled.
|
inlineprivate |
Helper to get the queue index of a queue type.
|
private |
|
private |
|
inline |
|
inline |
Retrieves the current frame number.
This value is updated at EndExecute(), and is guaranteed to be monotonic.
|
inline |
Get the number of frames that can be simultaneously in-flight.
|
inline |
Retrieves the current state of the renderer.
|
inline |
Retrieves the current swap index at the time of ExecuteFrame().
This value is associated with the current frame in flight. It's guaranteed to be less than GetFrameSwaps(), and starts from 0.
|
inline |
Get the current swapchain extents.
|
inline |
Get the current swapchain extents as a 3D extent with depth 1.
|
inline |
Retrieves the current synchronization index.
This value is associated with the current synchronization primitives at the current time. It's guaranteed to be less than GetFrameSwaps(), and starts from 0.
|
inline |
Retrieves an internal tracked pass associated with the given handle, read-only.
|
inline |
Returns whether async compute is enabled.
If this returns false, all passes will be executed on the graphics queue, and any queue hints passed during pass creation will be ignored.
|
inline |
Returns whether the swapchain is enabled.
If this returns false, no backbuffer will be acquired or presented, and any passes that write to the backbuffer will throw at EndSetup() time.
| void Renderer::PassSetRasterizerFlags | ( | PassHandle | pass, |
| RHIPipelineState::PipelineStateDesc::Rasterizer const & | rasterizer = {}, |
||
| RHIPipelineState::PipelineStateDesc::DepthStencil const & | depth_stencil = {} |
||
| ) | const |
Sets the rasterizer and depth-stencil state for a graphics pass.
If shaders are bound to the pass, a pipeline state object will be automatically created. The parameters here will be used for the PSO creation, instead of the defaults.
|
private |
Sets backbuffer views and sync primitives.
| void Renderer::SetSwapchain | ( | RHIDeviceHandle< RHISwapchain > | swapchain | ) |
Update the swapchain to a new one. You must call this when the window is resized or the swapchain is invalidated.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |