Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::GFX Namespace Reference

Namespaces

namespace  anonymous_namespace{CommandBuffer.cpp}
 
namespace  anonymous_namespace{CommandBuffer.inl}
 
namespace  Names
 

Classes

struct  AddDebugMessageCommand
 
struct  BeginDebugScopeCommand
 
struct  BeginGPUQueryCommand
 
struct  BeginRenderPassCommand
 
struct  BindPipelineCommand
 
struct  BindShaderResourcesCommand
 
struct  BlitRenderTargetCommand
 
struct  ClearBufferDataCommand
 
struct  ClearTextureCommand
 
struct  Command
 
struct  CommandBase
 
class  CommandBuffer
 
class  CommandBufferPool
 
struct  CommandBufferQueue
 
struct  ComputeMipMapsCommand
 
struct  CopyTextureCommand
 
struct  DispatchComputeCommand
 
struct  DrawCommand
 
struct  EndDebugScopeCommand
 
struct  EndGPUQueryCommand
 
struct  EndRenderPassCommand
 
struct  MapToDataType_t
 
struct  MapToDataType_t< CommandType::ADD_DEBUG_MESSAGE >
 
struct  MapToDataType_t< CommandType::BEGIN_DEBUG_SCOPE >
 
struct  MapToDataType_t< CommandType::BEGIN_GPU_QUERY >
 
struct  MapToDataType_t< CommandType::BEGIN_RENDER_PASS >
 
struct  MapToDataType_t< CommandType::BIND_PIPELINE >
 
struct  MapToDataType_t< CommandType::BIND_SHADER_RESOURCES >
 
struct  MapToDataType_t< CommandType::BLIT_RT >
 
struct  MapToDataType_t< CommandType::CLEAR_BUFFER_DATA >
 
struct  MapToDataType_t< CommandType::CLEAR_TEXTURE >
 
struct  MapToDataType_t< CommandType::COMPUTE_MIPMAPS >
 
struct  MapToDataType_t< CommandType::COPY_TEXTURE >
 
struct  MapToDataType_t< CommandType::DISPATCH_COMPUTE >
 
struct  MapToDataType_t< CommandType::DRAW_COMMANDS >
 
struct  MapToDataType_t< CommandType::END_DEBUG_SCOPE >
 
struct  MapToDataType_t< CommandType::END_GPU_QUERY >
 
struct  MapToDataType_t< CommandType::END_RENDER_PASS >
 
struct  MapToDataType_t< CommandType::MEMORY_BARRIER >
 
struct  MapToDataType_t< CommandType::POP_CAMERA >
 
struct  MapToDataType_t< CommandType::POP_VIEWPORT >
 
struct  MapToDataType_t< CommandType::PUSH_CAMERA >
 
struct  MapToDataType_t< CommandType::PUSH_VIEWPORT >
 
struct  MapToDataType_t< CommandType::READ_BUFFER_DATA >
 
struct  MapToDataType_t< CommandType::READ_TEXTURE >
 
struct  MapToDataType_t< CommandType::SEND_PUSH_CONSTANTS >
 
struct  MapToDataType_t< CommandType::SET_CAMERA >
 
struct  MapToDataType_t< CommandType::SET_CLIP_PLANES >
 
struct  MapToDataType_t< CommandType::SET_SCISSOR >
 
struct  MapToDataType_t< CommandType::SET_VIEWPORT >
 
struct  MemoryBarrierCommand
 
struct  PopCameraCommand
 
struct  PopViewportCommand
 
struct  PushCameraCommand
 
struct  PushViewportCommand
 
struct  ReadBufferDataCommand
 
struct  ReadTextureCommand
 
struct  SendPushConstantsCommand
 
struct  SetCameraCommand
 
struct  SetClipPlanesCommand
 
struct  SetScissorCommand
 
struct  SetViewportCommand
 

Typedefs

template<CommandType T>
using MapToDataType = typename MapToDataType_t< T >::type
 

Enumerations

