Perfetto

35 views
Skip to first unread message

Romaric Jodin

unread,
Oct 26, 2023, 9:29:24 AM10/26/23
to Dawn Graphics
Hi everyone,

I would like to be able to get perfetto tracepoint out of dawn.
Is this something already implemented? I don't see them in my trace, what should be required to have them? Something in the build configuration, or the perfetto config file?

Thanks,
Romaric

Austin Eng

unread,
Oct 26, 2023, 11:08:35 AM10/26/23
to Romaric Jodin, Dawn Graphics
To get tracing from Dawn, you need to implement dawn::platform::Platform and override GetCategoriyTraceEnabledFlag, AddTraceEvent, and MonotonicallyIncreasingTime. Then you can send them to perfetto in your implementation of AddTraceEvent. You'll pass that Platform object in when you create the wgpu::Instance.

Here is how Chrome does it, using this implementation of dawn::platform::Platform.
Something like:

dawn::platform::Platform* platform = new MyPlatform();

dawn::native::DawnInstanceDescriptor dawn_instance_desc;
dawn_instance_desc.platform = platform;

wgpu::InstanceDescriptor instance_desc;
instance_desc.nextInChain = &dawn_instance_desc;

wgpu::Instance instance = CreateInstance(&instance_desc);

Cheers,
Austin

--
You received this message because you are subscribed to the Google Groups "Dawn Graphics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dawn-graphic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dawn-graphics/e3325883-ae15-497c-9956-44e9ca020f66n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages