Class VulkanRenderer#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Class Documentation#

class VulkanRenderer : public TRAP::Graphics::RendererAPI#

Public Types

using RenderPassMap = std::unordered_map<u64, TRAP::Ref<VulkanRenderPass>>#
using RenderPassMapNode = RenderPassMap::value_type#
using RenderPassMapIt = RenderPassMap::iterator#
using FrameBufferMap = std::unordered_map<u64, TRAP::Ref<VulkanFrameBuffer>>#
using FrameBufferMapNode = FrameBufferMap::value_type#
using FrameBufferMapIt = FrameBufferMap::iterator#

Public Functions

constexpr VulkanRenderer() noexcept#

Constructor.

~VulkanRenderer() override#

Destructor.

consteval VulkanRenderer(const VulkanRenderer&) = delete#

Copy constructor.

consteval VulkanRenderer &operator=(const VulkanRenderer&) = delete#

Copy assignment operator.

constexpr VulkanRenderer(VulkanRenderer&&) noexcept = delete#

Move constructor.

constexpr VulkanRenderer &operator=(VulkanRenderer&&) noexcept = delete#

Move assignment operator.

virtual void InitInternal(std::string_view gameName) override#

Initialize the internal Vulkan renderer.

Parameters:

gameName – Name of the game.

virtual void Flush(const Window &window) const override#

Flush renderer for the given window.

  1. Stops graphics and compute recording.

  2. Submits the graphics and compute commands.

  3. Presents the rendered image to the screen.

  4. Starts graphics and compute recording for the next frame.

    Remark

    Headless mode: This function is not available in headless mode.

Parameters:

windowWindow to flush.

virtual void Dispatch(std::array<u32, 3> workGroupElements, const Window &window) const override#

Dispatch to the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • workGroupElements – Number of elements to dispatch for each dimension. The elements are automatically divided by the number of threads in the work group and rounded up.

  • windowWindow to Dispatch.

virtual void SetVSync(bool vsync, const Window &window) const override#

Set the VSync state for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • vsync – Enable or disable VSync.

  • windowWindow to set VSync for.

virtual void SetRenderScale(f32 scale, const Window &window) const override#

Set the render scale for the given window.

defined(TRAP_HEADLESS_MODE) && defined(NVIDIA_REFLEX_AVAILABLE)

Remark

Headless mode: This function is not available in headless mode.

Note

This functon takes effect on the next frame.

Parameters:
  • scale – Render scale value (valid range: 0.5f-1.0f inclusive).

  • windowWindow to set render scale for.

virtual f32 GetRenderScale(const Window &window) const override#

Retrieve the used render scale value of the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:

windowWindow to retrieve render scale from.

Returns:

Render scale (between 0.5f and 2.0f inclusive).

virtual void SetClearColor(const Color &color, const Window &window) const override#

Set the clear color to be used by the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • color – New clear color.

  • windowWindow to set clear color for.

virtual void SetClearDepth(f32 depth, const Window &window) const override#

Set the clear depth value to be used by the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • depth – New clear depth value. Must be between 0.0f and 1.0f

  • windowWindow to set clear depth value for.

virtual void SetClearStencil(u32 stencil, const Window &window) const override#

Set the clear stencil value to be used by the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • stencil – New clear stencil value.

  • windowWindow to set clear stencil value for.

virtual void SetDepthTesting(bool enabled, const Window &window) const override#

Enable or disable depth testing for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • enabled – Enable or disable depth testing.

  • windowWindow to set depth testing for.

virtual void SetDepthWriting(bool enabled, const Window &window) const override#

Enable or disable depth writing for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • enabled – Enable or disable depth writing.

  • windowWindow to set depth writing for.

virtual void SetDepthFunction(CompareMode function, const Window &window) const override#

Set the depth function for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • function – Function to use for depth testing.

  • windowWindow to set depth function for.

virtual void SetDepthFail(StencilOp front, StencilOp back, const Window &window) const override#

Set the depth action to perform when depth testing fails for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • front – Depth action to perform when depth testing fails.

  • back – Depth action to perform when depth testing fails.

  • windowWindow to set the depth fail action for.

virtual void SetDepthBias(i32 depthBias, const Window &window) const override#

Set the depth bias (scalar factor to add to each fragments depth value) for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • depthBias – Depth bias.

  • windowWindow to set the depth bias for.

