Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::IMPrimitive Class Referencefinal

IMPrimitive replaces immediate mode calls to VB based rendering. More...

#include <IMPrimitive.h>

Public Member Functions

 IMPrimitive (GFXDevice &context, const Str< 64 > &name)
 
 ~IMPrimitive ()=default
 
void setPushConstants (const PushConstantsStruct &fastData)
 
void setUniformData (const UniformData &constants)
 
void setUniformDataAndConstants (const UniformData &constants, const PushConstantsStruct &fastData)
 
void setPipelineDescriptor (const PipelineDescriptor &descriptor)
 
void setTexture (const ImageView &texture, SamplerDescriptor sampler)
 
void begin (PrimitiveTopology type)
 
void end ()
 
void beginBatch (bool reserveBuffers, U32 vertexCount, U32 attributeCount)
 
void endBatch () noexcept
 
void clearBatch ()
 
bool hasBatch () const noexcept
 
void reset ()
 
void vertex (F32 x, F32 y, F32 z)
 
void attribute1i (U32 attribLocation, I32 value)
 
void attribute1f (U32 attribLocation, F32 value)
 
void attribute2f (U32 attribLocation, vec2< F32 > value)
 
void attribute3f (U32 attribLocation, vec3< F32 > value)
 
void attribute4ub (U32 attribLocation, U8 x, U8 y, U8 z, U8 w)
 
void attribute4f (U32 attribLocation, F32 x, F32 y, F32 z, F32 w)
 
void vertex (const vec3< F32 > &vert)
 
void attribute4ub (const U32 attribLocation, const vec4< U8 > value)
 
void attribute4f (const U32 attribLocation, const vec4< F32 > &value)
 
void fromLines (const IM::LineDescriptor &lines)
 
void fromLines (const IM::LineDescriptor *lines, size_t count)
 
void fromFrustum (const IM::FrustumDescriptor &frustum)
 
void fromFrustums (const IM::FrustumDescriptor *frustums, size_t count)
 
void fromOBB (const IM::OBBDescriptor &box)
 
void fromOBBs (const IM::OBBDescriptor *boxes, size_t count)
 
void fromBox (const IM::BoxDescriptor &box)
 
void fromBoxes (const IM::BoxDescriptor *boxes, size_t count)
 
void fromSphere (const IM::SphereDescriptor &sphere)
 
void fromSpheres (const IM::SphereDescriptor *spheres, size_t count)
 
void fromCone (const IM::ConeDescriptor &cone)
 
void fromCones (const IM::ConeDescriptor *cones, size_t count)
 
void fromLines (const Line *lines, size_t count)
 
template<size_t N>
void fromLines (const std::array< IM::LineDescriptor, N > &lines)
 
template<size_t N>
void fromOBBs (const std::array< IM::OBBDescriptor, N > &obbs)
 
template<size_t N>
void fromBoxes (const std::array< IM::BoxDescriptor, N > &boxes)
 
template<size_t N>
void fromSpheres (const std::array< IM::SphereDescriptor, N > &spheres)
 
template<size_t N>
void fromCones (const std::array< IM::ConeDescriptor, N > &cones)
 