enum class  ErrorType : U8 {
  NONE = 0 , MISSING_BEGIN_RENDER_PASS , INVALID_BEGIN_RENDER_PASS , MISSING_END_RENDER_PASS ,
  MISSING_BEGIN_GPU_QUERY , MISSING_END_GPU_QUERY , MISSING_PUSH_DEBUG_SCOPE , MISSING_POP_DEBUG_SCOPE ,
  MISSING_POP_CAMERA , MISSING_POP_VIEWPORT , MISSING_VALID_PIPELINE , MISSING_BLIT_DESCRIPTOR_SET ,
  INVALID_DISPATCH_COUNT , INVALID_DESCRIPTOR_SET , INVALID_RENDER_PASS_FOR_PIPELINE , COUNT
}
 
enum class  CommandType : U8 {
  BEGIN_RENDER_PASS , END_RENDER_PASS , BEGIN_GPU_QUERY , END_GPU_QUERY ,
  SET_VIEWPORT , PUSH_VIEWPORT , POP_VIEWPORT , SET_SCISSOR ,
  BLIT_RT , COPY_TEXTURE , READ_TEXTURE , CLEAR_TEXTURE ,
  COMPUTE_MIPMAPS , SET_CAMERA , PUSH_CAMERA , POP_CAMERA ,
  SET_CLIP_PLANES , BIND_PIPELINE , BIND_SHADER_RESOURCES , SEND_PUSH_CONSTANTS ,
  DRAW_COMMANDS , DISPATCH_COMPUTE , MEMORY_BARRIER , READ_BUFFER_DATA ,
  CLEAR_BUFFER_DATA , BEGIN_DEBUG_SCOPE , END_DEBUG_SCOPE , ADD_DEBUG_MESSAGE ,
  COUNT
}
 

Functions

void ResetCommandBufferQueue (CommandBufferQueue &queue)
 
void AddCommandBufferToQueue (CommandBufferQueue &queue, const Handle< GFX::CommandBuffer > &commandBuffer)
 
void AddCommandBufferToQueue (CommandBufferQueue &queue, Handle< GFX::CommandBuffer > &&commandBuffer)
 
void ToString (const CommandBase &cmd, const CommandType type, I32 &crtIndent, string &out)
 
bool BatchDrawCommands (GenericDrawCommand &previousGDC, GenericDrawCommand &currentGDC) noexcept
 
bool Merge (DrawCommand *prevCommand, DrawCommand *crtCommand)
 
bool Merge (GFX::MemoryBarrierCommand *lhs, GFX::MemoryBarrierCommand *rhs)
 
bool Merge (SendPushConstantsCommand *lhs, SendPushConstantsCommand *rhs)
 
void InitPools (const size_t poolSizeFactor)
 
void DestroyPools () noexcept
 
CommandBufferGet (Handle< CommandBuffer > handle)
 
Handle< CommandBufferAllocateCommandBuffer (const char *name, const size_t reservedCmdCount)
 
void DeallocateCommandBuffer (Handle< CommandBuffer > &buffer)
 
static string ToString (const BindPipelineCommand &cmd, U16 indent)
 
static string ToString (const SendPushConstantsCommand &cmd, U16 indent)
 
static string ToString (const DrawCommand &cmd, const U16 indent)
 
static string ToString (const SetViewportCommand &cmd, U16 indent)
 
static string ToString (const PushViewportCommand &cmd, U16 indent)
 
static string ToString (const BeginRenderPassCommand &cmd, U16 indent)
 
static string ToString (const SetScissorCommand &cmd, U16 indent)
 
static string ToString (const SetClipPlanesCommand &cmd, const U16 indent)
 
static string ToString (const SetCameraCommand &cmd, U16 indent)
 
static string ToString (const BindShaderResourcesCommand &cmd, const U16 indent)
 
static string ToString (const BeginDebugScopeCommand &cmd, const U16 indent)
 
static string ToString (const AddDebugMessageCommand &cmd, const U16 indent)
 
static string ToString (const DispatchComputeCommand &cmd, U16 indent)
 
static string ToString (const MemoryBarrierCommand &cmd, U16 indent)
 
static string ToString (const BeginGPUQueryCommand &cmd, const U16 indent)
 
static string ToString (const EndGPUQueryCommand &cmd, const U16 indent)
 
static string ToString (const BlitRenderTargetCommand &cmd, const U16 indent)
 
