Add **GPU profiling support to Tracy integration**
This commit is contained in:
@@ -69,6 +69,10 @@ void GPUContext::FrameEnd()
|
||||
FlushState();
|
||||
}
|
||||
|
||||
void GPUContext::OnPresent()
|
||||
{
|
||||
}
|
||||
|
||||
void GPUContext::BindSR(int32 slot, GPUTexture* t)
|
||||
{
|
||||
ASSERT_LOW_LAYER(t == nullptr || t->ResidentMipLevels() == 0 || t->IsShaderResource());
|
||||
|
||||
@@ -148,6 +148,11 @@ public:
|
||||
/// </summary>
|
||||
virtual void FrameEnd();
|
||||
|
||||
/// <summary>
|
||||
/// Called after performing final swapchain presentation and submitting all GPU commands.
|
||||
/// </summary>
|
||||
virtual void OnPresent();
|
||||
|
||||
public:
|
||||
#if GPU_ALLOW_PROFILE_EVENTS
|
||||
/// <summary>
|
||||
|
||||
@@ -646,6 +646,7 @@ void GPUDevice::DrawEnd()
|
||||
const double presentEnd = Platform::GetTimeSeconds();
|
||||
ProfilerGPU::OnPresentTime((float)((presentEnd - presentStart) * 1000.0));
|
||||
#endif
|
||||
GetMainContext()->OnPresent();
|
||||
|
||||
_wasVSyncUsed = anyVSync;
|
||||
_isRendering = false;
|
||||
|
||||
@@ -20,6 +20,12 @@ public abstract class GraphicsDeviceBaseModule : EngineModule
|
||||
// Enables GPU diagnostic tools (debug layer etc.)
|
||||
options.PublicDefinitions.Add("GPU_ENABLE_DIAGNOSTICS");
|
||||
}
|
||||
|
||||
if (Profiler.Use(options) && tracy.GPU && true)
|
||||
{
|
||||
// Enables GPU profiling with Tracy
|
||||
options.PrivateDefinitions.Add("GPU_ENABLE_TRACY");
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user