Skip to content

Commit ede1f0e

Browse files
committed
Complete replay API bindings, clean up workspace
1 parent a1a6718 commit ede1f0e

13 files changed

+223
-227
lines changed

renderdoc_sys/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fn main() {
1010
let app = bindgen::Builder::default()
1111
.header("renderdoc/renderdoc/api/app/renderdoc_app.h")
1212
.whitelist_type("RENDERDOC_.*")
13+
.blacklist_type("__.*")
1314
.generate()
1415
.expect("Unable to generate app bindings!");
1516

@@ -39,14 +40,14 @@ fn main() {
3940
.whitelist_type("GlobalEnvironment")
4041
.whitelist_type("PathEntry")
4142
.whitelist_type("pRENDERDOC_.*")
42-
.whitelist_type("ReplayStatus")
4343
.whitelist_type("Shader.*")
4444
.whitelist_type("Texture.*")
4545
.whitelist_type("Window.*")
4646
.whitelist_type("XCBWindowData")
4747
.whitelist_type("XlibWindowData")
4848
.blacklist_type(".*IterContainer_.*")
4949
// Custom wrapper types.
50+
.whitelist_function("RENDERDOC::.*")
5051
.whitelist_type("Camera")
5152
.whitelist_type("CaptureFile")
5253
.whitelist_type("RemoteServer")
@@ -65,6 +66,7 @@ fn main() {
6566
cc::Build::new()
6667
.include("replay")
6768
.include("renderdoc")
69+
.file("replay/src/Api.cpp")
6870
.file("replay/src/Camera.cpp")
6971
.file("replay/src/CaptureFile.cpp")
7072
.file("replay/src/RemoteServer.cpp")

renderdoc_sys/replay/include/Api.h

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#ifndef EXTERN_H
2+
#define EXTERN_H
3+
4+
#include <cstdint>
5+
6+
#include "../../renderdoc/renderdoc/api/replay/replay_enums.h"
7+
8+
class Camera;
9+
class CaptureFile;
10+
struct CaptureOptions;
11+
struct EnvironmentModification;
12+
class RemoteServer;
13+
class TargetControl;
14+
15+
typedef uint32_t bool32;
16+
17+
namespace RENDERDOC {
18+
Camera *InitCamera(CameraType type);
19+
20+
CaptureFile *OpenCaptureFile(const char *logfile);
21+
22+
TargetControl *CreateTargetControl(const char *host, uint32_t ident,
23+
const char *clientName,
24+
bool32 forceConnection);
25+
26+
ReplayStatus CreateRemoteServerConnection(const char *host, uint32_t port,
27+
RemoteServer **rend);
28+
}
29+
30+
//////////////////////////////////////////////////////////////////////////
31+
// Maths/format/misc related exports
32+
//////////////////////////////////////////////////////////////////////////
33+
34+
float RENDERDOC_HalfToFloat(uint16_t half);
35+
36+
uint16_t RENDERDOC_FloatToHalf(float flt);
37+
38+
uint32_t RENDERDOC_NumVerticesPerPrimitive(Topology topology);
39+
40+
uint32_t RENDERDOC_VertexOffset(Topology topology, uint32_t primitive);
41+
42+
//////////////////////////////////////////////////////////////////////////
43+
// Target Control
44+
//////////////////////////////////////////////////////////////////////////
45+
46+
uint32_t RENDERDOC_EnumerateRemoteTargets(const char *host, uint32_t nextIdent);
47+
48+
//////////////////////////////////////////////////////////////////////////
49+
// Remote server
50+
//////////////////////////////////////////////////////////////////////////
51+
52+
uint32_t RENDERDOC_GetDefaultRemoteServerPort();
53+
54+
void RENDERDOC_BecomeRemoteServer(const char *listenhost, uint32_t port,
55+
volatile bool32 *killReplay);
56+
57+
//////////////////////////////////////////////////////////////////////////
58+
// Injection/execution capture functions.
59+
//////////////////////////////////////////////////////////////////////////
60+
61+
void RENDERDOC_GetDefaultCaptureOptions(CaptureOptions *opts);
62+
63+
bool32 RENDERDOC_StartGlobalHook(const char *pathmatch, const char *logfile,
64+
const CaptureOptions &opts);
65+
66+
void RENDERDOC_StopGlobalHook();
67+
68+
bool32 RENDERDOC_IsGlobalHookActive();
69+
70+
bool32 RENDERDOC_CanGlobalHook();
71+
72+
uint32_t RENDERDOC_ExecuteAndInject(
73+
const char *app,
74+
const char *workingDir,
75+
const char *cmdLine,
76+
const rdctype::array<EnvironmentModification> &env,
77+
const char *logfile,
78+
const CaptureOptions &opts,
79+
bool32 waitForExit
80+
);
81+
82+
uint32_t RENDERDOC_InjectIntoProcess(
83+
uint32_t pid,
84+
const rdctype::array<EnvironmentModification> &env,
85+
const char *logfile,
86+
const CaptureOptions &opts,
87+
bool32 waitForExit
88+
);
89+
90+
void RENDERDOC_StartSelfHostCapture(const char *dllname);
91+
92+
void RENDERDOC_EndSelfHostCapture(const char *dllname);
93+
94+
//////////////////////////////////////////////////////////////////////////
95+
// Vulkan layer handling
96+
//////////////////////////////////////////////////////////////////////////
97+
98+
bool RENDERDOC_NeedVulkanLayerRegistration(
99+
VulkanLayerFlags *flags,
100+
rdctype::array<rdctype::str> *myJSONs,
101+
rdctype::array<rdctype::str> *otherJSONs
102+
);
103+
104+
void RENDERDOC_UpdateVulkanLayerRegistration(bool systemLevel);
105+
106+
//////////////////////////////////////////////////////////////////////////
107+
// Miscellaneous!
108+
//////////////////////////////////////////////////////////////////////////
109+
110+
void RENDERDOC_InitGlobalEnv(GlobalEnvironment env,
111+
const rdctype::array<rdctype::str> &args);
112+
113+
void RENDERDOC_TriggerExceptionHandler(void *exceptionPtrs, bool32 crashed);
114+
115+
void RENDERDOC_SetDebugLogFile(const char *filename);
116+
117+
const char *RENDERDOC_GetLogFile();
118+
119+
void RENDERDOC_LogText(const char *text);
120+
121+
void RENDERDOC_LogMessage(LogType type, const char *project, const char *file,
122+
unsigned int line, const char *text);
123+
124+
const char *RENDERDOC_GetVersionString();
125+
126+
const char *RENDERDOC_GetConfigSetting(const char *name);
127+
128+
void RENDERDOC_SetConfigSetting(const char *name, const char *value);
129+
130+
void RENDERDOC_GetAndroidFriendlyName(const rdctype::str &device,
131+
rdctype::str &friendly);
132+
133+
void RENDERDOC_EnumerateAndroidDevices(rdctype::str *deviceList);
134+
135+
void RENDERDOC_StartAndroidRemoteServer(const char *device);
136+
137+
void RENDERDOC_CheckAndroidPackage(const char *host, const char *exe,
138+
AndroidFlags *flags);
139+
140+
bool RENDERDOC_AddLayerToAndroidPackage(const char *host, const char *exe,
141+
float *progress);
142+
143+
#endif // EXTERN_H

renderdoc_sys/replay/include/CaptureFile.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33

44
#include <cstdint>
55

6-
#include "../../renderdoc/renderdoc/api/replay/basic_types.h"
6+
#include "../../renderdoc/renderdoc/api/replay/replay_enums.h"
77

88
class ReplayController;
9-
enum class ReplayStatus : uint32_t;
10-
enum class ReplaySupport : uint32_t;
9+
class ICaptureFile;
1110

1211
class CaptureFile {
1312
public:
14-
CaptureFile(const char *logfile);
13+
CaptureFile(ICaptureFile *inner);
1514
~CaptureFile();
1615

1716
ReplayStatus OpenStatus();
@@ -27,7 +26,7 @@ class CaptureFile {
2726
private:
2827
void Shutdown();
2928

30-
class ICaptureFile *inner;
29+
ICaptureFile *inner;
3130
};
3231

3332
#endif // CAPTURE_FILE_H

renderdoc_sys/replay/include/Extern.h

Lines changed: 0 additions & 140 deletions
This file was deleted.

renderdoc_sys/replay/include/RemoteServer.h

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,14 @@
77

88
struct CaptureOptions;
99
struct EnvironmentModification;
10+
class IRemoteServer;
1011
struct PathEntry;
1112
class ReplayController;
1213

1314
class RemoteServer {
1415
public:
15-
static void BecomeRemoteServer(const char *listenhost, uint32_t port,
16-
uint32_t *kill);
17-
18-
static uint32_t ExecuteAndInject(
19-
const char *app,
20-
const char *workingDir,
21-
const char *cmdLine,
22-
const rdctype::array<EnvironmentModification> &env,
23-
const char *logfile,
24-
const CaptureOptions &opts,
25-
bool32 waitForExit
26-
);
27-
28-
static uint32_t GetDefaultRemoteServerPort();
29-
30-
RemoteServer(const char *host, uint32_t port);
31-
~RemoteServer();
16+
RemoteServer(IRemoteServer *inner);
17+
void ShutdownServerAndConnection();
3218

3319
void ShutdownConnection();
3420
bool Ping();
@@ -54,10 +40,11 @@ class RemoteServer {
5440

5541
static const uint32_t NoPreference = ~0U;
5642

57-
private:
58-
void ShutdownServerAndConnection();
43+
protected:
44+
~RemoteServer() = default;
5945

60-
class IRemoteServer *inner;
46+
private:
47+
IRemoteServer *inner;
6148
};
6249

6350
#endif // REMOTE_SERVER_H

0 commit comments

Comments
 (0)