File: renderdoc_api.hh

package info (click to toggle)
blender 4.3.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 309,564 kB
  • sloc: cpp: 2,385,210; python: 330,236; ansic: 280,972; xml: 2,446; sh: 972; javascript: 317; makefile: 170
file content (48 lines) | stat: -rw-r--r-- 1,260 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* SPDX-FileCopyrightText: 2023 Blender Authors
 *
 * SPDX-License-Identifier: GPL-2.0-or-later */

#pragma once

#include "renderdoc_app.h"

namespace renderdoc::api {
class Renderdoc {
 private:
  enum class State {
    /**
     * Initial state of the API indicating that the API hasn't checked if it can find renderdoc.
     */
    UNINITIALIZED,

    /**
     * API has looked for renderdoc, but couldn't find it. This indicates that renderdoc isn't
     * available on the platform, or wasn't registered correctly.
     */
    NOT_FOUND,

    /**
     * API has loaded the symbols of renderdoc.
     */
    LOADED,
  };
  State state_ = State::UNINITIALIZED;
  RENDERDOC_API_1_6_0 *renderdoc_api_ = nullptr;

 public:
  bool start_frame_capture(RENDERDOC_DevicePointer device_handle,
                           RENDERDOC_WindowHandle window_handle);
  void end_frame_capture(RENDERDOC_DevicePointer device_handle,
                         RENDERDOC_WindowHandle window_handle);
  void set_frame_capture_title(const char *capture_title);

 private:
  /**
   * Check if renderdoc has been loaded.
   *
   * When not loaded it tries to load the API, but only tries to do it once.
   */
  bool check_loaded();
  void load();
};
}  // namespace renderdoc::api