Batch calls to GetPostVSBuffers to work around Android being awful

* On Android the end-to-end latency of a single call is large enough that doing
  a call per-instance in a draw with a high number of instances is a real
  problem
This commit is contained in:
baldurk
2024-02-23 15:00:28 +00:00
parent 36f4432351
commit ec17ee5999
8 changed files with 131 additions and 71 deletions
+13 -10
View File
@@ -1092,18 +1092,20 @@ void ReplayProxy::InitPostVSBuffers(const rdcarray<uint32_t> &events)
}
template <typename ParamSerialiser, typename ReturnSerialiser>
MeshFormat ReplayProxy::Proxied_GetPostVSBuffers(ParamSerialiser &paramser, ReturnSerialiser &retser,
uint32_t eventId, uint32_t instID, uint32_t viewID,
MeshDataStage stage)
rdcarray<MeshFormat> ReplayProxy::Proxied_GetBatchPostVSBuffers(ParamSerialiser &paramser,
ReturnSerialiser &retser,
uint32_t eventId,
const rdcarray<uint32_t> &instIDs,
uint32_t viewID, MeshDataStage stage)
{
const ReplayProxyPacket expectedPacket = eReplayProxy_GetPostVS;
ReplayProxyPacket packet = eReplayProxy_GetPostVS;
MeshFormat ret = {};
rdcarray<MeshFormat> ret = {};
{
BEGIN_PARAMS();
SERIALISE_ELEMENT(eventId);
SERIALISE_ELEMENT(instID);
SERIALISE_ELEMENT(instIDs);
SERIALISE_ELEMENT(viewID);
SERIALISE_ELEMENT(stage);
END_PARAMS();
@@ -1112,7 +1114,7 @@ MeshFormat ReplayProxy::Proxied_GetPostVSBuffers(ParamSerialiser &paramser, Retu
{
REMOTE_EXECUTION();
if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored)
ret = m_Remote->GetPostVSBuffers(eventId, instID, viewID, stage);
ret = m_Remote->GetBatchPostVSBuffers(eventId, instIDs, viewID, stage);
}
SERIALISE_RETURN(ret);
@@ -1120,10 +1122,11 @@ MeshFormat ReplayProxy::Proxied_GetPostVSBuffers(ParamSerialiser &paramser, Retu
return ret;
}
MeshFormat ReplayProxy::GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint32_t viewID,
MeshDataStage stage)
rdcarray<MeshFormat> ReplayProxy::GetBatchPostVSBuffers(uint32_t eventId,
const rdcarray<uint32_t> &instIDs,
uint32_t viewID, MeshDataStage stage)
{
PROXY_FUNCTION(GetPostVSBuffers, eventId, instID, viewID, stage);
PROXY_FUNCTION(GetBatchPostVSBuffers, eventId, instIDs, viewID, stage);
}
template <typename ParamSerialiser, typename ReturnSerialiser>
@@ -2932,7 +2935,7 @@ bool ReplayProxy::Tick(int type)
InitPostVSBuffers(dummy);
break;
}
case eReplayProxy_GetPostVS: GetPostVSBuffers(0, 0, 0, MeshDataStage::VSIn); break;
case eReplayProxy_GetPostVS: GetBatchPostVSBuffers(0, {}, 0, MeshDataStage::VSIn); break;
case eReplayProxy_BuildTargetShader:
{
rdcstr entry;
+8 -2
View File
@@ -504,8 +504,14 @@ public:
IMPLEMENT_FUNCTION_PROXIED(void, InitPostVSBuffers, uint32_t eventId);
IMPLEMENT_FUNCTION_PROXIED(void, InitPostVSBuffers, const rdcarray<uint32_t> &passEvents);
IMPLEMENT_FUNCTION_PROXIED(MeshFormat, GetPostVSBuffers, uint32_t eventId, uint32_t instID,
uint32_t viewID, MeshDataStage stage);
IMPLEMENT_FUNCTION_PROXIED(rdcarray<MeshFormat>, GetBatchPostVSBuffers, uint32_t eventId,
const rdcarray<uint32_t> &instIDs, uint32_t viewID, MeshDataStage stage);
// if this gets called individually, just forward to the batch implementation for simplicity
MeshFormat GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint32_t viewID, MeshDataStage stage)
{
return GetBatchPostVSBuffers(eventId, {instID}, viewID, stage)[0];
}
IMPLEMENT_FUNCTION_PROXIED(ResourceId, RenderOverlay, ResourceId texid, FloatVector clearCol,
DebugOverlay overlay, uint32_t eventId,