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

Method DrawIndexedPrimitiveUP

trinityal/Tr2DrawUPHelper.cpp:188–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188ALResult Tr2DrawUPHelper::DrawIndexedPrimitiveUP(
189 Tr2RenderContextEnum::Topology topology,
190 uint32_t numVertices,
191 uint32_t primitiveCount,
192 const uint32_t* indexData,
193 const void* vertexStreamZeroData,
194 uint32_t vertexStreamZeroStride,
195 Tr2RenderContextAL& renderContext,
196 Tr2PrimaryRenderContextAL& device )
197{
198 if( primitiveCount == 0 )
199 {
200 return S_OK;
201 }
202
203 CR_RETURN_HR( FillUPVertexBuffer( numVertices,
204 vertexStreamZeroData,
205 vertexStreamZeroStride,
206 m_vertexUP[m_nextRingVB],
207 renderContext,
208 device ) );
209
210 CR_RETURN_HR( renderContext.SetStreamSource(
211 0,
212 m_vertexUP[m_nextRingVB],
213 0,
214 vertexStreamZeroStride ) );
215
216 m_nextRingVB = ( m_nextRingVB + 1 ) % DRAW_UP_RING_SIZE;
217
218 CR_RETURN_HR( FillUPIndexBuffer( ComputeVertexCount( topology, primitiveCount ),
219 indexData,
220 4,
221 m_indexUP32[m_nextRingIB32],
222 renderContext,
223 device ) );
224
225 CR_RETURN_HR( renderContext.SetIndices( m_indexUP32[m_nextRingIB32] ) );
226
227 m_nextRingIB32 = ( m_nextRingIB32 + 1 ) % DRAW_UP_RING_SIZE;
228
229 return renderContext.DrawIndexedPrimitive( numVertices, 0, primitiveCount );
230}
231
232ALResult Tr2DrawUPHelper::DrawIndexedPrimitiveUP(
233 Tr2RenderContextEnum::Topology topology,

Callers

nothing calls this directly

Calls 4

ComputeVertexCountFunction · 0.85
SetStreamSourceMethod · 0.45
SetIndicesMethod · 0.45
DrawIndexedPrimitiveMethod · 0.45

Tested by

no test coverage detected