Class RendererAPI#
Defined in File RendererAPI.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Derived Type#
public TRAP::Graphics::API::VulkanRenderer
(Class VulkanRenderer)
Class Documentation#
-
class RendererAPI#
Subclassed by TRAP::Graphics::API::VulkanRenderer
Public Types
-
enum class WaveOpsSupportFlags : u32#
Enum bit flag for the different wave operations.
Values:
-
enumerator None#
-
enumerator Basic#
-
enumerator Vote#
-
enumerator Arithmetic#
-
enumerator Ballot#
-
enumerator Shuffle#
-
enumerator ShuffleRelative#
-
enumerator Clustered#
-
enumerator Quad#
-
enumerator PartitionedNV#
-
enumerator None#
-
enum class QueueType : u32#
Enum describing the different types of queues.
Values:
-
enumerator Graphics#
-
enumerator Transfer#
-
enumerator Compute#
-
enumerator Graphics#
-
enum class QueueFlag : u32#
Enum describing queue flags.
Values:
-
enumerator None#
-
enumerator DisableGPUTimeout#
-
enumerator None#
-
enum class QueuePriority#
Enum describing the different priorities for a queue (DirectX 12).
Values:
-
enumerator Normal#
-
enumerator High#
-
enumerator GlobalRealtime#
-
enumerator Normal#
-
enum class FenceStatus#
Enum describing the status of a fence.
Values:
-
enumerator Complete#
-
enumerator Incomplete#
-
enumerator NotSubmitted#
-
enumerator Complete#
-
enum class LoadActionType : u32#
Enum describing the different types of load actions.
Values:
-
enumerator DontCare#
-
enumerator Load#
-
enumerator Clear#
-
enumerator DontCare#
-
enum class StoreActionType : u32#
Enum describing the different types of store actions.
Values:
-
enumerator Store#
-
enumerator DontCare#
-
enumerator None#
-
enumerator Store#
-
enum class TextureCubeType#
Enum describing the different types of cube textures.
Values:
-
enumerator Cross#
-
enumerator Cross#
-
enum class SampleCount#
Enum describing the different sample counts.
Values:
-
enumerator One#
-
enumerator Two#
-
enumerator Four#
-
enumerator Eight#
-
enumerator Sixteen#
-
enumerator One#
-
enum class AntiAliasing#
Enum describing the different anti aliasing methods.
Values:
-
enumerator Off#
-
enumerator MSAA#
-
enumerator Off#
-
enum class GPUVendor : i32#
Enum describing the different GPU vendors.
Values:
-
enumerator Unknown#
-
enumerator AMD#
-
enumerator ImgTec#
-
enumerator NVIDIA#
-
enumerator ARM#
-
enumerator Broadcom#
-
enumerator Qualcomm#
-
enumerator Intel#
-
enumerator Apple#
-
enumerator Vivante#
-
enumerator VeriSilicon#
-
enumerator Kazan#
-
enumerator Codeplay#
-
enumerator Mesa#
-
enumerator Unknown#
-
enum class TextureCreationFlags : u32#
Enum bit flags used by texture creation.
Values:
-
enumerator None#
-
enumerator OwnMemory#
-
enumerator OnTile#
-
enumerator Force2D#
-
enumerator Force3D#
-
enumerator AllowDisplayTarget#
-
enumerator SRGB#
-
enumerator NormalMap#
-
enumerator FastClear#
-
enumerator FragMask#
-
enumerator Storage#
-
enumerator None#
-
enum class ResourceState : u32#
Enum describing the state of a resource.
Values:
-
enumerator Undefined#
-
enumerator VertexAndConstantBuffer#
-
enumerator IndexBuffer#
-
enumerator RenderTarget#
-
enumerator UnorderedAccess#
-
enumerator DepthWrite#
-
enumerator DepthRead#
-
enumerator NonPixelShaderResource#
-
enumerator PixelShaderResource#
-
enumerator ShaderResource#
-
enumerator StreamOut#
-
enumerator IndirectArgument#
-
enumerator CopyDestination#
-
enumerator CopySource#
-
enumerator GenericRead#
-
enumerator Present#
-
enumerator Common#
-
enumerator RayTracingAccelerationStructure#
-
enumerator ShadingRateSource#
-
enumerator Undefined#
-
enum class DescriptorType : u32#
Enum describing the type of a descriptor.
Values:
-
enumerator Undefined#
-
enumerator Sampler#
-
enumerator Texture#
-
enumerator RWTexture#
-
enumerator Buffer#
-
enumerator BufferRaw#
-
enumerator RWBuffer#
-
enumerator RWBufferRaw#
-
enumerator UniformBuffer#
-
enumerator RootConstant#
-
enumerator VertexBuffer#
-
enumerator IndexBuffer#
-
enumerator IndirectBuffer#
-
enumerator TextureCube#
-
enumerator RenderTargetMipSlices#
-
enumerator RenderTargetArraySlices#
-
enumerator RenderTargetDepthSlices#
-
enumerator RayTracing#
-
enumerator InputAttachment#
-
enumerator TexelBuffer#
-
enumerator RWTexelBuffer#
-
enumerator CombinedImageSampler#
-
enumerator AccelerationStructure#
-
enumerator AccelerationStructureBuildInput#
-
enumerator ShaderDeviceAddress#
-
enumerator ShaderBindingTable#
-
enumerator Undefined#
-
enum class ResourceMemoryUsage#
Enum describing the different memory usage types for a resource.
Values:
-
enumerator Unknown#
-
enumerator GPUOnly#
-
enumerator CPUOnly#
-
enumerator CPUToGPU#
-
enumerator GPUToCPU#
-
enumerator Unknown#
-
enum class BufferCreationFlags : u32#
Enum describing flags for the buffer creation.
Values:
-
enumerator None#
-
enumerator OwnMemory#
-
enumerator PersistentMap#
-
enumerator ESRAM#
-
enumerator NoDescriptorViewCreation#
-
enumerator HostVisible#
-
enumerator HostCoherent#
-
enumerator None#
-
enum class ClearBufferType : u32#
Enum describing the different types of buffers for clearing.
Values:
-
enumerator Color#
-
enumerator Depth#
-
enumerator Stencil#
-
enumerator Color_Depth#
-
enumerator Color_Stencil#
-
enumerator Color_Depth_Stencil#
-
enumerator Depth_Stencil#
-
enumerator Color#
-
enum class LatencyMode : u32#
Enum describing the different latency modes.
Remark
Headless mode: This function is not available in headless mode.
Values:
-
enumerator Disabled#
-
enumerator Enabled#
-
enumerator EnabledBoost#
-
enumerator Disabled#
-
enum class IndirectArgumentType#
Enum describing the type of an indirect argument.
Values:
-
enumerator IndirectDraw#
-
enumerator IndirectDrawIndex#
-
enumerator IndirectDispatch#
-
enumerator IndirectVertexBuffer#
-
enumerator IndirectIndexBuffer#
-
enumerator IndirectConstant#
-
enumerator IndirectDescriptorTable#
-
enumerator IndirectPipeline#
-
enumerator IndirectDraw#
-
enum class DescriptorUpdateFrequency : u32#
Enum describing the update frequency of a descriptor.
Note
: The same update frequency order should be used by shaders.
Values:
-
enumerator Static#
-
enumerator Dynamic#
-
enumerator Static#
-
enum class FilterType#
Enum describing the different types of filtering used by samplers.
Values:
-
enumerator Nearest#
-
enumerator Linear#
-
enumerator Nearest#
-
enum class MipMapMode#
Enum describing the different modes of mip mapping used by samplers.
Values:
-
enumerator Nearest#
-
enumerator Linear#
-
enumerator Nearest#
-
enum class AddressMode#
Enum describing the different address modes used by samplers.
Values:
-
enumerator Mirror#
-
enumerator Repeat#
-
enumerator ClampToEdge#
-
enumerator ClampToBorder#
-
enumerator Mirror#
-
enum class CompareMode : u32#
Enum describing the different compare modes used by depth/stencil testing and samplers.
Values:
-
enumerator Never#
-
enumerator Less#
-
enumerator Equal#
-
enumerator LessOrEqual#
-
enumerator Greater#
-
enumerator NotEqual#
-
enumerator GreaterOrEqual#
-
enumerator Always#
-
enumerator Never#
-
enum class ShaderStage : u32#
Enum describing the different shader stages making up a shader.
Values:
-
enumerator None#
-
enumerator Vertex#
-
enumerator TessellationControl#
-
enumerator TessellationEvaluation#
-
enumerator Geometry#
-
enumerator Fragment#
-
enumerator Compute#
-
enumerator RayTracing#
-
enumerator AllGraphics#
-
enumerator Hull#
-
enumerator Domain#
-
enumerator Pixel#
-
enumerator None#
-
enum class ShaderType#
Enum describing the overall type of a shader.
Values:
-
enumerator Graphics#
-
enumerator Compute#
-
enumerator Graphics#
-
enum class RootSignatureFlags : u32#
Enum describing the different flags for root signature creation.
Values:
-
enumerator None#
-
enumerator Local#
-
enumerator None#
-
enum class PipelineType : u32#
Enum describing the different pipeline types.
Values:
-
enumerator Compute#
-
enumerator Graphics#
-
enumerator RayTracing#
-
enumerator Compute#
-
enum class IndexType#
Enum describing the different data types used by index buffers.
Values:
-
enumerator UInt32#
-
enumerator UInt16#
-
enumerator UInt32#
-
enum class BlendConstant : u32#
Enum describing the different blend constants used for blending.
Values:
-
enumerator Zero#
-
enumerator One#
-
enumerator SrcColor#
-
enumerator OneMinusSrcColor#
-
enumerator DstColor#
-
enumerator OneMinusDstColor#
-
enumerator SrcAlpha#
-
enumerator OneMinusSrcAlpha#
-
enumerator DstAlpha#
-
enumerator OneMinusDstAlpha#
-
enumerator SrcAlphaSaturate#
-
enumerator BlendFactor#
-
enumerator OneMinusBlendFactor#
-
enumerator Zero#
-
enum class BlendMode : u32#
Enum describing the different blend modes/functions used for blending.
Values:
-
enumerator Add#
-
enumerator Subtract#
-
enumerator ReverseSubtract#
-
enumerator Min#
-
enumerator Max#
-
enumerator Add#
-
enum class BlendStateTargets : u32#
Enum describing which render target to affect with the blend state.
Values:
-
enumerator BlendStateTarget0#
-
enumerator BlendStateTarget1#
-
enumerator BlendStateTarget2#
-
enumerator BlendStateTarget3#
-
enumerator BlendStateTarget4#
-
enumerator BlendStateTarget5#
-
enumerator BlendStateTarget6#
-
enumerator BlendStateTarget7#
-
enumerator BlendStateTargetAll#
-
enumerator BlendStateTarget0#
-
enum class StencilOp : u32#
Enum describing the different stencil/depth operations.
Values:
-
enumerator Keep#
-
enumerator SetZero#
-
enumerator Replace#
-
enumerator Invert#
-
enumerator Increment#
-
enumerator Decrement#
-
enumerator IncrementSaturation#
-
enumerator DecrementSaturation#
-
enumerator Keep#
-
enum class CullMode : u32#
Enum describing the different cull modes.
Values:
-
enumerator None#
-
enumerator Back#
-
enumerator Front#
-
enumerator Both#
-
enumerator None#
-
enum class FrontFace : u32#
Enum describing the different front face winding orders.
Values:
-
enumerator CounterClockwise#
-
enumerator Clockwise#
-
enumerator CounterClockwise#
-
enum class FillMode : u32#
Enum describing the different fill modes.
Values:
-
enumerator Solid#
-
enumerator Line#
-
enumerator Point#
-
enumerator Solid#
-
enum class PipelineCacheFlags : u32#
Enum describing flags for pipeline cache creation.
Values:
-
enumerator None#
-
enumerator ExternallySynchronized#
-
enumerator None#
-
enum class PrimitiveTopology#
Enum describing the different primitive topologies.
Values:
-
enumerator PointList#
-
enumerator LineList#
-
enumerator LineStrip#
-
enumerator TriangleList#
-
enumerator TriangleStrip#
-
enumerator PatchList#
-
enumerator PointList#
-
enum class VertexAttributeRate#
Enum describing the different vertex attribute rates.
Values:
-
enumerator Vertex#
-
enumerator Instance#
-
enumerator Vertex#
-
enum class QueryType#
Enum describing the different types of queries.
Values:
-
enumerator Timestamp#
-
enumerator PipelineStatistics#
-
enumerator Occlusion#
-
enumerator Timestamp#
-
enum class PresentStatus#
Enum describing the different presentation statuses.
Values:
-
enumerator Success#
-
enumerator DeviceReset#
-
enumerator Failed#
-
enumerator OutOfDate#
-
enumerator Success#
-
enum class SamplerRange#
Enum describing the different sampler ranges used by YUV conversion samplers.
Values:
-
enumerator Full#
-
enumerator Narrow#
-
enumerator Full#
-
enum class SamplerModelConversion#
Enum describing the different sampler models used by YUV conversion samplers.
Values:
-
enumerator RGBIdentity#
-
enumerator YCBCRIdentity#
-
enumerator YCBCR709#
-
enumerator YCBCR601#
-
enumerator YCBCR2020#
-
enumerator RGBIdentity#
-
enum class SampleLocation#
Enum describing the different sample locations used by YUV conversion samplers.
Values:
-
enumerator Cosited#
-
enumerator Midpoint#
-
enumerator Cosited#
-
enum class ShadingRate : u32#
Enum describing the shading rates used by fragment/pixel shaders.
Values:
-
enumerator NotSupported#
-
enumerator Full#
-
enumerator Half#
-
enumerator Quarter#
-
enumerator Eighth#
-
enumerator OneXTwo#
-
enumerator TwoXOne#
-
enumerator TwoXFour#
-
enumerator FourXTwo#
-
enumerator NotSupported#
-
enum class ShadingRateCombiner : u32#
Enum describing how to combine different shading rates.
Values:
-
enumerator Passthrough#
-
enumerator Override#
-
enumerator Min#
-
enumerator Max#
-
enumerator Sum#
-
enumerator Passthrough#
-
enum class ShadingRateCaps : u32#
Enum describing the shading rate capabilities supported by the GPU.
Values:
-
enumerator NotSupported#
-
enumerator PerDraw#
-
enumerator PerTile#
-
enumerator PerPrimitive#
-
enumerator NotSupported#
-
enum class CommandPoolCreateFlags : u32#
Enum describing flags that change the behaviour of a command pool.
Values:
-
enumerator None#
-
enumerator Transient#
-
enumerator ResetCommandBuffer#
-
enumerator None#
-
enum class MappedRangeFlags : u32#
Values:
-
enumerator None#
-
enumerator UnMapBuffer#
-
enumerator TempBuffer#
-
enumerator None#
-
using ClearValue = std::variant<Color, DepthStencil>#
-
using DescriptorResource = std::variant<std::vector<const TRAP::Graphics::Texture*>, std::vector<const Sampler*>, std::vector<const Buffer*>, std::vector<Pipeline*>, std::vector<DescriptorSet*>>#
-
using DescriptorIndexMap = TRAP::Utils::UnorderedStringMap<u32>#
Map resolving a name to its descriptor index in a root signature.
Public Functions
-
virtual constexpr ~RendererAPI() = default#
Destructor.
-
consteval RendererAPI(const RendererAPI&) noexcept = delete#
Copy constructor.
-
consteval RendererAPI &operator=(const RendererAPI&) noexcept = delete#
Copy assignment operator.
-
consteval RendererAPI(RendererAPI&&) noexcept = delete#
Move constructor.
-
consteval RendererAPI &operator=(RendererAPI&&) noexcept = delete#
Move assignment operator.
-
virtual void InitInternal(std::string_view gameName) = 0#
Initialize the internal renderer.
- Parameters:
gameName – Name of the game.
-
virtual void Flush(const Window &window) const = 0#
Flush renderer for the given window.
Stops graphics and compute recording.
Submits the graphics and compute commands.
Presents the rendered image to the screen.
Starts graphics and compute recording for the next frame.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to flush.
-
virtual void Dispatch(std::array<u32, 3> workGroupElements, const Window &window) const = 0#
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.
window – Window to Dispatch.
-
virtual void SetVSync(bool vsync, const Window &window) const = 0#
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.
window – Window to set VSync for.
-
virtual bool GetVSync(const Window &window) const = 0#
Retrieve whether VSync is enabled or not for the given window.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to retrieve VSync for.
- Returns:
True if VSync is enabled, false otherwise.
-
virtual void SetRenderScale(f32 scale, const Window &window) const = 0#
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).
window – Window to set render scale for.
-
virtual f32 GetRenderScale(const Window &window) const = 0#
Retrieve the used render scale value of the given window.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window 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 = 0#
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.
window – Window to set clear color for.
-
virtual void SetClearDepth(f32 depth, const Window &window) const = 0#
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
window – Window to set clear depth value for.
-
virtual void SetClearStencil(u32 stencil, const Window &window) const = 0#
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.
window – Window to set clear stencil value for.
-
virtual void SetDepthTesting(bool enabled, const Window &window) const = 0#
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.
window – Window to set depth testing for.
-
virtual void SetDepthWriting(bool enabled, const Window &window) const = 0#
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.
window – Window to set depth writing for.
-
virtual void SetDepthFunction(CompareMode function, const Window &window) const = 0#
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.
window – Window to set depth function for.
-
virtual void SetDepthFail(StencilOp front, StencilOp back, const Window &window) const = 0#
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.
window – Window to set the depth fail action for.
-
virtual void SetDepthBias(i32 depthBias, const Window &window) const = 0#
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.
window – Window to set the depth bias for.
-
virtual void SetDepthBiasSlopeFactor(f32 factor, const Window &window) const = 0#
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.
window – Window to set the depth bias slope factor for.
-
virtual void SetStencilTesting(bool enabled, const Window &window) const = 0#
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.
window – Window to set stencil testing for.
-
virtual void SetStencilFail(StencilOp front, StencilOp back, const Window &window) const = 0#
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.
window – Window to set the stencil fail action for.
-
virtual void SetStencilPass(StencilOp front, StencilOp back, const Window &window) const = 0#
Set the stencil action to perform when stencil 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.
window – Window to set the stencil pass action for.
-
virtual void SetStencilFunction(CompareMode front, CompareMode back, const Window &window) const = 0#
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.
window – Window to set stencil functions for.
-
virtual void SetStencilMask(u8 read, u8 write, const Window &window) const = 0#
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.
window – Window to set stencil mask for.
-
virtual void SetCullMode(CullMode mode, const Window &window) const = 0#
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.
window – Window to set cull mode for.
-
virtual void SetFillMode(FillMode mode, const Window &window) const = 0#
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.
window – Window to set fill mode for.
-
virtual void SetPrimitiveTopology(PrimitiveTopology topology, const Window &window) const = 0#
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.
window – Window to set primitive topology for.
-
virtual void SetFrontFace(FrontFace face, const Window &window) const = 0#
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.
window – Window to set front face winding order for.
-
virtual void SetBlendMode(BlendMode modeRGB, BlendMode modeAlpha, const Window &window) const = 0#
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.
window – Window to set the blend mode for.
-
virtual void SetBlendConstant(BlendConstant sourceRGB, BlendConstant sourceAlpha, BlendConstant destinationRGB, BlendConstant destinationAlpha, const Window &window) const = 0#
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.
window – Window to set the blend constants for.
-
virtual void SetShadingRate(ShadingRate shadingRate, ShadingRateCombiner postRasterizerRate, ShadingRateCombiner finalRate, const Window &window) const = 0#
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.
window – Window to set the shading rate for.
-
virtual void SetShadingRate(Ref<RenderTarget> texture, const Window &window) const = 0#
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.
window – Window to set shading rate for.
-
virtual void Clear(ClearBufferType clearType, const Window &window) const = 0#
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.
window – Window to clear.
-
virtual void SetViewport(u32 x, u32 y, u32 width, u32 height, f32 minDepth, f32 maxDepth, const Window &window) const = 0#
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.
window – Window to set viewport for.
-
virtual void SetScissor(u32 x, u32 y, u32 width, u32 height, const Window &window) const = 0#
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.
window – Window to set scissor size for.
-
virtual void Draw(u32 vertexCount, u32 firstVertex, const Window &window) const = 0#
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.
window – Window to draw for.
-
virtual void DrawIndexed(u32 indexCount, u32 firstIndex, i32 vertexOffset, const Window &window) const = 0#
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.
vertexOffset – Index of the first vertex to draw. Default: 0.
window – Window to draw for.
-
virtual void DrawInstanced(u32 vertexCount, u32 instanceCount, u32 firstVertex, u32 firstInstance, const Window &window) const = 0#
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.
window – Window to draw for.
-
virtual void DrawIndexedInstanced(u32 indexCount, u32 instanceCount, u32 firstIndex, u32 firstInstance, i32 vertexOffset, const Window &window) const = 0#
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.
vertexOffset – Index of the first vertex to draw. Default: 0.
window – Window to draw for.
-
virtual void BindVertexBuffer(const Buffer &vBuffer, const VertexBufferLayout &layout, const Window &window) const = 0#
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.
window – Window to bind the vertex buffer for.
-
virtual void BindIndexBuffer(const Buffer &iBuffer, IndexType indexType, const Window &window) const = 0#
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.
window – Window to bind the vertex buffer for.
-
virtual void BindDescriptorSet(DescriptorSet &dSet, u32 index, QueueType queueType, const Window &window) const = 0#
Bind a descriptor set on the given window.
Remark
Headless mode: This function is not available in headless mode.
-
virtual void BindPushConstants(std::string_view name, std::span<const u8> constants, QueueType queueType, const Window &window) const = 0#
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.
-
virtual void BindPushConstantsByIndex(u32 paramIndex, std::span<const u8> constants, QueueType queueType, const Window &window) const = 0#
Bind push constant buffer data on the given window.
Remark
Headless mode: This function is not available in headless mode.
-
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 = 0#
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.
depthStencil – Optional depth stencil target to bind. Default: nullptr.
loadActions – Optional load actions for each render target. Default: nullptr.
colorArraySlices – Optional color array slices for each render target. Default: nullptr.
colorMipSlices – Optional color mip slices for each render target. Default: nullptr.
depthArraySlice – Optional depth array slice for the depth stencil target. Default: -1.
depthMipSlice – Optional depth mip slice for the depth stencil target. Default: -1.
window – Window 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 = 0#
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.
depthStencil – Optional depth stencil target to bind. Default: nullptr.
loadActions – Optional load actions for each render target. Default: nullptr.
colorArraySlices – Optional color array slices for each render target. Default: nullptr.
colorMipSlices – Optional color mip slices for each render target. Default: nullptr.
depthArraySlice – Optional depth array slice for the depth stencil target. Default: -1.
depthMipSlice – Optional depth mip slice for the depth stencil target. Default: -1.
window – Window to bind the render target(s) for.
-
virtual void ResourceBufferBarrier(const RendererAPI::BufferBarrier &bufferBarrier, QueueType queueType, const Window &window) const = 0#
Add a resource barrier (memory dependency) for the given window.
Remark
Headless mode: This function is not available in headless mode.
-
virtual void ResourceBufferBarriers(const std::vector<RendererAPI::BufferBarrier> &bufferBarriers, QueueType queueType, const Window &window) const = 0#
Add resource barriers (memory dependencies) for the given window.
Remark
Headless mode: This function is not available in headless mode.
-
virtual void ResourceTextureBarrier(const RendererAPI::TextureBarrier &textureBarrier, QueueType queueType, const Window &window) const = 0#
Add a resource barrier (memory dependency) for the given window.
Remark
Headless mode: This function is not available in headless mode.
-
virtual void ResourceTextureBarriers(const std::vector<RendererAPI::TextureBarrier> &textureBarriers, QueueType queueType, const Window &window) const = 0#
Add resource barriers (memory dependencies) for the given window.
Remark
Headless mode: This function is not available in headless mode.
-
virtual void ResourceRenderTargetBarrier(const RendererAPI::RenderTargetBarrier &renderTargetBarrier, const Window &window) const = 0#
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.
window – Window to add the barrier for.
-
virtual void ResourceRenderTargetBarriers(const std::vector<RendererAPI::RenderTargetBarrier> &renderTargetBarriers, const Window &window) const = 0#
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.
window – Window to add the barriers for.
-
virtual void ReflexSleep() const = 0#
NVIDIA-Reflex Sleep/synchronize on the given window.
Remark
Headless mode: This function is not available in headless mode.
-
virtual void ReflexMarker(u32 frame, u32 marker) const = 0#
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 = 0#
Retrieve the renderer title. Example title: “[Vulkan 1.3.0]”.
- Returns:
Renderer title.
-
virtual TRAP::Utils::UUID GetCurrentGPUUUID() const noexcept = 0#
Retrieve the currently used GPUs UUID.
- Returns:
GPU’s UUID.
-
virtual std::string GetCurrentGPUName() const noexcept = 0#
Retrieve the name of the currently used GPU.
- Returns:
GPU’s name.
-
virtual GPUVendor GetCurrentGPUVendor() const noexcept = 0#
Retrieve the vendor of the currently used GPU.
- Returns:
GPU vendor.
-
virtual std::vector<std::pair<std::string, TRAP::Utils::UUID>> GetAllGPUs() const = 0#
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 = 0#
Capture a screenshot of the last presented frame.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to capture screenshot on.
- Returns:
Captured screenshot as TRAP::Image on success, nullptr otherwise.
-
virtual void MSAAResolvePass(const RenderTarget &source, const RenderTarget &destination, CommandBuffer *cmd) const = 0#
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.
-
virtual void RenderScalePass(const RenderTarget &source, const RenderTarget &destination, const Window &window) const = 0#
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.
window – Window to do the scaling pass on.
-
virtual void SetLatencyMode(LatencyMode mode, const Window &window) = 0#
Set the latency mode. The actual latency mode may differ from the requested one so check the actual used mode with GetLatencyMode().
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.
window – Window to set latency mode for.
-
virtual LatencyMode GetLatencyMode(const Window &window) const = 0#
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:
window – Window to retrieve latency mode for.
- Returns:
Used latency mode.
-
virtual void InitPerViewportData(Window &window, bool VSyncEnabled) const = 0#
Initialize the internal rendering data of the given window.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to initialize the internal rendering data for.
VSyncEnabled – Whether to enable or disable VSync.
-
virtual void RemovePerViewportData(const Window &window) const = 0#
Remove the internal rendering data of the given window.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to remove the internal rendering data from.
-
virtual void WaitIdle() const = 0#
Wait for the GPU to idle.
Public Static Functions
-
static void Init(std::string_view gameName, RenderAPI renderAPI)#
Initialize the Renderer.
- Parameters:
gameName – Name of the game.
renderAPI – Render API to use.
-
static RendererAPI *GetRenderer()#
Retrieve the Renderer singleton.
- Returns:
-
static API::ResourceLoader *GetResourceLoader() noexcept#
Retrieve the resource loader singleton.
- Returns:
Resource loader.
-
static RenderAPI AutoSelectRenderAPI()#
Auto select a supported render API.
- Returns:
Auto selected render API.
-
static bool IsSupported(RenderAPI api)#
Check whether a render API is supported by the system.
- Returns:
True if supported, false otherwise.
-
static RenderAPI GetRenderAPI() noexcept#
Retrieve the currently used render API.
- Returns:
Currently used render API.
-
static constexpr void SetNewGPU(const TRAP::Utils::UUID &GPUUUID) noexcept#
Set a new GPU to use.
Note
This only takes effect after a restart of the engine.
- Parameters:
GPUUUID – UUID of the GPU to use.
-
static TRAP::Utils::UUID GetNewGPU() noexcept#
Get the UUID of the new GPU to use.
Note
This will return an empty UUID if no new GPU was set.
- Returns:
UUID of the new GPU to use.
-
static void OnPostUpdate()#
On post update function. This function performs several tasks that need to be done after LayerStack::OnUpdate() calls. Currently this only performs scaling of the render targets, dependening on the current render scale.
-
static TRAP::Ref<TRAP::Graphics::DescriptorPool> GetDescriptorPool() noexcept#
Retrieve the used descriptor pool.
- Returns:
Descriptor pool.
-
static TRAP::Ref<TRAP::Graphics::Queue> GetGraphicsQueue() noexcept#
Retrieve the used graphics queue.
- Returns:
Graphics queue.
-
static TRAP::Ref<TRAP::Graphics::Queue> GetComputeQueue() noexcept#
Retrieve the used compute queue.
- Returns:
Compute queue.
-
static TRAP::Ref<TRAP::Graphics::Queue> GetTransferQueue() noexcept#
Retrieve the used transfer queue.
- Returns:
Transfer queue.
-
static TRAP::Ref<TRAP::Graphics::RootSignature> GetGraphicsRootSignature(const Window &window)#
Retrieve the currently used graphics root signature of the given window.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to retrieve the graphics root signature from.
- Returns:
Graphics root signature.
-
static TRAP::Math::Vec2ui GetInternalRenderResolution(const Window &window)#
Retrieve the currently used internal render resolution of the given window.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to get internal render resolution from.
- Returns:
Internal render resolution.
-
static void StartRenderPass(const Window &window)#
Start a render pass for the given window.
Remark
Headless mode: This function is not available in headless mode.
Note
This will rebind the render target for the current frame.
- Parameters:
window – Window to start render pass for.
-
static void StopRenderPass(const Window &window)#
Stop running render pass of the given window.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to stop render pass on.
-
static void Transition(const Ref<TRAP::Graphics::Texture> &texture, TRAP::Graphics::RendererAPI::ResourceState oldLayout, TRAP::Graphics::RendererAPI::ResourceState newLayout, TRAP::Graphics::RendererAPI::QueueType queueType = QueueType::Graphics)#
Transition a texture from old layout to the new layout. The transition happens immediately and is guaranteed to be complete when the function returns.
-
static void GetAntiAliasing(AntiAliasing &outAntiAliasing, SampleCount &outSampleCount, const Window &window) noexcept#
Retrieve the currently used anti aliasing method and the sample count.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
outAntiAliasing – Output: Used anti aliasing method.
outSampleCount – Output: Used sample count.
window – Window to get anti aliasing from.
-
static void SetAntiAliasing(AntiAliasing antiAliasing, SampleCount sampleCount)#
Set the anti aliasing method and the sample count. Use AntiAliasing::Off to disable anti aliasing.
Note
This takes effect on the next frame onwards.
Note
A sample count of 1 is only valid if anti aliasing is disabled.
- Parameters:
antiAliasing – Anti aliasing method to use.
sampleCount – Sample count to use.
-
static SampleCount GetAnisotropyLevel() noexcept#
Retrieve the currently used anisotropy level.
- Returns:
Used anisotropy level.
-
static void SetAnisotropyLevel(SampleCount anisotropyLevel)#
Set the anisotropy level. A value of SampleCount::One effectively disables anisotropic filtering.
Note
User created samplers need to be recreated in order to use the new anisotropy level.
- Parameters:
anisotropyLevel – Anisotropy level to use.
-
static void ResizeSwapChain(const Window &window)#
Notify the RendererAPI that the SwapChain needs to be resized. This function should be called inside FrameBufferResizeEvent callbacks.
Remark
Headless mode: This function is not available in headless mode.
-
static f32 GetGPUGraphicsFrameTime(const Window &window)#
Retrieve the GPU side frame time for the graphics queue.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to get frame time from.
- Returns:
GPU Graphics frame time in milliseconds.
-
static f32 GetGPUComputeFrameTime(const Window &window)#
Retrieve the GPU side frame time for the compute queue.
Remark
Headless mode: This function is not available in headless mode.
- Parameters:
window – Window to get frame time from.
- Returns:
GPU Compute frame time in milliseconds.
-
static PerViewportData &GetViewportData(const Window &window)#
Retrieve internal rendering data.
Remark
Headless mode: This function is not available in headless mode.
- Returns:
Windows internal rendering data.
-
static bool IsVulkanCapable()#
Check if the system is Vulkan API capable.
Note
The first call to this function will run the Vulkan capability tester.
- Returns:
True if the system is Vulkan API capable, false otherwise.
Public Static Attributes
-
static struct TRAP::Graphics::RendererAPI::GPUSettings GPUSettings#
Protected Functions
-
constexpr RendererAPI() noexcept = default#
Constructor.
Protected Static Attributes
-
static TRAP::Scope<RendererAPI> s_Renderer#
-
static TRAP::Scope<API::ResourceLoader> s_ResourceLoader#
-
static TRAP::Ref<DescriptorPool> s_descriptorPool#
-
static constinit RendererAPI::SampleCount s_newSampleCount = RendererAPI::SampleCount::Two#
-
static constinit RendererAPI::AntiAliasing s_newAntiAliasing = RendererAPI::AntiAliasing::Off#
-
static constinit RendererAPI::SampleCount s_Anisotropy = RendererAPI::SampleCount::Sixteen#
-
static std::unordered_map<const Window*, TRAP::Scope<PerViewportData>> s_perViewportDataMap#
-
struct BinaryShaderDesc#
Description of a binary shader.
Public Members
-
ShaderStage Stages = {}#
-
BinaryShaderStageDesc Vertex = {}#
-
BinaryShaderStageDesc Fragment = {}#
-
BinaryShaderStageDesc Geometry = {}#
-
BinaryShaderStageDesc TessellationControl = {}#
-
BinaryShaderStageDesc TessellationEvaluation = {}#
-
BinaryShaderStageDesc Compute = {}#
-
ShaderStage Stages = {}#
-
struct BinaryShaderStageDesc#
Description of a binary shader stage.
-
struct BlendStateDesc#
Description of a blend state.
Public Members
-
std::array<BlendConstant, 8> SrcFactors = {}#
-
std::array<BlendConstant, 8> DstFactors = {}#
-
std::array<BlendConstant, 8> SrcAlphaFactors = {}#
-
std::array<BlendConstant, 8> DstAlphaFactors = {}#
-
BlendStateTargets RenderTargetMask = {}#
-
bool IndependentBlend = {}#
-
std::array<BlendConstant, 8> SrcFactors = {}#
-
struct BufferBarrier#
Struct holding a buffer barrier.
Public Members
-
ResourceState CurrentState = {}#
-
ResourceState NewState = {}#
-
bool BeginOnly = {}#
-
bool EndOnly = {}#
-
bool Acquire = {}#
-
bool Release = {}#
-
TRAP::Graphics::RendererAPI::QueueType QueueType = {}#
-
ResourceState CurrentState = {}#
-
struct BufferDesc#
Description of a buffer.
Public Members
-
ResourceMemoryUsage MemoryUsage = {}#
-
BufferCreationFlags Flags = {}#
-
TRAP::Graphics::RendererAPI::QueueType QueueType = {}#
-
ResourceState StartState = {}#
-
IndirectArgumentType ICBDrawType = {}#
-
TRAP::Graphics::API::ImageFormat Format = {}#
-
DescriptorType Descriptors = {}#
-
std::string Name = {}#
-
ResourceMemoryUsage MemoryUsage = {}#
-
struct BufferLoadDesc#
Description for a buffer load.
-
struct BufferUpdateDesc#
Description for a buffer update.
Public Members
-
MappedMemoryRange MappedRange#
-
struct TRAP::Graphics::RendererAPI::BufferUpdateDesc::[anonymous] Internal#
-
MappedMemoryRange MappedRange#
-
struct Color#
-
struct CommandPoolDesc#
Description of a command pool.
Public Members
-
CommandPoolCreateFlags CreateFlags = CommandPoolCreateFlags::None#
-
std::string Name = {}#
-
CommandPoolCreateFlags CreateFlags = CommandPoolCreateFlags::None#
-
struct CommandSignatureDesc#
Description of a command signature.
Public Members
-
TRAP::Ref<TRAP::Graphics::RootSignature> RootSignature = {}#
-
std::vector<IndirectArgumentDescriptor> ArgDescs = {}#
-
bool Packed = {}#
-
TRAP::Ref<TRAP::Graphics::RootSignature> RootSignature = {}#
-
struct ComputePipelineDesc#
Description of a compute pipeline.
Public Members
-
TRAP::Ref<TRAP::Graphics::RootSignature> RootSignature = {}#
-
TRAP::Ref<TRAP::Graphics::RootSignature> RootSignature = {}#
-
struct DepthStateDesc#
Description of a depth state.
Public Members
-
bool DepthTest = {}#
-
bool DepthWrite = {}#
-
CompareMode DepthFunc = {}#
-
bool StencilTest = {}#
-
CompareMode StencilFrontFunc = {}#
-
CompareMode StencilBackFunc = {}#
-
bool DepthTest = {}#
-
struct DepthStencil#
-
struct DescriptorData#
Struct holding a data of a descriptor.
Public Members
-
std::string Name = {}#
-
std::variant<BufferOffset, DescriptorSetExtraction, TextureSlice, bool> Offset = {false}#
-
DescriptorResource Resource = {std::vector<const TRAP::Graphics::Texture*>()}#
-
struct BufferOffset#
Range(s) to bind (buffer, offset, size)
-
struct DescriptorSetExtraction#
Descriptor set buffer extraction options.
-
struct TextureSlice#
-
std::string Name = {}#
-
struct DescriptorInfo#
Struct containing information about a descriptor.
Public Members
-
std::string Name = {}#
-
DescriptorType Type = {}#
-
API::ShaderReflection::TextureDimension Dimension = {}#
-
bool RootDescriptor = {}#
-
VkDescriptorType VkType = {}#
-
std::string Name = {}#
-
struct DescriptorSetDesc#
Description of a descriptor set.
-
struct GPUSettings
Struct holding data about a GPUs features, limits and other properties.
Public Members
-
SampleCount MaxMSAASampleCount#
-
TRAP::Graphics::RendererAPI::WaveOpsSupportFlags WaveOpsSupportFlags#
-
bool MultiDrawIndirectSupported#
-
bool TessellationSupported#
-
bool GeometryShaderSupported#
-
bool FillModeNonSolid#
-
bool SurfaceSupported#
-
bool PresentSupported#
-
bool SampleRateShadingSupported#
-
TRAP::Graphics::RendererAPI::ShadingRate ShadingRates#
-
TRAP::Graphics::RendererAPI::ShadingRateCaps ShadingRateCaps#
-
TRAP::Graphics::RendererAPI::ShadingRateCombiner ShadingRateCombiner#
-
bool ReflexSupported#
-
SampleCount MaxMSAASampleCount#
-
struct GraphicsPipelineDesc#
Description of a graphics pipeline.
Public Members
-
TRAP::Ref<TRAP::Graphics::RootSignature> RootSignature = {}#
-
TRAP::Ref<TRAP::Graphics::RendererAPI::VertexLayout> VertexLayout = {}#
-
TRAP::Ref<BlendStateDesc> BlendState = {}#
-
TRAP::Ref<DepthStateDesc> DepthState = {}#
-
TRAP::Ref<RasterizerStateDesc> RasterizerState = {}#
-
std::vector<TRAP::Graphics::API::ImageFormat> ColorFormats = {}#
-
TRAP::Graphics::RendererAPI::SampleCount SampleCount = RendererAPI::SampleCount::One#
-
TRAP::Graphics::API::ImageFormat DepthStencilFormat = {}#
-
TRAP::Graphics::RendererAPI::PrimitiveTopology PrimitiveTopology = {}#
-
TRAP::Graphics::RendererAPI::ShadingRate ShadingRate = {}#
-
std::array<TRAP::Graphics::RendererAPI::ShadingRateCombiner, 2> ShadingRateCombiners = {}#
-
TRAP::Ref<TRAP::Graphics::RenderTarget> ShadingRateTexture = {}#
-
TRAP::Ref<TRAP::Graphics::RootSignature> RootSignature = {}#
-
struct IndirectArgumentDescriptor#
Struct holding indirect descriptor argument.
-
struct IndirectDispatchArguments#
Struct holding indirect dispatch arguments.
-
struct IndirectDrawArguments#
Struct holding indirect draw arguments.
-
struct IndirectDrawIndexArguments#
Struct holding indirect indexed draw arguments.
-
struct LoadActionsDesc#
Description of actions to perform on load.
Public Members
-
std::vector<LoadActionType> LoadActionsColor = {}#
-
LoadActionType LoadActionDepth = {}#
-
LoadActionType LoadActionStencil = {}#
-
std::vector<RendererAPI::Color> ClearColorValues = {}#
-
RendererAPI::DepthStencil ClearDepthStencil = {}#
-
std::vector<StoreActionType> StoreActionsColor = {}#
-
StoreActionType StoreActionDepth = {}#
-
StoreActionType StoreActionStencil = {}#
-
std::vector<LoadActionType> LoadActionsColor = {}#
-
struct MappedMemoryRange#
Struct holding data about a mapped memory range.
-
struct PerViewportData#
Per window data used for rendering.
Public Functions
-
PerViewportData() = default#
Constructor.
-
~PerViewportData()#
Destructor.
-
consteval PerViewportData(const PerViewportData&) noexcept = delete#
Copy constructor.
-
PerViewportData(PerViewportData&&) noexcept = default#
Move constructor.
-
consteval PerViewportData &operator=(const PerViewportData&) noexcept = delete#
Copy assignment operator.
-
PerViewportData &operator=(PerViewportData&&) noexcept = default#
Move assignment operator.
Public Members
-
PerWindowState State = {}#
-
std::array<TRAP::Ref<CommandPool>, ImageCount> GraphicCommandPools#
-
std::array<CommandBuffer*, ImageCount> GraphicCommandBuffers = {}#
-
std::array<TRAP::Ref<Fence>, ImageCount> RenderCompleteFences#
-
std::array<TRAP::Ref<Semaphore>, ImageCount> ImageAcquiredSemaphores#
-
std::array<TRAP::Ref<Semaphore>, ImageCount> RenderCompleteSemaphores#
-
std::array<TRAP::Ref<Semaphore>, ImageCount> GraphicsCompleteSemaphores#
-
std::array<TRAP::Ref<QueryPool>, ImageCount> GraphicsTimestampQueryPools#
-
std::array<TRAP::Ref<Buffer>, ImageCount> GraphicsTimestampReadbackBuffers#
-
PipelineDesc GraphicsPipelineDesc#
-
bool Recording = {}#
-
TRAP::Ref<RenderTarget> NewShadingRateTexture#
-
std::array<TRAP::Ref<TRAP::Graphics::RenderTarget>, 3> CachedShadingRateTextures = {}#
-
TRAP::Ref<RenderTarget> DepthStencilTarget = nullptr#
-
bool ResizeSwapChain = false#
-
std::array<TRAP::Ref<RenderTarget>, ImageCount> TemporaryResolveRenderTargets#
-
std::vector<TRAP::Ref<RenderTarget>> InternalRenderTargets = {}#
-
RendererAPI::AntiAliasing CurrentAntiAliasing = RendererAPI::AntiAliasing::Off#
-
RendererAPI::SampleCount CurrentSampleCount = RendererAPI::SampleCount::One#
-
RendererAPI::Color ClearColor = {0.1, 0.1, 0.1, 1.0}#
-
RendererAPI::DepthStencil ClearDepthStencil = {0.0f, 0}#
-
bool CurrentVSync = {}#
-
bool NewVSync = {}#
-
std::array<TRAP::Ref<CommandPool>, ImageCount> ComputeCommandPools#
-
std::array<CommandBuffer*, ImageCount> ComputeCommandBuffers = {}#
-
std::array<TRAP::Ref<Fence>, ImageCount> ComputeCompleteFences#
-
std::array<TRAP::Ref<Semaphore>, ImageCount> ComputeCompleteSemaphores#
-
std::array<TRAP::Ref<QueryPool>, ImageCount> ComputeTimestampQueryPools#
-
std::array<TRAP::Ref<Buffer>, ImageCount> ComputeTimestampReadbackBuffers#
-
PipelineDesc ComputePipelineDesc#
-
bool RecordingCompute = {}#
-
PerViewportData() = default#
-
struct PipelineCacheDesc#
Description of a pipeline cache.
-
struct PipelineCacheLoadDesc#
Description of a pipeline cache to load.
Public Members
-
std::filesystem::path Path = {}#
-
PipelineCacheFlags Flags = {}#
-
std::string Name = {}#
-
std::filesystem::path Path = {}#
-
struct PipelineDesc#
Description of a pipeline.
Public Members
-
PipelineType Type = {}#
-
std::variant<ComputePipelineDesc, GraphicsPipelineDesc, RayTracingPipelineDesc> Pipeline = {GraphicsPipelineDesc()}#
-
TRAP::Ref<PipelineCache> Cache = {}#
-
void *PipelineExtensions = {}#
-
std::string Name = {}#
-
PipelineType Type = {}#
-
struct QueryDesc#
Description of a query.
-
struct QueryPoolDesc#
Description of a query pool.
-
struct QueueDesc#
Description of a queue.
-
struct QueuePresentDesc#
Description of a queue presentation.
-
struct QueueSubmitDesc#
Description for a queue submission.
-
struct RasterizerStateDesc#
Description of a rasterizer state.
Public Members
-
TRAP::Graphics::RendererAPI::CullMode CullMode = {}#
-
TRAP::Graphics::RendererAPI::FillMode FillMode = {}#
-
TRAP::Graphics::RendererAPI::FrontFace FrontFace = {}#
-
bool DepthClampEnable = {}#
-
TRAP::Graphics::RendererAPI::CullMode CullMode = {}#
-
struct RayTracingPipelineDesc#
Description of a RayTracing pipeline.
-
struct ReadRange#
Read range used for buffer mapping.
-
struct RenderTargetBarrier#
Struct holding a render target barrier.
Public Members
-
std::reference_wrapper<const TRAP::Graphics::RenderTarget> RenderTarget#
-
ResourceState CurrentState = {}#
-
ResourceState NewState = {}#
-
bool BeginOnly = {}#
-
bool EndOnly = {}#
-
bool Acquire = {}#
-
bool Release = {}#
-
TRAP::Graphics::RendererAPI::QueueType QueueType = {}#
-
bool SubresourceBarrier = {}#
-
std::reference_wrapper<const TRAP::Graphics::RenderTarget> RenderTarget#
-
struct RenderTargetDesc#
Description of a render target.
Public Members
-
TextureCreationFlags Flags = {}#
-
TRAP::Graphics::RendererAPI::SampleCount SampleCount = RendererAPI::SampleCount::One#
-
TRAP::Graphics::API::ImageFormat Format = {}#
-
ResourceState StartState = {}#
-
RendererAPI::ClearValue ClearValue = {}#
-
DescriptorType Descriptors = {}#
-
std::string Name = {}#
-
void *NativeHandle = {}#
-
TextureCreationFlags Flags = {}#
-
struct ResourceLoaderDesc#
Description for the resource loader.
-
struct RootSignatureDesc#
Description of a root signature.
-
struct SamplerDesc#
Description of a sampler.
Public Functions
-
constexpr bool operator==(const SamplerDesc &other) const noexcept = default#
-
constexpr bool operator!=(const SamplerDesc &other) const noexcept = default#
Public Members
-
FilterType MinFilter = {}#
-
FilterType MagFilter = {}#
-
TRAP::Graphics::RendererAPI::MipMapMode MipMapMode = {}#
-
AddressMode AddressU = {}#
-
AddressMode AddressV = {}#
-
AddressMode AddressW = {}#
-
bool SetLodRange = {}#
-
bool EnableAnisotropy = true#
-
CompareMode CompareFunc = {}#
-
std::string Name = {}#
-
struct TRAP::Graphics::RendererAPI::SamplerDesc::SamplerConversionDesc SamplerConversionDesc#
-
struct SamplerConversionDesc
Description of YCbCr(YUV) conversion sampler.
Public Functions
-
constexpr bool operator==(const SamplerConversionDesc &other) const noexcept = default#
-
constexpr bool operator!=(const SamplerConversionDesc &other) const noexcept = default#
Public Members
-
TRAP::Graphics::API::ImageFormat Format#
-
SamplerModelConversion Model#
-
SamplerRange Range#
-
SampleLocation ChromaOffsetX#
-
SampleLocation ChromaOffsetY#
-
FilterType ChromaFilter#
-
bool ForceExplicitReconstruction#
-
constexpr bool operator==(const SamplerConversionDesc &other) const noexcept = default#
-
constexpr bool operator==(const SamplerDesc &other) const noexcept = default#
-
struct SubresourceDataDesc#
Description of a subresource. Used to update a existing resource.
-
struct SwapChainDesc#
Description of a swapchain.
Public Members
-
TRAP::Graphics::API::ImageFormat ColorFormat = {}#
-
RendererAPI::ClearValue ClearValue = {}#
-
bool EnableVSync = {}#
-
RendererAPI::SampleCount SampleCount = SampleCount::One#
-
TRAP::Graphics::API::ImageFormat ColorFormat = {}#
-
struct TextureBarrier#
Struct holding a texture barrier.
Public Members
-
ResourceState CurrentState = {}#
-
ResourceState NewState = {}#
-
bool BeginOnly = {}#
-
bool EndOnly = {}#
-
bool Acquire = {}#
-
bool Release = {}#
-
TRAP::Graphics::RendererAPI::QueueType QueueType = {}#
-
bool SubresourceBarrier = {}#
-
ResourceState CurrentState = {}#
-
struct TextureCopyDesc#
-
struct TextureDesc#
Description of a texture.
Public Members
-
TextureCreationFlags Flags = {}#
-
TRAP::Graphics::RendererAPI::SampleCount SampleCount = RendererAPI::SampleCount::One#
-
TRAP::Graphics::API::ImageFormat Format = {}#
-
RendererAPI::ClearValue ClearValue = {}#
-
ResourceState StartState = {}#
-
DescriptorType Descriptors = {}#
-
void *NativeHandle = {}#
-
std::string Name = {}#
-
::VkSamplerYcbcrConversionInfo *VkSamplerYcbcrConversionInfo = {}#
-
TextureCreationFlags Flags = {}#
-
struct TextureLoadDesc#
Description for a texture load.
Public Members
-
TextureDesc *Desc = {}#
-
std::vector<std::filesystem::path> Filepaths#
-
TextureCreationFlags CreationFlag = TextureCreationFlags::None#
-
bool IsCubemap = {}#
-
TRAP::Optional<TextureCubeType> Type = TRAP::NullOpt#
-
TextureDesc *Desc = {}#
-
struct TextureUpdateDesc#
Description for a texture update.
Note
Only use for procedural textures which are created on CPU (noise textures, font texture, …)
Public Members
-
MappedMemoryRange MappedRange#
-
struct TRAP::Graphics::RendererAPI::TextureUpdateDesc::[anonymous] Internal#
-
MappedMemoryRange MappedRange#
-
struct VertexAttribute#
Description of a single vertex attribute.
-
struct VertexLayout#
Description of a vertex layout.
-
enum class WaveOpsSupportFlags : u32#