Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Graphics Debugging and Profiling

Fyrox does not have any special tools for graphics debugging and profiling yet, such tools are planned for Fyrox 2.0. For now, you can use third-party tools for this, such as RenderDoc, NVIDIA Nsight, AMD Radeon GPU Profiler, etc.

Names for Graphics Entities

The engine has an ability to assign meaningful names for entities of underlying graphical API for the ease of debugging.

fn main() {
    let executor = Executor::from_params(
        EventLoop::new().ok(),
        GraphicsContextParams {
            // This option forces the engine to use meaningful names for
            // GPU objects (textures, buffers, shaders, etc.)
            named_objects: true,
            window_attributes: WindowAttributes::default(),
            vsync: true,
            msaa_sample_count: None,
            graphics_server_constructor: Default::default(),
        },
    );
    // ...
}

Recompile your game and run a graphics debugger (RenderDoc, for instance) and you should see that now GPU entities have meaningful names:

capture

Profiling

Accurate GPU profiling is a hard task, because GPUs work independently of CPUs and any attempt to measure how much time is spent on GPU from the CPU side will only measure how much time was spent to prepare and issue commands for a GPU. That being said, profiling requires specialized tools for target GPUs. Use
NVIDIA Nsight or AMD Radeon GPU Profiler, depending on the GPU you're using. RenderDoc also has some ability to measure GPU times, but its precision is not very high.