virtual void SetDepthBiasSlopeFactor(f32 factor, const Window &window) const override#

Set the depth bias slope factor (scalar factor applied to fragment’s slope in depth bias calculation) for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • factor – Depth bias slope factor.

  • windowWindow to set the depth bias slope factor for.

virtual void SetStencilTesting(bool enabled, const Window &window) const override#

Enable or disable stencil testing for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • enabled – Enable or disable stencil testing.

  • windowWindow to set stencil testing for.

virtual void SetStencilFail(StencilOp front, StencilOp back, const Window &window) const override#

Set the stencil action to perform when stencil testing fails for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • front – Stencil action to perform when stencil testing fails.

  • back – Stencil action to perform when stencil testing fails.

  • windowWindow to set the stencil fail action for.

virtual void SetStencilPass(StencilOp front, StencilOp back, const Window &window) const override#

Set the stencil action to perform when stencil testing and depth testing passes for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • front – Stencil action to perform when passed.

  • back – Stencil action to perform when passed.

  • windowWindow to set the stencil pass action for.

virtual void SetStencilFunction(CompareMode front, CompareMode back, const Window &window) const override#

Set the stencil functions for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • front – Function to use on the front for stencil testing.

  • back – Function to use on the back for stencil testing.

  • windowWindow to set stencil functions for.

virtual void SetStencilMask(u8 read, u8 write, const Window &window) const override#

Set the stencil mask for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • read – Select the bits of the stencil values to test.

  • write – Select the bits of the stencil values updated by the stencil test.

  • windowWindow to set stencil mask for.

virtual void SetCullMode(CullMode mode, const Window &window) const override#

Set the cull mode for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • mode – Cull mode to use.

  • windowWindow to set cull mode for.

virtual void SetFillMode(FillMode mode, const Window &window) const override#

Set the fill mode for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • mode – Fill mode to use.

  • windowWindow to set fill mode for.

virtual void SetPrimitiveTopology(PrimitiveTopology topology, const Window &window) const override#

Set the primitive topology for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • topology – Primitive topology to use.

  • windowWindow to set primitive topology for.

virtual void SetFrontFace(FrontFace face, const Window &window) const override#

Set the front face winding order for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • face – Front face winding order to use.

  • windowWindow to set front face winding order for.

virtual void SetBlendMode(BlendMode modeRGB, BlendMode modeAlpha, const Window &window) const override#

Set the blend mode for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • modeRGB – Blend mode to use for the RGB channels.

  • modeAlpha – Blend mode to use for the alpha channel.

  • windowWindow to set the blend mode for.

virtual void SetBlendConstant(BlendConstant sourceRGB, BlendConstant sourceAlpha, BlendConstant destinationRGB, BlendConstant destinationAlpha, const Window &window) const override#

Set the blend constants/factors for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • sourceRGB – Specifies how the red, green, and blue blending factors are computed.

  • sourceAlpha – Specifies how the alpha source blending factor is computed.

  • destinationRGB – Specifies how the red, green, and blue destination blending factors are computed.

  • destinationAlpha – Specified how the alpha destination blending factor is computed.

  • windowWindow to set the blend constants for.

virtual void SetShadingRate(ShadingRate shadingRate, ShadingRateCombiner postRasterizerRate, ShadingRateCombiner finalRate, const Window &window) const override#

Set the pipeline fragment shading rate and combiner operation for the command buffer.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • shadingRate – Shading rate to use.

  • postRasterizerRate – Shading rate combiner to use.

  • finalRate – Shading rate combiner to use.

  • windowWindow to set the shading rate for.

virtual void SetShadingRate(Ref<RenderTarget> texture, const Window &window) const override#

Set the pipeline fragment shading rate via texture.

Remark

Headless mode: This function is not available in headless mode.

Note

The texture must be in ResourceState::ShadingRateSource resource state.

Parameters:
  • texture – Shading rate texture to use.

  • windowWindow to set shading rate for.

virtual void Clear(ClearBufferType clearType, const Window &window) const override#

Clear the given window’s render target.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • clearType – Type of buffer to clear.

  • windowWindow to clear.

virtual void SetViewport(u32 x, u32 y, u32 width, u32 height, f32 minDepth, f32 maxDepth, const Window &window) const override#

