Skip to content

Commit

Permalink
Remove unused API function
Browse files Browse the repository at this point in the history
* Headless windows are used as immutable in tests so allowing resizing is
  unnecessary complication
  • Loading branch information
baldurk committed Jan 13, 2025
1 parent f3f0617 commit 3c5ce8a
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 141 deletions.
11 changes: 0 additions & 11 deletions renderdoc/api/replay/renderdoc_replay.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,6 @@ outputs.
)");
virtual void SetMeshDisplay(const MeshDisplay &config) = 0;

DOCUMENT(R"(Sets the dimensions of the output, useful only for headless outputs that don't have a
backing window which don't have any implicit dimensions. This allows configuring a virtual viewport
which is useful for operations like picking vertices that depends on the output dimensions.
.. note:: For outputs with backing windows, this will be ignored.
:param int width: The width to use.
:param int height: The height to use.
)");
virtual void SetDimensions(int32_t width, int32_t height) = 0;

DOCUMENT(R"(Read the output texture back as byte data. Primarily useful for headless outputs where
the output data is not displayed anywhere natively.
Expand Down
4 changes: 0 additions & 4 deletions renderdoc/core/image_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ class ImageViewer : public IReplayDriver
}
void DestroyOutputWindow(uint64_t id) { m_Proxy->DestroyOutputWindow(id); }
bool CheckResizeOutputWindow(uint64_t id) { return m_Proxy->CheckResizeOutputWindow(id); }
void SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h)
{
m_Proxy->SetOutputWindowDimensions(id, w, h);
}
void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h)
{
m_Proxy->GetOutputWindowDimensions(id, w, h);
Expand Down
5 changes: 0 additions & 5 deletions renderdoc/core/replay_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ class ReplayProxy : public IReplayDriver
if(m_Proxy)
return m_Proxy->GetOutputWindowDimensions(id, w, h);
}
void SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h)
{
if(m_Proxy)
m_Proxy->SetOutputWindowDimensions(id, w, h);
}
void GetOutputWindowData(uint64_t id, bytebuf &retData)
{
if(m_Proxy)
Expand Down
21 changes: 0 additions & 21 deletions renderdoc/driver/d3d11/d3d11_outputwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,27 +276,6 @@ void D3D11Replay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h)
h = m_OutputWindows[id].height;
}

void D3D11Replay::SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h)
{
if(id == 0 || m_OutputWindows.find(id) == m_OutputWindows.end())
return;

OutputWindow &outw = m_OutputWindows[id];

// can't resize an output with an actual window backing
if(outw.wnd)
return;

SAFE_RELEASE(outw.rtv);
SAFE_RELEASE(outw.dsv);

outw.width = w;
outw.height = h;

outw.MakeRTV();
outw.MakeDSV();
}

void D3D11Replay::GetOutputWindowData(uint64_t id, bytebuf &retData)
{
if(id == 0 || m_OutputWindows.find(id) == m_OutputWindows.end())
Expand Down
1 change: 0 additions & 1 deletion renderdoc/driver/d3d11/d3d11_replay.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ class D3D11Replay : public IReplayDriver
void DestroyOutputWindow(uint64_t id);
bool CheckResizeOutputWindow(uint64_t id);
void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h);
void SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h);
void GetOutputWindowData(uint64_t id, bytebuf &retData);
void ClearOutputWindowColor(uint64_t id, FloatVector col);
void ClearOutputWindowDepth(uint64_t id, float depth, uint8_t stencil);
Expand Down
24 changes: 0 additions & 24 deletions renderdoc/driver/d3d12/d3d12_outputwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,30 +377,6 @@ void D3D12Replay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h)
h = m_OutputWindows[id].height;
}

void D3D12Replay::SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h)
{
if(id == 0 || m_OutputWindows.find(id) == m_OutputWindows.end())
return;

OutputWindow &outw = m_OutputWindows[id];

// can't resize an output with an actual window backing
if(outw.wnd)
return;

m_pDevice->ExecuteLists();
m_pDevice->FlushLists(true);

outw.width = w;
outw.height = h;

outw.MakeRTV(false);
if(outw.depth)
outw.MakeDSV();

outw.bbIdx = 0;
}

void D3D12Replay::GetOutputWindowData(uint64_t id, bytebuf &retData)
{
if(id == 0 || m_OutputWindows.find(id) == m_OutputWindows.end())
Expand Down
1 change: 0 additions & 1 deletion renderdoc/driver/d3d12/d3d12_replay.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ class D3D12Replay : public IReplayDriver
void DestroyOutputWindow(uint64_t id);
bool CheckResizeOutputWindow(uint64_t id);
void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h);
void SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h);
void GetOutputWindowData(uint64_t id, bytebuf &retData);
void ClearOutputWindowColor(uint64_t id, FloatVector col);
void ClearOutputWindowDepth(uint64_t id, float depth, uint8_t stencil);
Expand Down
31 changes: 0 additions & 31 deletions renderdoc/driver/gl/gl_outputwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,37 +296,6 @@ void GLReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h)
m_pDriver->m_Platform.GetOutputWindowDimensions(outw, w, h);
}

void GLReplay::SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h)
{
if(id == 0 || m_OutputWindows.find(id) == m_OutputWindows.end())
return;

OutputWindow &outw = m_OutputWindows[id];

// can't resize an output with an actual window backing
if(outw.system != WindowingSystem::Headless)
return;

outw.width = w;
outw.height = h;

MakeCurrentReplayContext(m_DebugCtx);

WrappedOpenGL &drv = *m_pDriver;

bool haddepth = false;

drv.glDeleteTextures(1, &outw.BlitData.backbuffer);
if(outw.BlitData.depthstencil)
{
haddepth = true;
drv.glDeleteTextures(1, &outw.BlitData.depthstencil);
}
drv.glDeleteFramebuffers(1, &outw.BlitData.windowFBO);

CreateOutputWindowBackbuffer(outw, haddepth);
}

