|
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 (RendererDesc const &desc, RHIApplicationObjectHandle< RHIDevice > device, RHIDeviceObjectHandle< 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> | |
| T * | 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 , typename FSkip = FSkipDefault> | |
| LambdaPass< FSetup, FRecord, FSkip > * | CreatePass (StringView name, RHIDeviceQueueType queue, size_t priority, FSetup &&setup, FRecord &&record, FSkip &&skip={}) |
| 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 | BindShader (PassHandle pass, RHIShaderStage stage, StringView entry_point, Native::Path const &shader_path) const |
| Binds shader file path to a certain pass at a certain stage. | |
| void | BindDescriptorBindPoint (PassHandle pass, StringView bind_point, uint32_t binding, uint32_t set) |
| Declares that a bind point in a certain pass is a descriptor set at the specified set and binding index. This is only useful if you don't have control over the shader code, and cannot rely on automatic reflection. You can use the same bind point name with subsequent BindTextureSRV, etc. calls. | |
| 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, RHIDeviceDescriptorSet *descriptor_set, RHIDeviceDescriptorSetLayout *layout) |
| Manually bind an existing descriptor set 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 |
| Declares that this pass will write to the current (at Record time) swapchain backbuffer. | |
| 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. | |
| RHITextureView * | DerefCurrentBackbufferView (const PassHandle pass) const |
| Returns a pointer to the current backbuffer texture view. | |
| 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 TOTAL 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 index, RHIDeviceDescriptorSet *descriptor_set) const |
| Helper that binds a single descriptor set to the current command list. | |
| void | CmdBeginGraphics (PassHandle pass, RHICommandList *cmd, RHIExtent2D const &extent, Optional< RHIClearColor > const &clear_rtv=RHIClearColor{}, Optional< RHIClearDepthStencil > const &clear_dsv=RHIClearDepthStencil{1.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. | |
| bool | IsAsyncComputeEnabled () const |
| Returns whether async compute is enabled. | |
| bool | IsPresentEnabled () const |
| Returns whether the swapchain is enabled. | |
| void | SetSwapchain (RHIDeviceObjectHandle< 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 prepares for the next frame. | |
| String | DbgDumpGraphviz () const |
| String | DbgDumpActivePasses () const |
| String | DbgDumpExecutionGroups () const |
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 |
| Renderer::Renderer | ( | RendererDesc const & | desc, |
| RHIApplicationObjectHandle< RHIDevice > | device, | ||
| RHIDeviceObjectHandle< 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 |
Declares that this pass will write to the current (at Record time) swapchain backbuffer.
You can retrieve the current backbuffer RTV via DerefCurrentBackbufferView() at Record time.
This can be automatically bound to the pipeline with CmdBeginGraphics().
| 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::BindDescriptorBindPoint | ( | PassHandle | pass, |
| StringView | bind_point, | ||
| uint32_t | binding, | ||
| uint32_t | set | ||
| ) |
Declares that a bind point in a certain pass is a descriptor set at the specified set and binding index. This is only useful if you don't have control over the shader code, and cannot rely on automatic reflection. You can use the same bind point name with subsequent BindTextureSRV, etc. calls.
| void Renderer::BindDescriptorSet | ( | PassHandle | pass, |
| StringView | bind_point, | ||
| RHIDeviceDescriptorSet * | descriptor_set, | ||
| RHIDeviceDescriptorSetLayout * | layout | ||
| ) |
Manually bind an existing descriptor set to the pipeline.
This can be automatically bound to the pipeline with CmdSetPipeline()
| 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, | ||
| Native::Path const & | shader_path | ||
| ) | 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.
| 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 |
| void Renderer::CmdBeginGraphics | ( | PassHandle | pass, |
| RHICommandList * | cmd, | ||
| RHIExtent2D const & | extent, | ||
| Optional< RHIClearColor > const & | clear_rtv = RHIClearColor{}, |
||
| Optional< RHIClearDepthStencil > const & | clear_dsv = RHIClearDepthStencil{1.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, | ||
| uint32_t | index, | ||
| RHIDeviceDescriptorSet * | descriptor_set | ||
| ) | const |
Helper that binds a single descriptor set to the current command list.
You generally want to use CmdSetPipeline() instead.
| void Renderer::CmdDispatch | ( | PassHandle | pass, |
| RHICommandList * | cmd, | ||
| RHIExtent3D | thread_size | ||
| ) | const |
Helper that dispatches a compute shader with the specified TOTAL 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().
createPass() should be generally preferred over this.
| 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(PassHandel self, Renderer*, RHICommandList*) called at Record time. |
| skip | (Optional) Lambda of type bool(PassHandle self, Renderer*) called at Record time to determine whether this pass should be skipped if true. This is by default always false. |
|
inline |
Create a render pass from a RenderPass* implementation and add it to the render graph.
This is only available at Setup time.
createPassImpl() should be generally preferred over this.
| 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 RHIDeviceObjectHandle<RHIBuffer> or RHIDeviceObjectHandle<RHITexture>.
createResource() should be generally preferred over this.
| desc | Resources can be created by passing in RHIBufferDesc, RHITextureDesc, and can be imported by passing in RHIDeviceObjectHandle<RHIBuffer>, RHIDeviceObjectHandle<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 |
|
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 |
Returns a pointer to the current backbuffer texture view.
The pass must have declared BindBackbufferRTV() during setup.
|
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 prepares for the next frame.
| 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 |
Acquires resources for the current group.
|
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 |
Performs transitions that's otherwise impossible (e.g. Fragment -> Compute) for the next group, and releases resources for the current group.
|
private |
|
private |
|
inline |
|
inline |
Retrieves the current frame number.
This value is monotonically increasing every time EndExecute() is called, and starts from 0.
|
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.
This value is updated at BeginExecute(), and remains the same until the next BeginExecute() call.
|
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.
This value is updated at BeginExecute(), and remains the same until the next BeginExecute() call.
|
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 |
| void Renderer::SetSwapchain | ( | RHIDeviceObjectHandle< 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 |