static string ToString (const CopyTextureCommand &cmd, const U16 indent)
 
static string ToString (const ReadTextureCommand &cmd, const U16 indent)
 
static string ToString (const ClearTextureCommand &cmd, const U16 indent)
 
static string ToString (const ComputeMipMapsCommand &cmd, const U16 indent)
 
static string ToString (const PushCameraCommand &cmd, const U16 indent)
 
static string ToString (const ReadBufferDataCommand &cmd, const U16 indent)
 
static string ToString (const ClearBufferDataCommand &cmd, const U16 indent)
 
string ToString (const CommandBase &cmd, const CommandType type, U16 indent)
 
template<typename T = CommandBase>
requires std::is_base_of_v<CommandBase, T>
bool TryMergeCommands (CommandType type, T *prevCommand, T *crtCommand)
 
template<typename T >
requires std::is_base_of_v<CommandBase, T>
FORCE_INLINE T * EnqueueCommand (CommandBuffer &buffer)
 
template<typename T >
requires std::is_base_of_v<CommandBase, T>
FORCE_INLINE T * EnqueueCommand (CommandBuffer &buffer, T &cmd)
 
template<typename T >
requires std::is_base_of_v<CommandBase, T>
FORCE_INLINE T * EnqueueCommand (CommandBuffer &buffer, T &&cmd)
 

Variables

static CommandBufferPoolg_sCommandBufferPool = nullptr
 

Typedef Documentation

◆ MapToDataType

template<CommandType T>
using Divide::GFX::MapToDataType = typedef typename MapToDataType_t<T>::type

Definition at line 48 of file Commands.h.

Enumeration Type Documentation

◆ CommandType

enum class Divide::GFX::CommandType : U8
strong
Enumerator
BEGIN_RENDER_PASS 
END_RENDER_PASS 
BEGIN_GPU_QUERY 
END_GPU_QUERY 
SET_VIEWPORT 
PUSH_VIEWPORT 
POP_VIEWPORT 
SET_SCISSOR 
BLIT_RT 
COPY_TEXTURE 
READ_TEXTURE 
CLEAR_TEXTURE 
COMPUTE_MIPMAPS 
SET_CAMERA 
PUSH_CAMERA 
POP_CAMERA 
SET_CLIP_PLANES 
BIND_PIPELINE 
BIND_SHADER_RESOURCES 
SEND_PUSH_CONSTANTS 
DRAW_COMMANDS 
DISPATCH_COMPUTE 
MEMORY_BARRIER 
READ_BUFFER_DATA 
CLEAR_BUFFER_DATA 
BEGIN_DEBUG_SCOPE 
END_DEBUG_SCOPE 
ADD_DEBUG_MESSAGE 
COUNT 

Definition at line 40 of file CommandTypes.h.

◆ ErrorType

enum class Divide::GFX::ErrorType : U8
strong
Enumerator
NONE 
MISSING_BEGIN_RENDER_PASS 
INVALID_BEGIN_RENDER_PASS 
MISSING_END_RENDER_PASS 
MISSING_BEGIN_GPU_QUERY 
MISSING_END_GPU_QUERY 
MISSING_PUSH_DEBUG_SCOPE 
MISSING_POP_DEBUG_SCOPE 
MISSING_POP_CAMERA 
MISSING_POP_VIEWPORT 
MISSING_VALID_PIPELINE 
MISSING_BLIT_DESCRIPTOR_SET 
INVALID_DISPATCH_COUNT 
INVALID_DESCRIPTOR_SET 
INVALID_RENDER_PASS_FOR_PIPELINE 
COUNT 

Definition at line 42 of file CommandBuffer.h.

Function Documentation

◆ AddCommandBufferToQueue() [1/2]

void Divide::GFX::AddCommandBufferToQueue ( CommandBufferQueue queue,
const Handle< GFX::CommandBuffer > &  commandBuffer 
)

Definition at line 79 of file CommandBuffer.cpp.

◆ AddCommandBufferToQueue() [2/2]

void Divide::GFX::AddCommandBufferToQueue ( CommandBufferQueue queue,
Handle< GFX::CommandBuffer > &&  commandBuffer 
)

