GPU: Renderdoc Frame Capturing #105921

Merged
Clément Foucault merged 7 commits from Jeroen-Bakker/blender:gpu-renderdoc into main 2023-03-23 16:38:04 +01:00
Member

This PR uses renderdoc for frame capturing when enabled.
It enabled an easier workflow for frame capturing.

  • Capture GPU API calls from test cases
  • Capture GPU API calls from background threads
  • Capture GPU API calls from background rendering.

Renderdoc is an important GPU debugger used by the Eevee/
Viewport module. Previously we needed to change code in
order to record background rendering, that could on its own
lead to other side-effects.

The integration with renderdoc can be enabled using
WITH_RENDERDOC=On compiler option. GPU_debug_capture_begin
and GPU_debug_capture_end can be added to the section
of the code you want to debug. When running Blender inside
renderdoc this part will automatically be captured.

All GPU test cases are now guarded by these calls. In order
to capture the test cases you need to start the test cases
from renderdoc and the captured GPU API calls will appear
where each capture is a single test case.
image

image

TODO

  • Check if it compiles/works using windows. Linux has been tested. Apple compiles, but is expected not to work.
  • Check if the recorded data is correct. I have a suspicion that the displayed data isn't correct.
This PR uses renderdoc for frame capturing when enabled. It enabled an easier workflow for frame capturing. - Capture GPU API calls from test cases - Capture GPU API calls from background threads - Capture GPU API calls from background rendering. Renderdoc is an important GPU debugger used by the Eevee/ Viewport module. Previously we needed to change code in order to record background rendering, that could on its own lead to other side-effects. The integration with renderdoc can be enabled using `WITH_RENDERDOC=On` compiler option. `GPU_debug_capture_begin` and `GPU_debug_capture_end` can be added to the section of the code you want to debug. When running Blender inside renderdoc this part will automatically be captured. All GPU test cases are now guarded by these calls. In order to capture the test cases you need to start the test cases from renderdoc and the captured GPU API calls will appear where each capture is a single test case. ![image](/attachments/b0a4cdcc-86ba-4581-a372-3795b939e4aa) ![image](/attachments/19d07f49-1008-42bf-90bc-8596e56394f0) **TODO** - [x] Check if it compiles/works using windows. Linux has been tested. Apple compiles, but is expected not to work. - [ ] Check if the recorded data is correct. I have a suspicion that the displayed data isn't correct.
Jeroen Bakker added this to the 3.6 LTS milestone 2023-03-20 14:57:08 +01:00
Jeroen Bakker added the
Interest
OpenGL
Interest
Vulkan
labels 2023-03-20 14:57:08 +01:00
Jeroen Bakker self-assigned this 2023-03-20 14:57:09 +01:00
Jeroen Bakker added 2 commits 2023-03-20 14:57:13 +01:00
Jeroen Bakker added this to the EEVEE & Viewport project 2023-03-20 14:57:23 +01:00
Jeroen Bakker added 1 commit 2023-03-20 15:29:28 +01:00
Jeroen Bakker added 1 commit 2023-03-20 16:02:00 +01:00
Jeroen Bakker requested review from Clément Foucault 2023-03-20 16:08:09 +01:00
Jeroen Bakker changed title from WIP: GPU: Renderdoc Frame Capturing to GPU: Renderdoc Frame Capturing 2023-03-20 16:08:18 +01:00
Jeroen Bakker requested review from Miguel Pozo 2023-03-20 16:08:28 +01:00
Jeroen Bakker added 1 commit 2023-03-21 11:38:35 +01:00
Miguel Pozo requested changes 2023-03-21 13:57:56 +01:00
Miguel Pozo left a comment
Member

Aside from the Windows compilation issue, it seems to be working fine here. 😃

imagen

Aside from the Windows compilation issue, it seems to be working fine here. 😃 ![imagen](/attachments/7f6af2e0-e320-47e8-8cce-c3663026c469)
215 KiB
@ -0,0 +3,4 @@
#include "renderdoc_api.hh"
#ifdef _WIN32
Member

This should include the Windows header, otherwise it fails to compile.

#ifdef _WIN32
#  define WIN32_LEAN_AND_MEAN
#  include <Windows.h>
#else
This should include the Windows header, otherwise it fails to compile. ``` #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include <Windows.h> #else ```
Jeroen-Bakker marked this conversation as resolved
@ -384,2 +385,3 @@
{
return false;
GLBackend::get()->debug_capture_begin();
return true;
Member

Why return a bool if it always return true?
Shouldn't this only return true if the function actually succeeded (ie. the RenderDoc API is actually loaded)?

Why return a bool if it always return true? Shouldn't this only return true if the function actually succeeded (ie. the RenderDoc API is actually loaded)?
Jeroen-Bakker marked this conversation as resolved
Jeroen Bakker added 1 commit 2023-03-21 15:50:51 +01:00
Miguel Pozo approved these changes 2023-03-21 16:16:39 +01:00
Jeroen Bakker added a new dependency 2023-03-23 08:25:02 +01:00
Jeroen Bakker added a new dependency 2023-03-23 14:45:21 +01:00
Clément Foucault approved these changes 2023-03-23 16:27:42 +01:00
Clément Foucault added 1 commit 2023-03-23 16:36:38 +01:00
Clément Foucault merged commit fda65ad5ca into main 2023-03-23 16:38:04 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: blender/blender#105921
No description provided.