Set viewport size for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • x – X coordinate of the top left corner of the viewport.

  • y – Y coordinate of the top left corner of the viewport.

  • width – New viewport width.

  • height – New viewport height.

  • minDepth – New min depth value. Default: 0.0f.

  • maxDepth – New max depth value. Default: 1.0f.

  • windowWindow to set viewport for.

virtual void SetScissor(u32 x, u32 y, u32 width, u32 height, const Window &window) const override#

Set scissor size for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • x – Upper left corner.

  • y – Upper left corner.

  • width – New scissor width.

  • height – New scissor height.

  • windowWindow to set scissor size for.

virtual void Draw(u32 vertexCount, u32 firstVertex, const Window &window) const override#

Draw non-indexed, non-instanced geometry for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • vertexCount – Number of vertices to draw.

  • firstVertex – Index of the first vertex to draw. Default: 0.

  • windowWindow to draw for.

virtual void DrawIndexed(u32 indexCount, u32 firstIndex, i32 firstVertex, const Window &window) const override#

Draw indexed, non-instanced geometry for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • indexCount – Number of indices to draw.

  • firstIndex – Index of the first indice to draw. Default: 0.

  • firstVertex – Index of the first vertex to draw. Default: 0.

  • windowWindow to draw for.

virtual void DrawInstanced(u32 vertexCount, u32 instanceCount, u32 firstVertex, u32 firstInstance, const Window &window) const override#

Draw non-indexed, instanced geometry for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • vertexCount – Number of vertices to draw.

  • instanceCount – Number of instances to draw.

  • firstVertex – Index of the first vertex to draw. Default: 0.

  • firstInstance – Index of the first instance to draw. Default: 0.

  • windowWindow to draw for.

virtual void DrawIndexedInstanced(u32 indexCount, u32 instanceCount, u32 firstIndex, u32 firstInstance, i32 firstVertex, const Window &window) const override#

Draw indexed, instanced geometry for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • indexCount – Number of indices to draw.

  • instanceCount – Number of instances to draw.

  • firstIndex – Index of the first indice to draw. Default: 0.

  • firstInstance – Index of the first instance to draw. Default: 0.

  • firstVertex – Index of the first vertex to draw. Default: 0.

  • windowWindow to draw for.

void BindShader(Shader &shader, const Window &window) const#

Bind shader on the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • shaderShader to bind.

  • windowWindow to bind the shader for.

virtual void BindVertexBuffer(const Buffer &vBuffer, const VertexBufferLayout &layout, const Window &window) const override#

Bind vertex buffer on the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • vBuffer – Vertex buffer to bind.

  • layout – Layout of the vertex buffer.

  • windowWindow to bind the vertex buffer for.

virtual void BindIndexBuffer(const Buffer &iBuffer, IndexType indexType, const Window &window) const override#

Bind an index buffer on the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • iBuffer – Index buffer to bind.

  • indexType – Data type used by the index buffer.

  • windowWindow to bind the vertex buffer for.

virtual void BindDescriptorSet(DescriptorSet &dSet, u32 index, QueueType queueType, const Window &window) const override#

Bind a descriptor set on the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • dSet – Descriptor set to bind.

  • index – Index for which descriptor set to bind.

  • queueTypeQueue type on which to perform the bind operation. Default: Graphics.

  • windowWindow to bind the descriptor set for.

virtual void BindPushConstants(std::string_view name, std::span<const u8> constants, QueueType queueType, const Window &window) const override#

Bind push constant buffer data on the given window.

Remark

Headless mode: This function is not available in headless mode.

Note

There is an optimized function which uses the index into the RootSignature instead of the name of the push constant block.

Parameters:
  • name – Name of the push constant block.

  • constants – Constant buffer data.

  • queueTypeQueue type on which to perform the bind operation. Default: Graphics.

  • windowWindow to bind the push constants for.

virtual void BindPushConstantsByIndex(u32 paramIndex, std::span<const u8> constants, QueueType queueType, const Window &window) const override#

Bind push constant buffer data on the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • paramIndex – Index of the push constant block in the RootSignatures descriptors array.

  • constants – Constant buffer data.

  • queueTypeQueue type on which to perform the bind operation. Default: Graphics.

  • windowWindow to bind the push constants for.

