24 if (vertices.GetSize() == 0 || indices.GetSize() == 0)
return h;
28 static_cast<uint32_t
>(vertices.GetSizeInBytes()),
29 vertices.GetRawData()));
33 static_cast<uint32_t
>(indices.GetByteSize()),
34 indices.GetRawData()));
36 h.
indexCount =
static_cast<uint32_t
>(indices.GetSize());
43 const void* vertexData,
45 const uint32_t* indices,
48 if (!vertexData || vertexBytes == 0 || !indices || indexCount == 0)
return h;
52 static_cast<uint32_t
>(vertexBytes),
53 const_cast<void*
>(vertexData));
54 if (vb) vb->SetVertexFormat(format);
59 static_cast<uint32_t
>(indexCount *
sizeof(uint32_t)),
60 const_cast<uint32_t*
>(indices)));
62 h.
indexCount =
static_cast<uint32_t
>(indexCount);
72 queue->SubmitBindMaterial(material);
86 queue->SubmitUpdateConstantBuffer(
static const Math::Matrix4 & GetMainProjectionMatrix()
static const Math::Matrix4 & GetMainViewMatrix()
static Matrix< float, Rows, Rows > Identity()
static void Shutdown()
Release static resources before renderer cleanup.
static MeshHandle CreateMesh(VertexGroup &vertices, IndexGroup &indices)
Create GPU vertex+index buffers from CPU mesh data.
static void EndBatch()
End the batch (currently a no-op, reserved for future use).
static void BeginBatch(Material *material)
Binds the batch material and (re)uploads the shared identity-world transform buffer once per batch.
static void Draw(const MeshHandle &mesh, bool castsShadow=true)
Submits an indexed draw for a mesh already created via CreateMesh.
static RenderCommandQueue * GetInstance()
Lazily creates and returns the process-wide singleton instance.
void SubmitDrawIndexed(RefPtr< BufferBase > vertexBuffer, RefPtr< BufferBase > indexBuffer, List< RefPtr< BufferBase > > constantBuffers, uint32_t indexCount, uint32_t startIndexLocation=0, int32_t baseVertexLocation=0, bool castsShadow=true)
Queues an indexed draw with its vertex/index buffers and constant buffers.
static BufferBase * CreateBuffer(BufferType Type, uint32_t Size, void *Data)
Creates a buffer via the currently registered backend factory.
Root namespace for everything the engine exposes.
uint32_t VertexFormatHandle
static RefPtr< RenderEngine::BufferBase > s_batchTransformBuffer
List< IndexType > IndexGroup
uint32_t vertexFormat
Registered custom vertex layout of this mesh; 0 means the engine default Vertex.
RefPtr< RenderEngine::BufferBase > vertexBuffer
RefPtr< RenderEngine::BufferBase > indexBuffer