Definition at line 89 of file CommandBuffer.cpp.

◆ AllocateCommandBuffer()

Handle< CommandBuffer > Divide::GFX::AllocateCommandBuffer ( const char *  name,
const size_t  reservedCmdCount 
)

Definition at line 133 of file CommandBufferPool.cpp.

◆ BatchDrawCommands()

bool Divide::GFX::BatchDrawCommands ( GenericDrawCommand previousGDC,
GenericDrawCommand currentGDC 
)
noexcept

Definition at line 657 of file CommandBuffer.cpp.

◆ DeallocateCommandBuffer()

void Divide::GFX::DeallocateCommandBuffer ( Handle< CommandBuffer > &  buffer)

Definition at line 140 of file CommandBufferPool.cpp.

◆ DestroyPools()

void Divide::GFX::DestroyPools ( )
noexcept

Definition at line 17 of file CommandBufferPool.cpp.

◆ EnqueueCommand() [1/3]

template<typename T >
requires std::is_base_of_v<CommandBase, T>
FORCE_INLINE T * Divide::GFX::EnqueueCommand ( CommandBuffer buffer)

Definition at line 162 of file CommandBuffer.h.

◆ EnqueueCommand() [2/3]

template<typename T >
requires std::is_base_of_v<CommandBase, T>
FORCE_INLINE T * Divide::GFX::EnqueueCommand ( CommandBuffer buffer,
T &&  cmd 
)

Definition at line 168 of file CommandBuffer.h.

◆ EnqueueCommand() [3/3]

template<typename T >
requires std::is_base_of_v<CommandBase, T>
FORCE_INLINE T * Divide::GFX::EnqueueCommand ( CommandBuffer buffer,
T &  cmd 
)

Definition at line 165 of file CommandBuffer.h.

◆ Get()

CommandBuffer * Divide::GFX::Get ( Handle< CommandBuffer handle)

Definition at line 126 of file CommandBufferPool.cpp.

◆ InitPools()

void Divide::GFX::InitPools ( const size_t  poolSizeFactor)

Definition at line 10 of file CommandBufferPool.cpp.

◆ Merge() [1/3]

bool Divide::GFX::Merge ( DrawCommand prevCommand,
DrawCommand crtCommand 
)

Definition at line 684 of file CommandBuffer.cpp.

◆ Merge() [2/3]

bool Divide::GFX::Merge ( GFX::MemoryBarrierCommand lhs,
GFX::MemoryBarrierCommand rhs 
)

Definition at line 722 of file CommandBuffer.cpp.

◆ Merge() [3/3]

bool Divide::GFX::Merge ( SendPushConstantsCommand lhs,
SendPushConstantsCommand rhs 
)

Definition at line 776 of file CommandBuffer.cpp.

◆ ResetCommandBufferQueue()

void Divide::GFX::ResetCommandBufferQueue ( CommandBufferQueue queue)

Definition at line 66 of file CommandBuffer.cpp.

◆ ToString() [1/26]

static string Divide::GFX::ToString ( const AddDebugMessageCommand cmd,
const U16  indent 
)
static

Definition at line 392 of file Commands.cpp.

◆ ToString() [2/26]

static string Divide::GFX::ToString ( const BeginDebugScopeCommand cmd,
const U16  indent 
)
static

Definition at line 387 of file Commands.cpp.

◆ ToString() [3/26]

static string Divide::GFX::ToString ( const BeginGPUQueryCommand cmd,
const U16  indent 
)
static

Definition at line 434 of file Commands.cpp.

◆ ToString() [4/26]

static string Divide::GFX::ToString ( const BeginRenderPassCommand cmd,
U16  indent 
)
static

Definition at line 212 of file Commands.cpp.

◆ ToString() [5/26]

static string Divide::GFX::ToString ( const BindPipelineCommand cmd,
U16  indent 
)
static

Definition at line 19 of file Commands.cpp.

◆ ToString() [6/26]

static string Divide::GFX::ToString ( const BindShaderResourcesCommand cmd,
const U16  indent 
)
static

Definition at line 289 of file Commands.cpp.

◆ ToString() [7/26]

static string Divide::GFX::ToString ( const BlitRenderTargetCommand cmd,
const U16  indent 
)
static