virtual void BindRenderTarget(const Graphics::RenderTarget *colorTarget, const Graphics::RenderTarget *depthStencil, RendererAPI::LoadActionsDesc *loadActions, std::vector<u32> *colorArraySlices, std::vector<u32> *colorMipSlices, u32 depthArraySlice, u32 depthMipSlice, const Window &window) const override#

Bind render target(s) on the given window.

Remark

Headless mode: This function is not available in headless mode.

Note

This functions ends the currently running render pass and starts a new one.

Parameters:
  • colorTarget – Color render target to bind.

  • depthStencilOptional depth stencil target to bind. Default: nullptr.

  • loadActionsOptional load actions for each render target. Default: nullptr.

  • colorArraySlicesOptional color array slices for each render target. Default: nullptr.

  • colorMipSlicesOptional color mip slices for each render target. Default: nullptr.

  • depthArraySliceOptional depth array slice for the depth stencil target. Default: -1.

  • depthMipSliceOptional depth mip slice for the depth stencil target. Default: -1.

  • windowWindow to bind the render target(s) for.

virtual void BindRenderTargets(const std::vector<std::reference_wrapper<const Graphics::RenderTarget>> &colorTargets, const Graphics::RenderTarget *depthStencil, RendererAPI::LoadActionsDesc *loadActions, std::vector<u32> *colorArraySlices, std::vector<u32> *colorMipSlices, u32 depthArraySlice, u32 depthMipSlice, const Window &window) const override#

Bind render target(s) on the given window.

Remark

Headless mode: This function is not available in headless mode.

Note

This functions ends the currently running render pass and starts a new one.

Parameters:
  • colorTargets – Color render target(s) to bind.

  • depthStencilOptional depth stencil target to bind. Default: nullptr.

  • loadActionsOptional load actions for each render target. Default: nullptr.

  • colorArraySlicesOptional color array slices for each render target. Default: nullptr.

  • colorMipSlicesOptional color mip slices for each render target. Default: nullptr.

  • depthArraySliceOptional depth array slice for the depth stencil target. Default: -1.

  • depthMipSliceOptional depth mip slice for the depth stencil target. Default: -1.

  • windowWindow to bind the render target(s) for.

virtual void ResourceBufferBarrier(const RendererAPI::BufferBarrier &bufferBarrier, QueueType queueType, const Window &window) const override#

Add a resource barrier (memory dependency) for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • bufferBarrierBuffer barrier.

  • queueTypeQueue type on which to perform the barrier operation. Default: Graphics.

  • windowWindow to add the barrier for.

virtual void ResourceBufferBarriers(const std::vector<RendererAPI::BufferBarrier> &bufferBarriers, QueueType queueType, const Window &window) const override#

Add resource barriers (memory dependencies) for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • bufferBarriersBuffer barriers.

  • queueTypeQueue type on which to perform the barrier operation. Default: Graphics.

  • windowWindow to add the barriers for.

virtual void ResourceTextureBarrier(const RendererAPI::TextureBarrier &textureBarrier, QueueType queueType, const Window &window) const override#

Add a resource barrier (memory dependency) for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • textureBarrierTexture barrier.

  • queueTypeQueue type on which to perform the barrier operation. Default: Graphics.

  • windowWindow to add the barrier for.

virtual void ResourceTextureBarriers(const std::vector<RendererAPI::TextureBarrier> &textureBarriers, QueueType queueType, const Window &window) const override#

Add resource barriers (memory dependencies) for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • textureBarriersTexture barriers.

  • queueTypeQueue type on which to perform the barrier operation. Default: Graphics.

  • windowWindow to add the barriers for.

virtual void ResourceRenderTargetBarrier(const RendererAPI::RenderTargetBarrier &renderTargetBarrier, const Window &window) const override#

Add a resource barrier (memory dependency) for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • renderTargetBarrier – Render target barrier.

  • windowWindow to add the barrier for.

virtual void ResourceRenderTargetBarriers(const std::vector<RendererAPI::RenderTargetBarrier> &renderTargetBarriers, const Window &window) const override#

Add resource barriers (memory dependencies) for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • renderTargetBarriers – Render target barriers.

  • windowWindow to add the barriers for.

virtual void ReflexSleep() const override#

NVIDIA-Reflex Sleep/synchronize.

Remark

Headless mode: This function is not available in headless mode.

virtual void ReflexMarker(u32 frame, u32 marker) const override#

NVIDIA-Reflex latency marker.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • frame – Frame to set marker for. Must be unique for each frame!

  • marker – Enum value of the marker to set.

