| 1045 | } |
| 1046 | |
| 1047 | void Tr2Sprite2dScene::IssueDrawCall() |
| 1048 | { |
| 1049 | USE_MAIN_THREAD_RENDER_CONTEXT(); |
| 1050 | |
| 1051 | CCP_STATS_ZONE( __FUNCTION__ ); |
| 1052 | CCP_STATS_INC( spriteSceneDrawCallCount ); |
| 1053 | |
| 1054 | if( !m_indexCount ) |
| 1055 | { |
| 1056 | CCP_STATS_INC( spriteSceneDrawCallEmpty ); |
| 1057 | |
| 1058 | return; |
| 1059 | } |
| 1060 | |
| 1061 | bool effectOK = SelectEffect(); |
| 1062 | |
| 1063 | if( m_captureDisplayList ) |
| 1064 | { |
| 1065 | CCP_ASSERT( m_effect ); |
| 1066 | |
| 1067 | if( effectOK ) |
| 1068 | { |
| 1069 | renderContext.AddGpuMarker( "Tr2Sprite2dScene::IssueDrawCall Captured" ); |
| 1070 | |
| 1071 | Tr2Sprite2dDisplayList::Entry entry; |
| 1072 | |
| 1073 | entry.job = nullptr; |
| 1074 | |
| 1075 | memcpy( entry.transformArray, m_transformArray, sizeof( m_transformArray ) ); |
| 1076 | |
| 1077 | entry.numVertices = m_captureVertexDataSize; |
| 1078 | entry.primitiveCount = m_indexCount / 3; |
| 1079 | entry.startIndex = m_captureStartIndex; |
| 1080 | entry.texture0 = m_texture[0]; |
| 1081 | entry.texture1 = m_texture[1]; |
| 1082 | entry.effect = m_effect; |
| 1083 | m_texelSizeVar[0].GetValue( entry.texelSize0 ); |
| 1084 | m_texelSizeVar[1].GetValue( entry.texelSize1 ); |
| 1085 | |
| 1086 | //entry.vsConstantTable = m_vsConstantTable; |
| 1087 | //entry.transformsHandle = m_transformsHandle; |
| 1088 | entry.m_uiTransformsCb = &m_uiTransformsCb; |
| 1089 | |
| 1090 | m_captureDisplayList->entries.push_back( entry ); |
| 1091 | } |
| 1092 | |
| 1093 | m_vertexCount = 0; |
| 1094 | m_indexCount = 0; |
| 1095 | m_transformCurrent = 0; |
| 1096 | |
| 1097 | m_captureStartIndex = m_captureIndexDataSize; |
| 1098 | return; |
| 1099 | } |
| 1100 | |
| 1101 | ++m_drawCallsRendered; |
| 1102 | |
| 1103 | if( effectOK && ( m_drawCallsRendered < m_maxDrawCallsToRender ) ) |
| 1104 | { |
nothing calls this directly
no test coverage detected