mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-04 03:17:58 +00:00
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:
@@ -1092,18 +1092,20 @@ void ReplayProxy::InitPostVSBuffers(const rdcarray<uint32_t> &events)
|
||||
}
|
||||
|
||||
template <typename ParamSerialiser, typename ReturnSerialiser>
|
||||
MeshFormat ReplayProxy::Proxied_GetPostVSBuffers(ParamSerialiser ¶mser, ReturnSerialiser &retser,
|
||||
uint32_t eventId, uint32_t instID, uint32_t viewID,
|
||||
MeshDataStage stage)
|
||||
rdcarray<MeshFormat> ReplayProxy::Proxied_GetBatchPostVSBuffers(ParamSerialiser ¶mser,
|
||||
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 ¶mser, 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 ¶mser, 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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user