virtual constexpr std::string GetTitle() const noexcept override#

Retrieve the renderer title. Example title: “[Vulkan 1.3.0]”.

Returns:

Renderer title.

virtual bool GetVSync(const Window &window) const override#

Retrieve whether VSync is enabled or not for the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:

windowWindow to retrieve VSync for.

Returns:

True if VSync is enabled, false otherwise.

virtual TRAP::Utils::UUID GetCurrentGPUUUID() const noexcept override#

Retrieve the currently used GPUs UUID.

Returns:

GPU’s UUID.

virtual std::string GetCurrentGPUName() const noexcept override#

Retrieve the name of the currently used GPU.

Returns:

GPU’s name.

virtual GPUVendor GetCurrentGPUVendor() const noexcept override#

Retrieve the vendor of the currently used GPU.

Returns:

GPU vendor.

virtual std::vector<std::pair<std::string, TRAP::Utils::UUID>> GetAllGPUs() const override#

Retrieve a list of all supported GPUs. The list contains the GPUs name and UUID.

Returns:

List of all supported GPUs.

virtual TRAP::Scope<TRAP::Image> CaptureScreenshot(const Window &window) const override#

Capture a screenshot of the last presented frame.

Remark

Headless mode: This function is not available in headless mode.

Parameters:

windowWindow to capture screenshot on.

Returns:

Captured screenshot as TRAP::Image on success, nullptr.

virtual void MSAAResolvePass(const RenderTarget &source, const RenderTarget &destination, CommandBuffer *cmd) const override#

Resolve a MSAA render target to a non MSAA render target. Needed to transfer MSAA rendered image data to a presentable non-MSAA target.

Note

source and destination must be in ResourceState::RenderTarget resource state.

Parameters:
  • source – Source MSAA render target to resolve.

  • destination – Destination non MSAA render target to resolve into.

  • cmd – CommadBuffer to resolve on.

void UpdateInternalRenderTargets(PerViewportData &viewportData) const#

Update the internal RenderTargets used for render scaling.

Parameters:

viewportData – PerViewportData to update.

virtual void RenderScalePass(const RenderTarget &source, const RenderTarget &destination, const Window &window) const override#

Scale image from internal resolution to the final output resolution.

Remark

Headless mode: This function is not available in headless mode.

Note

source and destination must be in ResourceState::RenderTarget resource state.

Parameters:
  • source – Source render target to resolve.

  • destination – Destination render target to resolve into.

  • windowWindow to do the scaling pass on.

virtual void SetLatencyMode(LatencyMode mode, const Window &window) override#

Set the latency mode.

Remark

Windows: Other LatencyModes are only available on Windows 10 or newer with NVIDIA hardware.

Remark

Headless mode: This function is not available in headless mode.

Note

Only LatencyMode::Disabled is supported everywhere.

Parameters:
  • mode – LatencyMode to set.

  • windowWindow to set latency mode for.

virtual LatencyMode GetLatencyMode(const Window &window) const override#

Retrieve the currently used latency mode.

Remark

Headless mode: This function is not available in headless mode.

Note

The returned value may differ from the requested mode set with SetLatencyMode().

Parameters:

windowWindow to retrieve latency mode for.

Returns:

Used latency mode.

virtual void InitPerViewportData(Window &window, bool VSyncEnabled) const override#

Initialize the internal rendering data of the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:
  • windowWindow to initialize the internal rendering data for.

  • VSyncEnabled – Whether to enable or disable VSync.

virtual void RemovePerViewportData(const Window &window) const override#

Remove the internal rendering data of the given window.

Remark

Headless mode: This function is not available in headless mode.

Parameters:

windowWindow to remove the internal rendering data from.

virtual void WaitIdle() const override#

Wait for the GPU to idle.

TRAP::Ref<VulkanInstance> GetInstance() const noexcept#

Retrieve the vulkan instance used by the renderer.

Returns:

Vulkan instance.

TRAP::Ref<VulkanDevice> GetDevice() const noexcept#

Retrieve the vulkan device used by the renderer.

Returns:

Vulkan device.

TRAP::Ref<VulkanMemoryAllocator> GetVMA() const noexcept#

Retrieve the vulkan memory allocator used by the renderer.

Returns:

Vulkan memory allocator.

Public Static Functions

