Vulkan Debugging Guide

Deep dive into debugging Vulkan applications with rendara

Overview

rendara provides first-class support for Vulkan debugging through its Vulkan layer. This guide covers everything from basic frame capture to advanced pipeline analysis.

Vulkan Layer Setup

rendara installs a Vulkan layer that intercepts API calls for capture and analysis. The layer is automatically registered during installation.

Verify Layer Installation

vulkaninfo | grep rendara
# VK_LAYER_RENDARA_capture

Manual Layer Configuration

If you need to manually enable the layer:

# Linux
export VK_INSTANCE_LAYERS=VK_LAYER_RENDARA_capture
export VK_LAYER_PATH=~/.rendara/layers

# Windows (PowerShell)
$env:VK_INSTANCE_LAYERS="VK_LAYER_RENDARA_capture"
$env:VK_LAYER_PATH="$HOME\.rendara\layers"

Capturing Frames

There are several ways to capture frames from Vulkan applications:

Method 1: Launch with rendara

rendara launch ./my-vulkan-app

Press F12 to capture a frame while the application runs.

Method 2: Capture Running App

rendara capture --pid $(pgrep my-vulkan-app)

Method 3: Programmatic Capture

Use the rendara API to trigger captures from code:

// Link against rendara-capture library
#include <rendara/capture.h>

// Trigger capture
rendara_capture_frame();
Tip: Capture Specific Frames Use rendara launch --capture-frame 100 to automatically capture frame 100.

Pipeline State Inspection

rendara captures the complete Vulkan pipeline state at each draw call:

Resource Inspection

Buffers

View buffer contents as raw bytes, structured data, or interpreted vertex/index data:

rendara inspect buffer 0x1234 --format vertex --layout "vec3 pos, vec3 normal, vec2 uv"

Images

Inspect textures with full mip chain and array layer support:

Synchronization Analysis

Vulkan synchronization bugs are notoriously hard to debug. rendara helps by:

rendara analyze frame.rdc --sync-check

⚠ HAZARD: Write-after-read on VkImage 0x5678
  Write: vkCmdCopyBufferToImage (draw #45)
  Read: Fragment shader sample (draw #42)
  Missing: VK_PIPELINE_STAGE_TRANSFER_BIT → VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT
Why This Matters Sync bugs often disappear in other debuggers due to deterministic replay. rendara's static analysis catches them even when they don't visually manifest.

AI-Powered Analysis

Ask rendara questions about your Vulkan frame in natural language:

rendara ask "why is the shadow map empty?"
rendara ask "which draw call writes to the G-buffer normal attachment?"
rendara ask "what's causing the pipeline stall at draw 234?"

Common Vulkan Issues

Black Screen

Flickering

Performance Issues