void getCommandBuffer (GFX::CommandBuffer &commandBufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
 
void getCommandBuffer (const mat4< F32 > &worldMatrix, GFX::CommandBuffer &commandBufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
 
 PROPERTY_R (Str< 64 >, name)
 
 PROPERTY_RW (bool, forceWireframe, false)
 

Static Public Member Functions

static void InitStaticData ()
 

Protected Member Functions

GFXDevicecontext () noexcept
 

Private Member Functions

void fromLinesInternal (const Line *lines, size_t count)
 

Private Attributes

GFXDevice_context
 
UniformData _additionalUniforms
 
PushConstantsStruct _fastData
 
NS_GLIM::GLIM_BATCH_uptr _imInterface
 
PipelineDescriptor _basePipelineDescriptor {}
 
ImageView _texture {}
 
SamplerDescriptor _sampler {}
 
std::array< bool, to_base(NS_GLIM::GLIM_BUFFER_TYPE::COUNT)> _drawFlags
 
std::array< size_t, to_base(NS_GLIM::GLIM_BUFFER_TYPE::COUNT)> _indexCount
 
std::array< Pipeline *, to_base(NS_GLIM::GLIM_BUFFER_TYPE::COUNT)> _pipelines
 
std::array< U8, to_base(NS_GLIM::GLIM_BUFFER_TYPE::COUNT)> _indexBufferId
 
GenericVertexData_ptr _dataBuffer = nullptr
 
GFX::MemoryBarrierCommand _memCmd {}
 

Friends

template<typename Data , size_t N>
struct DebugPrimitiveHandler
 
void DestroyIMP (IMPrimitive *&)
 

Detailed Description

IMPrimitive replaces immediate mode calls to VB based rendering.

Definition at line 58 of file IMPrimitive.h.

Constructor & Destructor Documentation

◆ IMPrimitive()

Divide::IMPrimitive::IMPrimitive ( GFXDevice context,
const Str< 64 > &  name 
)

Definition at line 65 of file IMPrimitive.cpp.

◆ ~IMPrimitive()

Divide::IMPrimitive::~IMPrimitive ( )
default

Member Function Documentation

◆ attribute1f()

void Divide::IMPrimitive::attribute1f ( U32  attribLocation,
F32  value 
)

Definition at line 116 of file IMPrimitive.cpp.

◆ attribute1i()

void Divide::IMPrimitive::attribute1i ( U32  attribLocation,
I32  value 
)

Definition at line 162 of file IMPrimitive.cpp.

◆ attribute2f()

void Divide::IMPrimitive::attribute2f ( U32  attribLocation,
vec2< F32 value 
)

Definition at line 126 of file IMPrimitive.cpp.

◆ attribute3f()

void Divide::IMPrimitive::attribute3f ( U32  attribLocation,
vec3< F32 value 
)

Definition at line 135 of file IMPrimitive.cpp.

◆ attribute4f() [1/2]

void Divide::IMPrimitive::attribute4f ( const U32  attribLocation,
const vec4< F32 > &  value 
)
inline

Definition at line 94 of file IMPrimitive.h.

◆ attribute4f() [2/2]

void Divide::IMPrimitive::attribute4f ( U32  attribLocation,
F32  x,
F32  y,
F32  z,
F32  w 
)

Definition at line 153 of file IMPrimitive.cpp.

◆ attribute4ub() [1/2]

void Divide::IMPrimitive::attribute4ub ( const U32  attribLocation,
const vec4< U8 value 
)
inline

Definition at line 93 of file IMPrimitive.h.

◆ attribute4ub() [2/2]

void Divide::IMPrimitive::attribute4ub ( U32  attribLocation,
U8  x,
U8  y,
U8  z,
U8  w 
)

Definition at line 144 of file IMPrimitive.cpp.

◆ begin()

void Divide::IMPrimitive::begin ( PrimitiveTopology  type)

Definition at line 108 of file IMPrimitive.cpp.

◆ beginBatch()

void Divide::IMPrimitive::beginBatch ( bool  reserveBuffers,
U32  vertexCount,
U32  attributeCount 
)

Definition at line 96 of file IMPrimitive.cpp.

◆ clearBatch()

void Divide::IMPrimitive::clearBatch ( )

Definition at line 100 of file IMPrimitive.cpp.

◆ context()

GFXDevice & Divide::IMPrimitive::context ( )
inlineprotectednoexcept

Definition at line 135 of file IMPrimitive.h.

◆ end()

void Divide::IMPrimitive::end ( )

Definition at line 171 of file IMPrimitive.cpp.

◆ endBatch()

void Divide::IMPrimitive::endBatch ( )
noexcept

Definition at line 175 of file IMPrimitive.cpp.

◆ fromBox()

void Divide::IMPrimitive::fromBox ( const IM::BoxDescriptor box)

Definition at line 413 of file IMPrimitive.cpp.

◆ fromBoxes() [1/2]

void Divide::IMPrimitive::fromBoxes ( const IM::BoxDescriptor boxes,
size_t  count 
)

Definition at line 417 of file IMPrimitive.cpp.

◆ fromBoxes() [2/2]

template<size_t N>
void Divide::IMPrimitive::fromBoxes ( const std::array< IM::BoxDescriptor, N > &  boxes)
inline

Definition at line 118 of file IMPrimitive.h.

◆ fromCone()

void Divide::IMPrimitive::fromCone ( const IM::ConeDescriptor cone)

Definition at line 525 of file IMPrimitive.cpp.

◆ fromCones() [1/2]

void Divide::IMPrimitive::fromCones ( const IM::ConeDescriptor cones,
size_t  count 
)

Definition at line 529 of file IMPrimitive.cpp.

◆ fromCones() [2/2]

template<size_t N>
void Divide::IMPrimitive::fromCones ( const std::array< IM::ConeDescriptor, N > &  cones)
inline

Definition at line 122 of file IMPrimitive.h.

◆ fromFrustum()

void Divide::IMPrimitive::fromFrustum ( const IM::FrustumDescriptor frustum)

Definition at line 287 of file IMPrimitive.cpp.

◆ fromFrustums()

void Divide::IMPrimitive::fromFrustums ( const IM::FrustumDescriptor frustums,
size_t  count 
)

Definition at line 291 of file IMPrimitive.cpp.

◆ fromLines() [1/4]

void Divide::IMPrimitive::fromLines ( const IM::LineDescriptor lines)

Definition at line 278 of file IMPrimitive.cpp.

◆ fromLines() [2/4]

void Divide::IMPrimitive::fromLines ( const IM::LineDescriptor lines,
size_t  count 
)

Definition at line 282 of file IMPrimitive.cpp.

◆ fromLines() [3/4]

void Divide::IMPrimitive::fromLines ( const Line lines,
size_t  count 
)

Definition at line 575 of file IMPrimitive.cpp.

◆ fromLines() [4/4]

template<size_t N>
void Divide::IMPrimitive::fromLines ( const std::array< IM::LineDescriptor, N > &  lines)
inline

Definition at line 114 of file IMPrimitive.h.

◆ fromLinesInternal()

void Divide::IMPrimitive::fromLinesInternal ( const Line lines,
size_t  count 
)
private

Definition at line 589 of file IMPrimitive.cpp.

◆ fromOBB()

void Divide::IMPrimitive::fromOBB ( const IM::OBBDescriptor box)

Definition at line 385 of file IMPrimitive.cpp.

◆ fromOBBs() [1/2]

void Divide::IMPrimitive::fromOBBs ( const IM::OBBDescriptor boxes,
size_t  count 
)

Definition at line 389 of file IMPrimitive.cpp.

◆ fromOBBs() [2/2]

template<size_t N>
void Divide::IMPrimitive::fromOBBs ( const std::array< IM::OBBDescriptor, N > &  obbs)
inline

Definition at line 116 of file IMPrimitive.h.

◆ fromSphere()

void Divide::IMPrimitive::fromSphere ( const IM::SphereDescriptor sphere)

Definition at line 465 of file IMPrimitive.cpp.

◆ fromSpheres() [1/2]

void Divide::IMPrimitive::fromSpheres ( const IM::SphereDescriptor spheres,
size_t  count 
)

Definition at line 469 of file IMPrimitive.cpp.

◆ fromSpheres() [2/2]

template<size_t N>
void Divide::IMPrimitive::fromSpheres ( const std::array< IM::SphereDescriptor, N > &  spheres)
inline

Definition at line 120 of file IMPrimitive.h.

◆ getCommandBuffer() [1/2]

void Divide::IMPrimitive::getCommandBuffer ( const mat4< F32 > &  worldMatrix,
GFX::CommandBuffer commandBufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)

Definition at line 648 of file IMPrimitive.cpp.

◆ getCommandBuffer() [2/2]

void Divide::IMPrimitive::getCommandBuffer ( GFX::CommandBuffer commandBufferInOut,
GFX::MemoryBarrierCommand memCmdInOut 
)

Definition at line 643 of file IMPrimitive.cpp.

◆ hasBatch()

bool Divide::IMPrimitive::hasBatch ( ) const
noexcept

Definition at line 104 of file IMPrimitive.cpp.

◆ InitStaticData()

void Divide::IMPrimitive::InitStaticData ( )
static

Definition at line 55 of file IMPrimitive.cpp.

◆ PROPERTY_R()

Divide::IMPrimitive::PROPERTY_R ( Str< 64 >  ,
name   
)

◆ PROPERTY_RW()

Divide::IMPrimitive::PROPERTY_RW ( bool  ,
forceWireframe  ,
false   
)

◆ reset()

void Divide::IMPrimitive::reset ( )

Definition at line 76 of file IMPrimitive.cpp.

◆ setPipelineDescriptor()

void Divide::IMPrimitive::setPipelineDescriptor ( const PipelineDescriptor descriptor)

Definition at line 629 of file IMPrimitive.cpp.

◆ setPushConstants()

void Divide::IMPrimitive::setPushConstants ( const PushConstantsStruct fastData)

Definition at line 613 of file IMPrimitive.cpp.

◆ setTexture()

void Divide::IMPrimitive::setTexture ( const ImageView texture,
SamplerDescriptor  sampler 
)

Definition at line 637 of file IMPrimitive.cpp.

◆ setUniformData()

void Divide::IMPrimitive::setUniformData ( const UniformData constants)

Definition at line 618 of file IMPrimitive.cpp.

◆ setUniformDataAndConstants()

void Divide::IMPrimitive::setUniformDataAndConstants ( const UniformData constants,
const PushConstantsStruct fastData 
)

Definition at line 623 of file IMPrimitive.cpp.

◆ vertex() [1/2]

void Divide::IMPrimitive::vertex ( const vec3< F32 > &  vert)
inline

Definition at line 92 of file IMPrimitive.h.

◆ vertex() [2/2]

void Divide::IMPrimitive::vertex ( F32  x,
F32  y,
F32  z 
)

Definition at line 112 of file IMPrimitive.cpp.

Friends And Related Function Documentation

◆ DebugPrimitiveHandler

template<typename Data , size_t N>
friend struct DebugPrimitiveHandler
friend

Definition at line 132 of file IMPrimitive.h.

◆ DestroyIMP

void DestroyIMP ( IMPrimitive *&  )
friend

Definition at line 3092 of file GFXDevice.cpp.

Member Data Documentation

◆ _additionalUniforms

UniformData Divide::IMPrimitive::_additionalUniforms
private

Definition at line 142 of file IMPrimitive.h.

◆ _basePipelineDescriptor

PipelineDescriptor Divide::IMPrimitive::_basePipelineDescriptor {}
private

Definition at line 145 of file IMPrimitive.h.

◆ _context

GFXDevice& Divide::IMPrimitive::_context
private

Definition at line 141 of file IMPrimitive.h.

◆ _dataBuffer

GenericVertexData_ptr Divide::IMPrimitive::_dataBuffer = nullptr
private

Definition at line 152 of file IMPrimitive.h.

◆ _drawFlags

std::array<bool, to_base(NS_GLIM::GLIM_BUFFER_TYPE::COUNT)> Divide::IMPrimitive::_drawFlags
private

Definition at line 148 of file IMPrimitive.h.

◆ _fastData

PushConstantsStruct Divide::IMPrimitive::_fastData
private

Definition at line 143 of file IMPrimitive.h.

◆ _imInterface

NS_GLIM::GLIM_BATCH_uptr Divide::IMPrimitive::_imInterface
private

Definition at line 144 of file IMPrimitive.h.

◆ _indexBufferId

std::array<U8, to_base(NS_GLIM::GLIM_BUFFER_TYPE::COUNT)> Divide::IMPrimitive::_indexBufferId
private

Definition at line 151 of file IMPrimitive.h.

◆ _indexCount

std::array<size_t, to_base(NS_GLIM::GLIM_BUFFER_TYPE::COUNT)> Divide::IMPrimitive::_indexCount
private

Definition at line 149 of file IMPrimitive.h.

◆ _memCmd

GFX::MemoryBarrierCommand Divide::IMPrimitive::_memCmd {}
private

Definition at line 154 of file IMPrimitive.h.

◆ _pipelines

std::array<Pipeline*, to_base(NS_GLIM::GLIM_BUFFER_TYPE::COUNT)> Divide::IMPrimitive::_pipelines
private

Definition at line 150 of file IMPrimitive.h.

◆ _sampler

SamplerDescriptor Divide::IMPrimitive::_sampler {}
private

Definition at line 147 of file IMPrimitive.h.

◆ _texture

ImageView Divide::IMPrimitive::_texture {}
private

Definition at line 146 of file IMPrimitive.h.


The documentation for this class was generated from the following files: