How to get started writing a low-level GPU profiler? I have been studying hardware corporation GPU profilers in recent days (Qualcomm, PowerVR, Intel).  I've noticed that these tools seem to give more low-level details  than the GPU profilers I have used in the past -- XCode's OpenGL ES frame capture and apitrace -- which only listed which OpenGL calls were made and what the state of current resources are.

How do I get started if I want to make a low-level tool that displays things like sampler cache misses and shader assembler code?
For basic GPU timing data, you can use D3D timestamp queries or the equivalent OpenGL timer queries.

Any low-level hardware data like cache misses is going to be extremely vendor-specific. Each GPU vendor has its own custom API or extension for giving access to low-level performance data on its hardware. The APIs vary in how they work, and they don't necessarily all expose the same details. The available data may also vary between different chip models within the same vendor, so you probably need to know a bit about how the hardware works to make sense of it.

Here are links to the relevant APIs for most of the main GPU vendors.


AMD: GPUPerfAPI; see also AMD_performance_monitor 
Intel: Performance Counter Monitor (note: it's not clear to me whether this includes access to GPU counters, or only CPU ones); see also  INTEL_performance_query
NVIDIA: PerfKit
PowerVR: PVRScope
Qualcomm: QCOM_performance_monitor_global_mode