Definition at line 446 of file Commands.cpp.

◆ ToString() [8/26]

static string Divide::GFX::ToString ( const ClearBufferDataCommand cmd,
const U16  indent 
)
static

Definition at line 493 of file Commands.cpp.

◆ ToString() [9/26]

static string Divide::GFX::ToString ( const ClearTextureCommand cmd,
const U16  indent 
)
static

Definition at line 473 of file Commands.cpp.

◆ ToString() [10/26]

static void Divide::GFX::ToString ( const CommandBase cmd,
const CommandType  type,
I32 crtIndent,
string out 
)

Definition at line 609 of file CommandBuffer.cpp.

◆ ToString() [11/26]

string Divide::GFX::ToString ( const CommandBase cmd,
const CommandType  type,
U16  indent 
)

Definition at line 498 of file Commands.cpp.

◆ ToString() [12/26]

static string Divide::GFX::ToString ( const ComputeMipMapsCommand cmd,
const U16  indent 
)
static

Definition at line 478 of file Commands.cpp.

◆ ToString() [13/26]

static string Divide::GFX::ToString ( const CopyTextureCommand cmd,
const U16  indent 
)
static

Definition at line 463 of file Commands.cpp.

◆ ToString() [14/26]

static string Divide::GFX::ToString ( const DispatchComputeCommand cmd,
U16  indent 
)
static

Definition at line 403 of file Commands.cpp.

◆ ToString() [15/26]

static string Divide::GFX::ToString ( const DrawCommand cmd,
const U16  indent 
)
static

Definition at line 187 of file Commands.cpp.

◆ ToString() [16/26]

static string Divide::GFX::ToString ( const EndGPUQueryCommand cmd,
const U16  indent 
)
static

Definition at line 441 of file Commands.cpp.

◆ ToString() [17/26]

static string Divide::GFX::ToString ( const MemoryBarrierCommand cmd,
U16  indent 
)
static

Definition at line 408 of file Commands.cpp.

◆ ToString() [18/26]

static string Divide::GFX::ToString ( const PushCameraCommand cmd,
const U16  indent 
)
static

Definition at line 483 of file Commands.cpp.

◆ ToString() [19/26]

static string Divide::GFX::ToString ( const PushViewportCommand cmd,
U16  indent 
)
static

Definition at line 207 of file Commands.cpp.

◆ ToString() [20/26]

static string Divide::GFX::ToString ( const ReadBufferDataCommand cmd,
const U16  indent 
)
static

Definition at line 488 of file Commands.cpp.

◆ ToString() [21/26]

static string Divide::GFX::ToString ( const ReadTextureCommand cmd,
const U16  indent 
)
static

Definition at line 468 of file Commands.cpp.

◆ ToString() [22/26]

static string Divide::GFX::ToString ( const SendPushConstantsCommand cmd,
U16  indent 
)
static

Definition at line 136 of file Commands.cpp.

◆ ToString() [23/26]

static string Divide::GFX::ToString ( const SetCameraCommand cmd,
U16  indent 
)
static

Definition at line 283 of file Commands.cpp.

◆ ToString() [24/26]

static string Divide::GFX::ToString ( const SetClipPlanesCommand cmd,
const U16  indent 
)
static

Definition at line 262 of file Commands.cpp.

◆ ToString() [25/26]

static string Divide::GFX::ToString ( const SetScissorCommand cmd,
U16  indent 
)
static

Definition at line 257 of file Commands.cpp.

◆ ToString() [26/26]

static string Divide::GFX::ToString ( const SetViewportCommand cmd,
U16  indent 
)
static

Definition at line 202 of file Commands.cpp.

◆ TryMergeCommands()

template<typename T = CommandBase>
requires std::is_base_of_v<CommandBase, T>
bool Divide::GFX::TryMergeCommands ( CommandType  type,
T *  prevCommand,
T *  crtCommand 
)

Definition at line 101 of file CommandBuffer.inl.

Variable Documentation

◆ g_sCommandBufferPool

CommandBufferPool* Divide::GFX::g_sCommandBufferPool = nullptr
static

Definition at line 8 of file CommandBufferPool.cpp.