| 81 | } |
| 82 | |
| 83 | void 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 |
no test coverage detected