MCPcopy Create free account
hub / github.com/carbonengine/trinity / SubmitGeometry

Function SubmitGeometry

trinity/Tr2RenderContext.cpp:83–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void SubmitGeometry( const Tr2RenderBatch& batch, Tr2RenderContext& renderContext )
84{
85 renderContext.SetTopology( batch.m_topology );
86 renderContext.m_esm.ApplyVertexDeclaration( batch.m_vertexDeclaration );
87 if( batch.m_vertexStreams[0] )
88 {
89 renderContext.m_esm.ApplyStreamSource( 0, *batch.m_vertexStreams[0], 0, batch.m_stride[0] );
90 }
91 if( batch.m_vertexStreams[1] )
92 {
93 renderContext.m_esm.ApplyStreamSource( 1, *batch.m_vertexStreams[1], 0, batch.m_stride[1] );
94 }
95 if( batch.m_indexBuffer )
96 {
97 renderContext.m_esm.ApplyIndexBuffer( *batch.m_indexBuffer, batch.m_indexStride );
98 renderContext.DrawIndexedInstanced( batch.m_indexCountPerInstance, batch.m_instanceCount, batch.m_startIndexLocation, batch.m_baseVertexLocation, batch.m_startInstanceLocation );
99 }
100 else
101 {
102 renderContext.DrawInstanced( batch.m_indexCountPerInstance, batch.m_instanceCount, batch.m_startIndexLocation, batch.m_startInstanceLocation );
103 }
104}
105
106}
107

Callers 4

RenderBatchesInOrderMethod · 0.85

Calls 6

ApplyStreamSourceMethod · 0.80
ApplyIndexBufferMethod · 0.80
SetTopologyMethod · 0.45
DrawIndexedInstancedMethod · 0.45
DrawInstancedMethod · 0.45

Tested by

no test coverage detected