void GLReplay::GetOutputWindowData(uint64_t id, bytebuf &retData)
{
if(id == 0 || m_OutputWindows.find(id) == m_OutputWindows.end())
Expand Down
1 change: 0 additions & 1 deletion renderdoc/driver/gl/gl_replay.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ class GLReplay : public IReplayDriver
void DestroyOutputWindow(uint64_t id);
bool CheckResizeOutputWindow(uint64_t id);
void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h);
void SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h);
void GetOutputWindowData(uint64_t id, bytebuf &retData);
void ClearOutputWindowColor(uint64_t id, FloatVector col);
void ClearOutputWindowDepth(uint64_t id, float depth, uint8_t stencil);
Expand Down
17 changes: 0 additions & 17 deletions renderdoc/driver/vulkan/vk_outputwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,23 +869,6 @@ void VulkanReplay::GetOutputWindowData(uint64_t id, bytebuf &retData)
vt->FreeMemory(Unwrap(device), readbackMem, NULL);
}

void VulkanReplay::SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h)
{
if(id == 0 || m_OutputWindows.find(id) == m_OutputWindows.end())
return;

OutputWindow &outw = m_OutputWindows[id];

// can't resize an output with an actual window backing
if(outw.m_WindowSystem != WindowingSystem::Headless)
return;

outw.width = w;
outw.height = h;

outw.Create(m_pDriver, m_pDriver->GetDev(), outw.hasDepth);
}

bool VulkanReplay::CheckResizeOutputWindow(uint64_t id)
{
if(id == 0 || m_OutputWindows.find(id) == m_OutputWindows.end())
Expand Down
1 change: 0 additions & 1 deletion renderdoc/driver/vulkan/vk_replay.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ class VulkanReplay : public IReplayDriver
void DestroyOutputWindow(uint64_t id);
bool CheckResizeOutputWindow(uint64_t id);
void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h);
void SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h);
void GetOutputWindowData(uint64_t id, bytebuf &retData);
void ClearOutputWindowColor(uint64_t id, FloatVector col);
void ClearOutputWindowDepth(uint64_t id, float depth, uint8_t stencil);
Expand Down
4 changes: 0 additions & 4 deletions renderdoc/replay/dummy_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,6 @@ bool DummyDriver::CheckResizeOutputWindow(uint64_t id)
return false;
}

void DummyDriver::SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h)
{
}

void DummyDriver::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h)
{
}
Expand Down
1 change: 0 additions & 1 deletion renderdoc/replay/dummy_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ class DummyDriver : public IReplayDriver
uint64_t MakeOutputWindow(WindowingData window, bool depth);
void DestroyOutputWindow(uint64_t id);
bool CheckResizeOutputWindow(uint64_t id);
void SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h);
void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h);
void GetOutputWindowData(uint64_t id, bytebuf &retData);
void ClearOutputWindowColor(uint64_t id, FloatVector col);
Expand Down
1 change: 0 additions & 1 deletion renderdoc/replay/replay_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ class IReplayDriver : public IRemoteDriver
virtual uint64_t MakeOutputWindow(WindowingData window, bool depth) = 0;
virtual void DestroyOutputWindow(uint64_t id) = 0;
virtual bool CheckResizeOutputWindow(uint64_t id) = 0;
virtual void SetOutputWindowDimensions(uint64_t id, int32_t w, int32_t h) = 0;
virtual void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h) = 0;
virtual void GetOutputWindowData(uint64_t id, bytebuf &retData) = 0;
virtual void ClearOutputWindowColor(uint64_t id, FloatVector col) = 0;
Expand Down
23 changes: 5 additions & 18 deletions renderdoc/replay/replay_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,6 @@ void ReplayOutput::Shutdown()
m_pController->ShutdownOutput(this);
}

void ReplayOutput::SetDimensions(int32_t width, int32_t height)
{
CHECK_REPLAY_THREAD();

m_pDevice->SetOutputWindowDimensions(m_MainOutput.outputID, width > 0 ? width : 1,
height > 0 ? height : 1);
m_pDevice->GetOutputWindowDimensions(m_MainOutput.outputID, m_Width, m_Height);
m_pController->FatalErrorCheck();
}

bytebuf ReplayOutput::ReadbackOutputTexture()
{
CHECK_REPLAY_THREAD();
Expand Down Expand Up @@ -397,24 +387,21 @@ bytebuf ReplayOutput::DrawThumbnail(int32_t width, int32_t height, ResourceId te

if(idx < 0)
{
// resize oldest generator if we have hit the max
// release oldest generator if we have hit the max
if(m_ThumbnailGenerators.size() == MaxThumbnailGenerators)
{
outputID = m_ThumbnailGenerators.back().second;
m_pDevice->SetOutputWindowDimensions(outputID, width, height);
m_pDevice->DestroyOutputWindow(m_ThumbnailGenerators.back().second);
m_ThumbnailGenerators.pop_back();
}
else
{
outputID = m_pDevice->MakeOutputWindow(CreateHeadlessWindowingData(width, height), false);
}

outputID = m_pDevice->MakeOutputWindow(CreateHeadlessWindowingData(width, height), false);
}
else
{
// remove the found one, so it can get inserted into the front
m_ThumbnailGenerators.erase(idx);
}
// make this the most recent generator, so the oldest one will be kicked out
// make this the most recent generator, so the oldest one will be kicked out if we have too many
m_ThumbnailGenerators.insert(0, {key, outputID});

bool depthMode = false;
Expand Down

0 comments on commit 3c5ce8a

Please sign in to comment.