evan 2026.1.4
Evan
Loading...
Searching...
No Matches
evan::DrawSortKey Struct Reference

Key that decides in which order a frame's draws are recorded. More...

#include <headers/evan/RenderSettings.hpp>

Public Attributes

BlendMode blendMode = BlendMode::Opaque
 
uint32_t depthBucket = 0
 
float depth = 0.0f
 
uint32_t pipelineKey = 0
 
uint32_t materialID = 0
 
VkBuffer vertexBuffer = VK_NULL_HANDLE
 
VkBuffer indexBuffer = VK_NULL_HANDLE
 
uint32_t sequence = 0
 

Detailed Description

Key that decides in which order a frame's draws are recorded.

Resolved once per draw before sorting, so that ordering is a plain key comparison instead of work repeated inside the comparator. It carries, in decreasing priority:

  • the blend mode, which partitions opaque draws before blended ones;
  • for opaque draws, the depth bucket, ascending (front-to-back), so that early depth testing can reject occluded fragments; for blended draws, the exact distance, descending (back-to-front), so that compositing stays correct;
  • the state identifying a batch: pipeline, material and geometry;
  • a unique sequence number, which makes the order total and therefore reproducible whatever std::sort does with equal elements.

Definition at line 162 of file RenderSettings.hpp.

Member Data Documentation

◆ blendMode

BlendMode evan::DrawSortKey::blendMode = BlendMode::Opaque

Definition at line 163 of file RenderSettings.hpp.

◆ depth

float evan::DrawSortKey::depth = 0.0f

Definition at line 165 of file RenderSettings.hpp.

◆ depthBucket

uint32_t evan::DrawSortKey::depthBucket = 0

Definition at line 164 of file RenderSettings.hpp.

◆ indexBuffer

VkBuffer evan::DrawSortKey::indexBuffer = VK_NULL_HANDLE

Definition at line 169 of file RenderSettings.hpp.

◆ materialID

uint32_t evan::DrawSortKey::materialID = 0

Definition at line 167 of file RenderSettings.hpp.

◆ pipelineKey

uint32_t evan::DrawSortKey::pipelineKey = 0

Definition at line 166 of file RenderSettings.hpp.

◆ sequence

uint32_t evan::DrawSortKey::sequence = 0

Definition at line 170 of file RenderSettings.hpp.

◆ vertexBuffer

VkBuffer evan::DrawSortKey::vertexBuffer = VK_NULL_HANDLE

Definition at line 168 of file RenderSettings.hpp.


The documentation for this struct was generated from the following file: