-------------------------------------------------------------------------------------- Description: Adds render batches for each effect with instance data. Arguments: accumulator - batch accumulator batchType - batch rendering mode --------------------------------------------------------------------------------------
| 295 | // batchType - batch rendering mode |
| 296 | // -------------------------------------------------------------------------------------- |
| 297 | void Tr2QuadRenderer::GetBatches( TriBatchType batchType, ITriRenderBatchAccumulator* accumulator ) |
| 298 | { |
| 299 | if( m_vertexBufferOffset == -1 || !m_quadIB.IsValid() ) |
| 300 | { |
| 301 | return; |
| 302 | } |
| 303 | |
| 304 | for( auto& it : m_effects ) |
| 305 | { |
| 306 | auto& record = *it.second; |
| 307 | if( record.count && record.batchType == batchType && record.vertexDeclHandle != Tr2EffectStateManager::UNINITIALIZED_DECLARATION ) |
| 308 | { |
| 309 | Tr2RenderBatch batch; |
| 310 | batch.SetMaterial( record.effect ); |
| 311 | batch.SetGeometry( record.vertexDeclHandle, m_quad, 4, m_quadIB, m_quadIB.GetDesc().stride ); |
| 312 | batch.SetStreamSource( 1, m_vertexBuffer.GetBuffer(), record.instanceSize ); |
| 313 | batch.SetDrawIndexedInstanced( 6 * record.quadCount, record.count, 0, 0, ( m_vertexBufferOffset + record.bufferOffset ) / record.instanceSize ); |
| 314 | |
| 315 | accumulator->Commit( batch ); |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | // -------------------------------------------------------------------------------------- |
| 321 | // Description: |
nothing calls this directly
no test coverage detected