static void UtilInitialTransition(const TRAP::Graphics::Texture &texture, RendererAPI::ResourceState startState)#

Transition the given texture from undefined resource state to the given resource state.

Parameters:
  • textureTexture to transition.

  • startState – Start state for the texture.

static RenderPassMap &GetRenderPassMap()#

Retrieve the render pass hash map.

Returns:

Render pass hash map.

static FrameBufferMap &GetFrameBufferMap()#

Retrieve the framebuffer hash map.

Returns:

Framebuffer hash map.

static TRAP::Ref<Pipeline> GetPipeline(PipelineDesc &desc)#

Utility to retrieve a pipeline. If a pipeline with the same description was already created, it will be retrieved from the cache.

Parameters:

descPipeline description.

Returns:

Pipeline.

Public Static Attributes

static constinit struct TRAP::Graphics::API::VulkanRenderer::GPUCapBits s_GPUCapBits#
static TRAP::Scope<NullDescriptors> s_NullDescriptors#
union DescriptorUpdateData#

Public Members

VkDescriptorImageInfo ImageInfo#
VkDescriptorBufferInfo BufferInfo#
VkBufferView BufferView#
struct FrameBufferDesc#

Description for framebuffer creation.

Public Members

TRAP::Ref<VulkanRenderPass> RenderPass#
std::vector<std::reference_wrapper<const RenderTarget>> RenderTargets#
const RenderTarget *DepthStencil#
const RenderTarget *ShadingRate#
std::vector<u32> ColorArraySlices#
std::vector<u32> ColorMipSlices#
u32 DepthArraySlice#
u32 DepthMipSlice#
struct GPUCapBits#

Public Members

std::array<bool, std::to_underlying(ImageFormat::IMAGE_FORMAT_COUNT)> CanShaderReadFrom = {}#
std::array<bool, std::to_underlying(ImageFormat::IMAGE_FORMAT_COUNT)> CanShaderWriteTo = {}#
std::array<bool, std::to_underlying(ImageFormat::IMAGE_FORMAT_COUNT)> CanRenderTargetWriteTo = {}#
struct NullDescriptors#

Create default resources to be used as null descriptors in case user does not specify some descriptors.

Public Members

std::array<TRAP::Ref<TRAP::Graphics::Texture>, std::to_underlying(ShaderReflection::TextureDimension::TextureDimCount)> DefaultTextureSRV#
std::array<TRAP::Ref<TRAP::Graphics::Texture>, std::to_underlying(ShaderReflection::TextureDimension::TextureDimCount)> DefaultTextureUAV#
TRAP::Ref<VulkanBuffer> DefaultBufferSRV#
TRAP::Ref<VulkanBuffer> DefaultBufferUAV#
TRAP::Ref<VulkanSampler> DefaultSampler#
Utils::Safe<NullDescriptorsObjs> SafeNullDescriptorsObjs = {}#
struct NullDescriptorsObjs#

Public Members

TRAP::Ref<VulkanQueue> InitialTransitionQueue = {}#
TRAP::Ref<VulkanCommandPool> InitialTransitionCmdPool = {}#
VulkanCommandBuffer *InitialTransitionCmd = {}#
TRAP::Ref<VulkanFence> InitialTransitionFence = {}#
struct RenderPassDesc#

Description for render pass creation.

Public Members

std::vector<ImageFormat> ColorFormats#
std::vector<LoadActionType> LoadActionsColor#
std::vector<StoreActionType> StoreActionsColor#
u32 RenderTargetCount#
TRAP::Graphics::RendererAPI::SampleCount SampleCount = RendererAPI::SampleCount::One#
ImageFormat DepthStencilFormat#
ImageFormat ShadingRateFormat#
LoadActionType LoadActionDepth#
LoadActionType LoadActionStencil#
StoreActionType StoreActionDepth#
StoreActionType StoreActionStencil#
struct SizeOffset#

Public Members

u32 Size#
u32 Offset#
struct UpdateFrequencyLayoutInfo#

Struct holding data about a descriptor set layout.

Public Members

std::vector<VkDescriptorSetLayoutBinding> Bindings = {}#
std::vector<DescriptorInfo*> Descriptors = {}#
std::vector<DescriptorInfo*> DynamicDescriptors = {}#
std::unordered_map<DescriptorInfo*, u64> DescriptorIndexMap = {}#