mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-28 16:45:38 +00:00
Refactor public interface to be less strict C and more python friendly
* Generally this means removing ref out parameters and instead returning values. In a couple of cases we will want to avoid copies in future either by returning const references (e.g. to the pipeline state which is immutable). * At the same time, some pointless bool return values that were always true and didn't indicate errors have been removed. They can be added again if an error condition comes back. * Some free functions still have out parameters as C linkage doesn't allow returning user types by value. * The C# UI still invokes into C wrappers for all the C++ classes, which handle taking the return value and doing a copy into an out parameter still for compatibility.
This commit is contained in:
@@ -201,19 +201,19 @@ void CaptureContext::LoadLogfileThreaded(const QString &logFile, const QString &
|
||||
|
||||
// fetch initial data like drawcalls, textures and buffers
|
||||
m_Renderer.BlockInvoke([this](IReplayRenderer *r) {
|
||||
r->GetFrameInfo(&m_FrameInfo);
|
||||
m_FrameInfo = r->GetFrameInfo();
|
||||
|
||||
m_APIProps = r->GetAPIProperties();
|
||||
|
||||
m_PostloadProgress = 0.2f;
|
||||
|
||||
r->GetDrawcalls(&m_Drawcalls);
|
||||
m_Drawcalls = r->GetDrawcalls();
|
||||
|
||||
AddFakeProfileMarkers();
|
||||
|
||||
m_PostloadProgress = 0.4f;
|
||||
|
||||
r->GetSupportedWindowSystems(&m_WinSystems);
|
||||
m_WinSystems = r->GetSupportedWindowSystems();
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32)
|
||||
m_CurWinSystem = WindowingSystem::Win32;
|
||||
@@ -236,22 +236,22 @@ void CaptureContext::LoadLogfileThreaded(const QString &logFile, const QString &
|
||||
m_X11Display = QX11Info::display();
|
||||
#endif
|
||||
|
||||
r->GetBuffers(&m_BufferList);
|
||||
m_BufferList = r->GetBuffers();
|
||||
for(BufferDescription &b : m_BufferList)
|
||||
m_Buffers[b.ID] = &b;
|
||||
|
||||
m_PostloadProgress = 0.8f;
|
||||
|
||||
r->GetTextures(&m_TextureList);
|
||||
m_TextureList = r->GetTextures();
|
||||
for(TextureDescription &t : m_TextureList)
|
||||
m_Textures[t.ID] = &t;
|
||||
|
||||
m_PostloadProgress = 0.9f;
|
||||
|
||||
r->GetD3D11PipelineState(&m_CurD3D11PipelineState);
|
||||
r->GetD3D12PipelineState(&m_CurD3D12PipelineState);
|
||||
r->GetGLPipelineState(&m_CurGLPipelineState);
|
||||
r->GetVulkanPipelineState(&m_CurVulkanPipelineState);
|
||||
m_CurD3D11PipelineState = r->GetD3D11PipelineState();
|
||||
m_CurD3D12PipelineState = r->GetD3D12PipelineState();
|
||||
m_CurGLPipelineState = r->GetGLPipelineState();
|
||||
m_CurVulkanPipelineState = r->GetVulkanPipelineState();
|
||||
m_CurPipelineState.SetStates(m_APIProps, &m_CurD3D11PipelineState, &m_CurD3D12PipelineState,
|
||||
&m_CurGLPipelineState, &m_CurVulkanPipelineState);
|
||||
|
||||
@@ -555,10 +555,10 @@ void CaptureContext::SetEventID(const QVector<ILogViewerForm *> &exclude, uint32
|
||||
|
||||
m_Renderer.BlockInvoke([this, eventID, force](IReplayRenderer *r) {
|
||||
r->SetFrameEvent(eventID, force);
|
||||
r->GetD3D11PipelineState(&m_CurD3D11PipelineState);
|
||||
r->GetD3D12PipelineState(&m_CurD3D12PipelineState);
|
||||
r->GetGLPipelineState(&m_CurGLPipelineState);
|
||||
r->GetVulkanPipelineState(&m_CurVulkanPipelineState);
|
||||
m_CurD3D11PipelineState = r->GetD3D11PipelineState();
|
||||
m_CurD3D12PipelineState = r->GetD3D12PipelineState();
|
||||
m_CurGLPipelineState = r->GetGLPipelineState();
|
||||
m_CurVulkanPipelineState = r->GetVulkanPipelineState();
|
||||
m_CurPipelineState.SetStates(m_APIProps, &m_CurD3D11PipelineState, &m_CurD3D12PipelineState,
|
||||
&m_CurGLPipelineState, &m_CurVulkanPipelineState);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user