diff --git a/docs/python_api/base/funcs.rst b/docs/python_api/base/funcs.rst index cc64c4d52..0f67ba854 100644 --- a/docs/python_api/base/funcs.rst +++ b/docs/python_api/base/funcs.rst @@ -44,6 +44,10 @@ Logging & Versioning Maths & Utilities ----------------- +.. autofunction:: renderdoc.CreateWin32WindowingData +.. autofunction:: renderdoc.CreateXlibWindowingData +.. autofunction:: renderdoc.CreateXCBWindowingData +.. autofunction:: renderdoc.CreateAndroidWindowingData .. autofunction:: renderdoc.InitCamera .. autofunction:: renderdoc.HalfToFloat .. autofunction:: renderdoc.FloatToHalf diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index a6dbb4602..4827a2877 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -1144,33 +1144,23 @@ int CaptureContext::ResourceNameCacheID() return m_CustomNameCachedID; } -void *CaptureContext::FillWindowingData(uintptr_t widget) +WindowingData CaptureContext::CreateWindowingData(uintptr_t widget) { #if defined(WIN32) - return (void *)widget; + return CreateWin32WindowingData((HWND)widget); #elif defined(RENDERDOC_PLATFORM_LINUX) - static XCBWindowData xcb; - static XlibWindowData xlib; - if(m_CurWinSystem == WindowingSystem::XCB) - { - xcb.connection = m_XCBConnection; - xcb.window = (xcb_window_t)widget; - return &xcb; - } + return CreateXCBWindowingData(m_XCBConnection, (xcb_window_t)widget); else - { - xlib.display = m_X11Display; - xlib.window = (Drawable)widget; - return &xlib; - } + return CreateXlibWindowingData(m_X11Display, (Drawable)widget); #elif defined(RENDERDOC_PLATFORM_APPLE) - return (void *)widget; + WindowingData ret = {WindowingSystem::Unknown}; + return ret; #else diff --git a/qrenderdoc/Code/CaptureContext.h b/qrenderdoc/Code/CaptureContext.h index ec26fa89e..c4a528c74 100644 --- a/qrenderdoc/Code/CaptureContext.h +++ b/qrenderdoc/Code/CaptureContext.h @@ -132,7 +132,7 @@ public: } const SDFile &GetStructuredFile() override { return *m_StructuredFile; } WindowingSystem CurWindowingSystem() override { return m_CurWinSystem; } - void *FillWindowingData(uintptr_t winId) override; + WindowingData CreateWindowingData(uintptr_t winId) override; const rdcarray &DebugMessages() override { return m_DebugMessages; } int UnreadMessageCount() override { return m_UnreadMessageCount; } diff --git a/qrenderdoc/Code/Interface/QRDInterface.h b/qrenderdoc/Code/Interface/QRDInterface.h index d62326f04..3dd697543 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.h +++ b/qrenderdoc/Code/Interface/QRDInterface.h @@ -1296,16 +1296,11 @@ considered out of date DOCUMENT(R"(Create an opaque pointer suitable for passing to :meth:`~renderdoc.ReplayController.CreateOutput` or other functions that expect windowing data. -.. note:: - - This data only stays valid until the next call to FillWindowingData. You should pass it to the - consuming function immediately. - :param int winId: The window ID as returned from ``QWidget.winId()``. :return: The windowing data. -:rtype: opaque void * pointer. +:rtype: ~renderdoc.WindowingData )"); - virtual void *FillWindowingData(uintptr_t winId) = 0; + virtual WindowingData CreateWindowingData(uintptr_t winId) = 0; DOCUMENT(R"(Retrieve the current list of debug messages. This includes messages from the capture as well as messages generated during replay and analysis. diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index dac878537..38c4cc4a6 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -1362,8 +1362,7 @@ void BufferViewer::OnCaptureLoaded() WId renderID = ui->render->winId(); m_Ctx.Replay().BlockInvoke([renderID, this](IReplayController *r) { - m_Output = r->CreateOutput(m_Ctx.CurWindowingSystem(), m_Ctx.FillWindowingData(renderID), - ReplayOutputType::Mesh); + m_Output = r->CreateOutput(m_Ctx.CreateWindowingData(renderID), ReplayOutputType::Mesh); ui->render->setOutput(m_Output); diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index b7a6c2820..465258ff2 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -2087,11 +2087,9 @@ void MainWindow::on_action_Start_Replay_Loop_triggered() .arg(tr("nothing"))); } - WindowingSystem winSys = m_Ctx.CurWindowingSystem(); - void *winData = m_Ctx.FillWindowingData(popup.winId()); + WindowingData winData = m_Ctx.CreateWindowingData(popup.winId()); - m_Ctx.Replay().AsyncInvoke( - [winSys, winData, id](IReplayController *r) { r->ReplayLoop(winSys, winData, id); }); + m_Ctx.Replay().AsyncInvoke([winData, id](IReplayController *r) { r->ReplayLoop(winData, id); }); RDDialog::show(&popup); diff --git a/qrenderdoc/Windows/PythonShell.cpp b/qrenderdoc/Windows/PythonShell.cpp index 459bcc98a..8a77cfbea 100644 --- a/qrenderdoc/Windows/PythonShell.cpp +++ b/qrenderdoc/Windows/PythonShell.cpp @@ -101,9 +101,9 @@ struct CaptureContextInvoker : ICaptureContext } virtual const SDFile &GetStructuredFile() override { return m_Ctx.GetStructuredFile(); } virtual WindowingSystem CurWindowingSystem() override { return m_Ctx.CurWindowingSystem(); } - virtual void *FillWindowingData(uintptr_t winId) override + virtual WindowingData CreateWindowingData(uintptr_t winId) override { - return m_Ctx.FillWindowingData(winId); + return m_Ctx.CreateWindowingData(winId); } virtual const rdcarray &DebugMessages() override { return m_Ctx.DebugMessages(); } virtual int UnreadMessageCount() override { return m_Ctx.UnreadMessageCount(); } diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index 3d66fe79e..383782854 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -1875,15 +1875,13 @@ void TextureViewer::InitResourcePreview(ResourcePreview *prev, ResourceId id, Co if(m_Ctx.GetTexture(id)) { m_Ctx.Replay().AsyncInvoke([this, handle, id, typeHint](IReplayController *) { - m_Output->AddThumbnail(m_Ctx.CurWindowingSystem(), m_Ctx.FillWindowingData(handle), id, - typeHint); + m_Output->AddThumbnail(m_Ctx.CreateWindowingData(handle), id, typeHint); }); } else { m_Ctx.Replay().AsyncInvoke([this, handle](IReplayController *) { - m_Output->AddThumbnail(m_Ctx.CurWindowingSystem(), m_Ctx.FillWindowingData(handle), - ResourceId(), CompType::Typeless); + m_Output->AddThumbnail(m_Ctx.CreateWindowingData(handle), ResourceId(), CompType::Typeless); }); } @@ -1900,8 +1898,7 @@ void TextureViewer::InitResourcePreview(ResourcePreview *prev, ResourceId id, Co WId handle = prev->thumbWinId(); m_Ctx.Replay().AsyncInvoke([this, handle](IReplayController *) { - m_Output->AddThumbnail(m_Ctx.CurWindowingSystem(), m_Ctx.FillWindowingData(handle), - ResourceId(), CompType::Typeless); + m_Output->AddThumbnail(m_Ctx.CreateWindowingData(handle), ResourceId(), CompType::Typeless); }); } else @@ -2445,10 +2442,9 @@ void TextureViewer::OnCaptureLoaded() : FloatVector(); m_Ctx.Replay().BlockInvoke([renderID, contextID, this](IReplayController *r) { - m_Output = r->CreateOutput(m_Ctx.CurWindowingSystem(), m_Ctx.FillWindowingData(renderID), - ReplayOutputType::Texture); + m_Output = r->CreateOutput(m_Ctx.CreateWindowingData(renderID), ReplayOutputType::Texture); - m_Output->SetPixelContext(m_Ctx.CurWindowingSystem(), m_Ctx.FillWindowingData(contextID)); + m_Output->SetPixelContext(m_Ctx.CreateWindowingData(contextID)); ui->render->setOutput(m_Output); ui->pixelContext->setOutput(m_Output); diff --git a/renderdoc/api/replay/renderdoc_replay.h b/renderdoc/api/replay/renderdoc_replay.h index d5cbcedd9..522b41343 100644 --- a/renderdoc/api/replay/renderdoc_replay.h +++ b/renderdoc/api/replay/renderdoc_replay.h @@ -104,59 +104,6 @@ #define RENDERDOC_API RENDERDOC_IMPORT_API #endif -// windowing structures - -#if defined(RENDERDOC_PLATFORM_WIN32) - -// Win32 uses HWND - -#endif - -#if defined(RENDERDOC_WINDOWING_XLIB) - -// can't include xlib.h here as it defines a ton of crap like None -// and Bool etc which can interfere with other headers -typedef struct _XDisplay Display; -typedef unsigned long Drawable; - -struct XlibWindowData -{ - Display *display; - Drawable window; -}; - -#else - -typedef struct _XDisplay Display; - -#endif - -#if defined(RENDERDOC_WINDOWING_XCB) - -struct xcb_connection_t; -typedef uint32_t xcb_window_t; - -struct XCBWindowData -{ - xcb_connection_t *connection; - xcb_window_t window; -}; - -#endif - -#if defined(RENDERDOC_PLATFORM_ANDROID) - -// android uses ANativeWindow* - -#endif - -DOCUMENT(R"(Internal structure used for initialising environment in a replay application.)"); -struct GlobalEnvironment -{ - DOCUMENT("The handle to the X display to use internally. If left ``NULL``, one will be opened."); - Display *xlibDisplay = NULL; -}; - // needs to be declared up here for reference in basic_types extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_FreeArrayMem(const void *mem); @@ -311,23 +258,23 @@ DOCUMENT(R"(Specifies a windowing system to use for creating an output window. .. data:: Unknown - No windowing data is passed and no native window will be output to. + No windowing data is passed and no native window is described. .. data:: Win32 - The windowing data refers to a Win32 ``HWND`` handle. + The windowing data refers to a Win32 window. See :func:`CreateWin32WindowingData`. .. data:: Xlib - The windowing data refers to an Xlib pair of ``Display *`` and ``Drawable``. + The windowing data refers to an Xlib window. See :func:`CreateXLibWindowingData`. .. data:: XCB - The windowing data refers to an XCB pair of ``xcb_connection_t *`` and ``xcb_window_t``. + The windowing data refers to an XCB window. See :func:`CreateXCBWindowingData`. .. data:: Android - The windowing data refers to an Android ``ANativeWindow *``. + The windowing data refers to an Android window. See :func:`CreateAndroidWindowingData`. )"); enum class WindowingSystem : uint32_t { @@ -340,6 +287,140 @@ enum class WindowingSystem : uint32_t DECLARE_REFLECTION_ENUM(WindowingSystem); +// typedef the window data structs so this will compile on all platforms without system headers. We +// only actually need the real definitions when we're using the data, otherwise it's mostly opaque +// pointers or integers. + +// Win32 +typedef struct HWND__ *HWND; + +// xlib +typedef struct _XDisplay Display; +typedef unsigned long Drawable; + +// xcb +struct xcb_connection_t; +typedef uint32_t xcb_window_t; + +// android +struct ANativeWindow; + +// for swig bindings treat the windowing data struct as completely opaque +#if defined(SWIG) + +struct WindowingData; + +#else + +struct WindowingData +{ + WindowingSystem system; + + union + { + struct + { + HWND window; + } win32; + + struct + { + Display *display; + Drawable window; + } xlib; + + struct + { + xcb_connection_t *connection; + xcb_window_t window; + } xcb; + + struct + { + ANativeWindow *window; + } android; + }; +}; + +DECLARE_REFLECTION_ENUM(WindowingData); + +#endif + +DOCUMENT(R"(Create a :class:`WindowingData` for a Win32 ``HWND`` handle. + +:param HWND window: The native ``HWND`` handle for this window. +:return: A :class:`WindowingData` corresponding to the given window. +:rtype: WindowingData +)"); +inline const WindowingData CreateWin32WindowingData(HWND window) +{ + WindowingData ret = {}; + + ret.system = WindowingSystem::Win32; + ret.win32.window = window; + + return ret; +} + +DOCUMENT(R"(Create a :class:`WindowingData` for an Xlib ``Drawable`` handle. + +:param Display display: The ``Display`` connection used for this window. +:param Drawable window: The native ``Drawable`` handle for this window. +:return: A :class:`WindowingData` corresponding to the given window. +:rtype: WindowingData +)"); +inline const WindowingData CreateXlibWindowingData(Display *display, Drawable window) +{ + WindowingData ret = {}; + + ret.system = WindowingSystem::Xlib; + ret.xlib.display = display; + ret.xlib.window = window; + + return ret; +} + +DOCUMENT(R"(Create a :class:`WindowingData` for an XCB ``xcb_window_t`` handle. + +:param xcb_connection_t connection: The ``xcb_connection_t`` connection used for this window. +:param xcb_window_t window: The native ``xcb_window_t`` handle for this window. +:return: A :class:`WindowingData` corresponding to the given window. +:rtype: WindowingData +)"); +inline const WindowingData CreateXCBWindowingData(xcb_connection_t *connection, xcb_window_t window) +{ + WindowingData ret = {}; + + ret.system = WindowingSystem::XCB; + ret.xcb.connection = connection; + ret.xcb.window = window; + + return ret; +} + +DOCUMENT(R"(Create a :class:`WindowingData` for an Android ``ANativeWindow`` handle. + +:param ANativeWindow window: The native ``ANativeWindow`` handle for this window. +:return: A :class:`WindowingData` corresponding to the given window. +:rtype: WindowingData +)"); +inline const WindowingData CreateAndroidWindowingData(ANativeWindow *window) +{ + WindowingData ret = {}; + + ret.system = WindowingSystem::Android; + ret.android.window = window; + + return ret; +} + +DOCUMENT(R"(Internal structure used for initialising environment in a replay application.)"); +struct GlobalEnvironment +{ + DOCUMENT("The handle to the X display to use internally. If left ``NULL``, one will be opened."); + Display *xlibDisplay = NULL; +}; + #ifdef RENDERDOC_EXPORTS struct ResourceId; @@ -441,15 +522,12 @@ you can call this function multiple times to just change the texture. Should only be called for texture outputs. -:param WindowingSystem system: The type of native window handle data being provided. -:param data: The native window data, in a format defined by the system. -:type data: opaque void * pointer. +:param WindowingData window: A :class:`WindowingData` describing the native window. :param ResourceId textureId: The texture ID to display in the thumbnail preview. :return: A boolean indicating if the thumbnail was successfully created. :rtype: ``bool`` )"); - virtual bool AddThumbnail(WindowingSystem system, void *data, ResourceId textureId, - CompType typeHint) = 0; + virtual bool AddThumbnail(WindowingData window, ResourceId textureId, CompType typeHint) = 0; DOCUMENT(R"(Render to the window handle specified when the output was created. @@ -464,13 +542,11 @@ fixed high zoom value and a fixed position, see :meth:`SetPixelContextLocation`. Should only be called for texture outputs. -:param WindowingSystem system: The type of native window handle data being provided. -:param data: The native window data, in a format defined by the system. -:type data: opaque void * pointer. +:param WindowingData window: A :class:`WindowingData` describing the native window. :return: A boolean indicating if the pixel context was successfully configured. :rtype: ``bool`` )"); - virtual bool SetPixelContext(WindowingSystem system, void *data) = 0; + virtual bool SetPixelContext(WindowingData window) = 0; DOCUMENT(R"(Sets the pixel that the pixel context should be centred on. @@ -592,14 +668,12 @@ struct IReplayController DOCUMENT(R"(Creates a replay output of the given type to the given native window -:param WindowingSystem system: The type of native window handle data being provided -:param data: The native window data, in a format defined by the system -:type data: opaque void * pointer +:param WindowingData window: A :class:`WindowingData` describing the native window. :param ReplayOutputType type: What type of output to create :return: A handle to the created output, or ``None`` on failure :rtype: ReplayOutput )"); - virtual IReplayOutput *CreateOutput(WindowingSystem system, void *data, ReplayOutputType type) = 0; + virtual IReplayOutput *CreateOutput(WindowingData window, ReplayOutputType type) = 0; DOCUMENT("Shutdown and destroy the current interface and all outputs that have been created."); virtual void Shutdown() = 0; @@ -610,12 +684,10 @@ displaying the selected texture in a default unscaled manner to the given output The function won't return until :meth:`CancelReplayLoop` is called. Since this function is blocking, that function must be called from another thread. -:param WindowingSystem system: The type of native window handle data being provided -:param data: The native window data, in a format defined by the system -:type data: opaque void * pointer +:param WindowingData window: A :class:`WindowingData` describing the native window. :param ResourceId texid: The id of the texture to display. )"); - virtual void ReplayLoop(WindowingSystem system, void *data, ResourceId texid) = 0; + virtual void ReplayLoop(WindowingData window, ResourceId texid) = 0; DOCUMENT("Cancels a replay loop begun in :meth:`ReplayLoop`. Does nothing if no loop is active."); virtual void CancelReplayLoop() = 0; diff --git a/renderdoc/core/image_viewer.cpp b/renderdoc/core/image_viewer.cpp index 1fb5bd703..128bdf267 100644 --- a/renderdoc/core/image_viewer.cpp +++ b/renderdoc/core/image_viewer.cpp @@ -74,9 +74,9 @@ public: { return m_Proxy->GetSupportedWindowSystems(); } - uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth) + uint64_t MakeOutputWindow(WindowingData window, bool depth) { - return m_Proxy->MakeOutputWindow(system, data, depth); + return m_Proxy->MakeOutputWindow(window, depth); } void DestroyOutputWindow(uint64_t id) { m_Proxy->DestroyOutputWindow(id); } bool CheckResizeOutputWindow(uint64_t id) { return m_Proxy->CheckResizeOutputWindow(id); } diff --git a/renderdoc/core/replay_proxy.h b/renderdoc/core/replay_proxy.h index 3b2081238..826511ea0 100644 --- a/renderdoc/core/replay_proxy.h +++ b/renderdoc/core/replay_proxy.h @@ -137,10 +137,10 @@ public: return m_Proxy->GetSupportedWindowSystems(); return vector(); } - uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth) + uint64_t MakeOutputWindow(WindowingData window, bool depth) { if(m_Proxy) - return m_Proxy->MakeOutputWindow(system, data, depth); + return m_Proxy->MakeOutputWindow(window, depth); return 0; } void DestroyOutputWindow(uint64_t id) diff --git a/renderdoc/driver/d3d11/d3d11_debug.cpp b/renderdoc/driver/d3d11/d3d11_debug.cpp index d4e3f6a27..5a6e741c5 100644 --- a/renderdoc/driver/d3d11/d3d11_debug.cpp +++ b/renderdoc/driver/d3d11/d3d11_debug.cpp @@ -1562,12 +1562,12 @@ void D3D11DebugManager::OutputWindow::MakeDSV() } } -uint64_t D3D11DebugManager::MakeOutputWindow(WindowingSystem system, void *data, bool depth) +uint64_t D3D11DebugManager::MakeOutputWindow(WindowingData window, bool depth) { - RDCASSERT(system == WindowingSystem::Win32, system); + RDCASSERT(window.system == WindowingSystem::Win32, window.system); OutputWindow outw; - outw.wnd = (HWND)data; + outw.wnd = window.win32.window; outw.dev = m_WrappedDevice; DXGI_SWAP_CHAIN_DESC swapDesc; diff --git a/renderdoc/driver/d3d11/d3d11_debug.h b/renderdoc/driver/d3d11/d3d11_debug.h index 5fa0eb391..6808c1e07 100644 --- a/renderdoc/driver/d3d11/d3d11_debug.h +++ b/renderdoc/driver/d3d11/d3d11_debug.h @@ -108,7 +108,7 @@ public: D3D11DebugManager(WrappedID3D11Device *wrapper); ~D3D11DebugManager(); - uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth); + uint64_t MakeOutputWindow(WindowingData window, bool depth); void DestroyOutputWindow(uint64_t id); bool CheckResizeOutputWindow(uint64_t id); void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h); diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index e30199d18..51e8aba03 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -1297,9 +1297,9 @@ vector D3D11Replay::GetPassEvents(uint32_t eventId) return passEvents; } -uint64_t D3D11Replay::MakeOutputWindow(WindowingSystem system, void *data, bool depth) +uint64_t D3D11Replay::MakeOutputWindow(WindowingData window, bool depth) { - return m_pDevice->GetDebugManager()->MakeOutputWindow(system, data, depth); + return m_pDevice->GetDebugManager()->MakeOutputWindow(window, depth); } void D3D11Replay::DestroyOutputWindow(uint64_t id) diff --git a/renderdoc/driver/d3d11/d3d11_replay.h b/renderdoc/driver/d3d11/d3d11_replay.h index e0d0081ae..b085536a4 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.h +++ b/renderdoc/driver/d3d11/d3d11_replay.h @@ -90,7 +90,7 @@ public: return ret; } - uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth); + uint64_t MakeOutputWindow(WindowingData window, bool depth); void DestroyOutputWindow(uint64_t id); bool CheckResizeOutputWindow(uint64_t id); void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h); diff --git a/renderdoc/driver/d3d12/d3d12_debug.cpp b/renderdoc/driver/d3d12/d3d12_debug.cpp index cce2a7ab4..630e5d6d1 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.cpp +++ b/renderdoc/driver/d3d12/d3d12_debug.cpp @@ -1973,12 +1973,12 @@ void D3D12DebugManager::OutputWindow::MakeDSV() } } -uint64_t D3D12DebugManager::MakeOutputWindow(WindowingSystem system, void *data, bool depth) +uint64_t D3D12DebugManager::MakeOutputWindow(WindowingData window, bool depth) { - RDCASSERT(system == WindowingSystem::Win32, system); + RDCASSERT(window.system == WindowingSystem::Win32, window.system); OutputWindow outw; - outw.wnd = (HWND)data; + outw.wnd = window.win32.window; outw.dev = m_WrappedDevice; DXGI_SWAP_CHAIN_DESC swapDesc; diff --git a/renderdoc/driver/d3d12/d3d12_debug.h b/renderdoc/driver/d3d12/d3d12_debug.h index 274e21fe8..e376dc7ef 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.h +++ b/renderdoc/driver/d3d12/d3d12_debug.h @@ -41,7 +41,7 @@ public: D3D12DebugManager(WrappedID3D12Device *wrapper); ~D3D12DebugManager(); - uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth); + uint64_t MakeOutputWindow(WindowingData window, bool depth); void DestroyOutputWindow(uint64_t id); bool CheckResizeOutputWindow(uint64_t id); void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h); diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index c529ea2e4..751700dc7 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -1494,9 +1494,9 @@ uint32_t D3D12Replay::PickVertex(uint32_t eventId, const MeshDisplay &cfg, uint3 return m_pDevice->GetDebugManager()->PickVertex(eventId, cfg, x, y); } -uint64_t D3D12Replay::MakeOutputWindow(WindowingSystem system, void *data, bool depth) +uint64_t D3D12Replay::MakeOutputWindow(WindowingData window, bool depth) { - return m_pDevice->GetDebugManager()->MakeOutputWindow(system, data, depth); + return m_pDevice->GetDebugManager()->MakeOutputWindow(window, depth); } void D3D12Replay::DestroyOutputWindow(uint64_t id) diff --git a/renderdoc/driver/d3d12/d3d12_replay.h b/renderdoc/driver/d3d12/d3d12_replay.h index 56c3dc5c7..b12677f47 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.h +++ b/renderdoc/driver/d3d12/d3d12_replay.h @@ -88,7 +88,7 @@ public: return ret; } - uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth); + uint64_t MakeOutputWindow(WindowingData window, bool depth); void DestroyOutputWindow(uint64_t id); bool CheckResizeOutputWindow(uint64_t id); void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h); diff --git a/renderdoc/driver/gl/gl_common.h b/renderdoc/driver/gl/gl_common.h index 84e5b8ab1..0668e77af 100644 --- a/renderdoc/driver/gl/gl_common.h +++ b/renderdoc/driver/gl/gl_common.h @@ -196,7 +196,7 @@ struct GLPlatform virtual void SwapBuffers(GLWindowingData context) = 0; virtual void GetOutputWindowDimensions(GLWindowingData context, int32_t &w, int32_t &h) = 0; virtual bool IsOutputWindowVisible(GLWindowingData context) = 0; - virtual GLWindowingData MakeOutputWindow(WindowingSystem system, void *data, bool depth, + virtual GLWindowingData MakeOutputWindow(WindowingData window, bool depth, GLWindowingData share_context) = 0; // for 'backwards compatible' overlay rendering diff --git a/renderdoc/driver/gl/gl_debug.cpp b/renderdoc/driver/gl/gl_debug.cpp index 8e8db0f79..0348e7de3 100644 --- a/renderdoc/driver/gl/gl_debug.cpp +++ b/renderdoc/driver/gl/gl_debug.cpp @@ -250,7 +250,8 @@ void GLReplay::InitDebugData() RenderDoc::Inst().SetProgress(LoadProgress::DebugManagerInit, 0.0f); { - uint64_t id = MakeOutputWindow(WindowingSystem::Unknown, NULL, true); + WindowingData window = {WindowingSystem::Unknown}; + uint64_t id = MakeOutputWindow(window, true); m_DebugID = id; m_DebugCtx = &m_OutputWindows[id]; diff --git a/renderdoc/driver/gl/gl_hooks_apple.cpp b/renderdoc/driver/gl/gl_hooks_apple.cpp index 10557c0ce..8e6ffc1c5 100644 --- a/renderdoc/driver/gl/gl_hooks_apple.cpp +++ b/renderdoc/driver/gl/gl_hooks_apple.cpp @@ -64,8 +64,7 @@ public: RDCUNIMPLEMENTED("IsOutputWindowVisible"); return true; } - virtual GLWindowingData MakeOutputWindow(WindowingSystem system, void *data, bool depth, - GLWindowingData share_context) + virtual GLWindowingData MakeOutputWindow(WindowingData window, GLWindowingData share_context) { RDCUNIMPLEMENTED("MakeOutputWindow"); return GLWindowingData(); diff --git a/renderdoc/driver/gl/gl_hooks_egl.cpp b/renderdoc/driver/gl/gl_hooks_egl.cpp index 250d50a09..72a4b538c 100644 --- a/renderdoc/driver/gl/gl_hooks_egl.cpp +++ b/renderdoc/driver/gl/gl_hooks_egl.cpp @@ -154,22 +154,16 @@ public: } bool IsOutputWindowVisible(GLWindowingData context) { return true; } - GLWindowingData MakeOutputWindow(WindowingSystem system, void *data, bool depth, - GLWindowingData share_context) + GLWindowingData MakeOutputWindow(WindowingData window, bool depth, GLWindowingData share_context) { - EGLNativeWindowType window = 0; + EGLNativeWindowType win = 0; - switch(system) + switch(window.system) { #if ENABLED(RDOC_ANDROID) - case WindowingSystem::Android: window = (EGLNativeWindowType)data; break; + case WindowingSystem::Android: win = window.android.window; break; #elif ENABLED(RDOC_LINUX) - case WindowingSystem::Xlib: - { - XlibWindowData *xlib = (XlibWindowData *)data; - window = (EGLNativeWindowType)xlib->window; - break; - } + case WindowingSystem::Xlib: win = window.xlib.window; break; #endif case WindowingSystem::Unknown: // allow WindowingSystem::Unknown so that internally we can create a window-less context @@ -180,7 +174,7 @@ public: EGLDisplay eglDisplay = real.GetDisplay(EGL_DEFAULT_DISPLAY); RDCASSERT(eglDisplay); - return CreateWindowingData(real, eglDisplay, share_context.ctx, window); + return CreateWindowingData(real, eglDisplay, share_context.ctx, win); } bool DrawQuads(float width, float height, const std::vector &vertices); diff --git a/renderdoc/driver/gl/gl_hooks_linux.cpp b/renderdoc/driver/gl/gl_hooks_linux.cpp index fb05cea71..00939c80f 100644 --- a/renderdoc/driver/gl/gl_hooks_linux.cpp +++ b/renderdoc/driver/gl/gl_hooks_linux.cpp @@ -220,28 +220,25 @@ public: return true; } - GLWindowingData MakeOutputWindow(WindowingSystem system, void *data, bool depth, - GLWindowingData share_context) + GLWindowingData MakeOutputWindow(WindowingData window, bool depth, GLWindowingData share_context) { GLWindowingData ret; Display *dpy = NULL; Drawable draw = 0; - if(system == WindowingSystem::Xlib) + if(window.system == WindowingSystem::Xlib) { #if ENABLED(RDOC_XLIB) - XlibWindowData *xlib = (XlibWindowData *)data; - - dpy = xlib->display; - draw = xlib->window; + dpy = window.xlib.display; + draw = window.xlib.window; #else RDCERR( "Xlib windowing system data passed in, but support is not compiled in. GL must have xlib " "support compiled in"); #endif } - else if(system == WindowingSystem::Unknown) + else if(window.system == WindowingSystem::Unknown) { // allow WindowingSystem::Unknown so that internally we can create a window-less context dpy = RenderDoc::Inst().GetGlobalEnvironment().xlibDisplay; diff --git a/renderdoc/driver/gl/gl_hooks_win32.cpp b/renderdoc/driver/gl/gl_hooks_win32.cpp index 5d989a037..ab3919050 100644 --- a/renderdoc/driver/gl/gl_hooks_win32.cpp +++ b/renderdoc/driver/gl/gl_hooks_win32.cpp @@ -698,14 +698,15 @@ public: return (IsWindowVisible(context.wnd) == TRUE); } - GLWindowingData GLPlatform::MakeOutputWindow(WindowingSystem system, void *data, bool depth, + GLWindowingData GLPlatform::MakeOutputWindow(WindowingData window, bool depth, GLWindowingData share_context) { GLWindowingData ret; - RDCASSERT(system == WindowingSystem::Win32 || system == WindowingSystem::Unknown, system); + RDCASSERT(window.system == WindowingSystem::Win32 || window.system == WindowingSystem::Unknown, + window.system); - HWND w = (HWND)data; + HWND w = window.win32.window; if(w == NULL) w = CreateWindowEx(WS_EX_CLIENTEDGE, L"renderdocGLclass", L"", WS_OVERLAPPEDWINDOW, diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index d56aee34b..4a2bab9af 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -3266,9 +3266,9 @@ void GLReplay::CloseReplayContext() m_pDriver->m_Platform.DeleteReplayContext(m_ReplayCtx); } -uint64_t GLReplay::MakeOutputWindow(WindowingSystem system, void *data, bool depth) +uint64_t GLReplay::MakeOutputWindow(WindowingData window, bool depth) { - OutputWindow win = m_pDriver->m_Platform.MakeOutputWindow(system, data, depth, m_ReplayCtx); + OutputWindow win = m_pDriver->m_Platform.MakeOutputWindow(window, depth, m_ReplayCtx); if(!win.wnd) return 0; @@ -3330,7 +3330,7 @@ class GLDummyPlatform : public GLPlatform virtual void SwapBuffers(GLWindowingData context) {} virtual void GetOutputWindowDimensions(GLWindowingData context, int32_t &w, int32_t &h) {} virtual bool IsOutputWindowVisible(GLWindowingData context) { return false; } - virtual GLWindowingData MakeOutputWindow(WindowingSystem system, void *data, bool depth, + virtual GLWindowingData MakeOutputWindow(WindowingData window, bool depth, GLWindowingData share_context) { return GLWindowingData(); diff --git a/renderdoc/driver/gl/gl_replay.h b/renderdoc/driver/gl/gl_replay.h index 28e028f53..395ec9a27 100644 --- a/renderdoc/driver/gl/gl_replay.h +++ b/renderdoc/driver/gl/gl_replay.h @@ -139,7 +139,7 @@ public: return ret; } - uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth); + uint64_t MakeOutputWindow(WindowingData window, bool depth); void DestroyOutputWindow(uint64_t id); bool CheckResizeOutputWindow(uint64_t id); void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h); diff --git a/renderdoc/driver/vulkan/vk_android.cpp b/renderdoc/driver/vulkan/vk_android.cpp index 6541326d5..f5633ad6e 100644 --- a/renderdoc/driver/vulkan/vk_android.cpp +++ b/renderdoc/driver/vulkan/vk_android.cpp @@ -25,11 +25,10 @@ #include "vk_core.h" #include "vk_replay.h" -void VulkanReplay::OutputWindow::SetWindowHandle(WindowingSystem system, void *data) +void VulkanReplay::OutputWindow::SetWindowHandle(WindowingData window) { - RDCASSERT(system == WindowingSystem::Android, system); - wnd = (ANativeWindow *)data; - m_WindowSystem = system; + RDCASSERT(window.system == WindowingSystem::Android, window.system); + wnd = window.android.window; } void VulkanReplay::OutputWindow::CreateSurface(VkInstance inst) diff --git a/renderdoc/driver/vulkan/vk_apple.cpp b/renderdoc/driver/vulkan/vk_apple.cpp index c617e3714..daa78100c 100644 --- a/renderdoc/driver/vulkan/vk_apple.cpp +++ b/renderdoc/driver/vulkan/vk_apple.cpp @@ -25,10 +25,9 @@ #include "vk_core.h" #include "vk_replay.h" -void VulkanReplay::OutputWindow::SetWindowHandle(WindowingSystem system, void *data) +void VulkanReplay::OutputWindow::SetWindowHandle(WindowingData window) { RDCUNIMPLEMENTED("SetWindowHandle"); - m_WindowSystem = system; } void VulkanReplay::OutputWindow::CreateSurface(VkInstance inst) diff --git a/renderdoc/driver/vulkan/vk_linux.cpp b/renderdoc/driver/vulkan/vk_linux.cpp index c3e76ce80..27a32fa3f 100644 --- a/renderdoc/driver/vulkan/vk_linux.cpp +++ b/renderdoc/driver/vulkan/vk_linux.cpp @@ -33,31 +33,27 @@ #include "vk_core.h" #include "vk_replay.h" -void VulkanReplay::OutputWindow::SetWindowHandle(WindowingSystem system, void *data) +void VulkanReplay::OutputWindow::SetWindowHandle(WindowingData window) { - m_WindowSystem = system; - #if ENABLED(RDOC_XLIB) - if(system == WindowingSystem::Xlib) + if(window.system == WindowingSystem::Xlib) { - XlibWindowData *xdata = (XlibWindowData *)data; - xlib.display = xdata->display; - xlib.window = xdata->window; + xlib.display = window.xlib.display; + xlib.window = window.xlib.window; return; } #endif #if ENABLED(RDOC_XCB) - if(system == WindowingSystem::XCB) + if(window.system == WindowingSystem::XCB) { - XCBWindowData *xdata = (XCBWindowData *)data; - xcb.connection = xdata->connection; - xcb.window = xdata->window; + xcb.connection = window.xcb.connection; + xcb.window = window.xcb.window; return; } #endif - RDCERR("Unrecognised/unsupported window system %d", system); + RDCERR("Unrecognised/unsupported window system %d", window.system); } void VulkanReplay::OutputWindow::CreateSurface(VkInstance inst) diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index 1f2b51c23..584aaf991 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -2893,15 +2893,16 @@ vector VulkanReplay::GetSupportedWindowSystems() return m_pDriver->m_SupportedWindowSystems; } -uint64_t VulkanReplay::MakeOutputWindow(WindowingSystem system, void *data, bool depth) +uint64_t VulkanReplay::MakeOutputWindow(WindowingData window, bool depth) { uint64_t id = m_OutputWinID; m_OutputWinID++; - m_OutputWindows[id].SetWindowHandle(system, data); + m_OutputWindows[id].m_WindowSystem = window.system; + m_OutputWindows[id].SetWindowHandle(window); m_OutputWindows[id].m_ResourceManager = GetResourceManager(); - if(system != WindowingSystem::Unknown) + if(window.system != WindowingSystem::Unknown) { int32_t w, h; GetOutputWindowDimensions(id, w, h); diff --git a/renderdoc/driver/vulkan/vk_replay.h b/renderdoc/driver/vulkan/vk_replay.h index 78cce303e..ae7eb7ef8 100644 --- a/renderdoc/driver/vulkan/vk_replay.h +++ b/renderdoc/driver/vulkan/vk_replay.h @@ -171,7 +171,7 @@ public: vector GetSupportedWindowSystems(); - uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth); + uint64_t MakeOutputWindow(WindowingData window, bool depth); void DestroyOutputWindow(uint64_t id); bool CheckResizeOutputWindow(uint64_t id); void GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h); @@ -287,7 +287,7 @@ private: // implemented in vk_replay_platform.cpp void CreateSurface(VkInstance inst); - void SetWindowHandle(WindowingSystem system, void *data); + void SetWindowHandle(WindowingData window); WindowingSystem m_WindowSystem; diff --git a/renderdoc/driver/vulkan/vk_win32.cpp b/renderdoc/driver/vulkan/vk_win32.cpp index 704fe10e7..1920304c1 100644 --- a/renderdoc/driver/vulkan/vk_win32.cpp +++ b/renderdoc/driver/vulkan/vk_win32.cpp @@ -27,11 +27,10 @@ static int dllLocator = 0; -void VulkanReplay::OutputWindow::SetWindowHandle(WindowingSystem system, void *data) +void VulkanReplay::OutputWindow::SetWindowHandle(WindowingData window) { - RDCASSERT(system == WindowingSystem::Win32, system); - wnd = (HWND)data; - m_WindowSystem = system; + RDCASSERT(window.system == WindowingSystem::Win32, window.system); + wnd = window.win32.window; } void VulkanReplay::OutputWindow::CreateSurface(VkInstance inst) diff --git a/renderdoc/replay/replay_controller.cpp b/renderdoc/replay/replay_controller.cpp index 8c59f419f..2d24a6657 100644 --- a/renderdoc/replay/replay_controller.cpp +++ b/renderdoc/replay/replay_controller.cpp @@ -1393,9 +1393,9 @@ rdcarray ReplayController::GetSupportedWindowSystems() return m_pDevice->GetSupportedWindowSystems(); } -void ReplayController::ReplayLoop(WindowingSystem system, void *data, ResourceId texid) +void ReplayController::ReplayLoop(WindowingData window, ResourceId texid) { - ReplayOutput *output = CreateOutput(system, data, ReplayOutputType::Texture); + ReplayOutput *output = CreateOutput(window, ReplayOutputType::Texture); TextureDisplay d; d.resourceId = texid; @@ -1445,9 +1445,9 @@ void ReplayController::CancelReplayLoop() Threading::Sleep(1); } -ReplayOutput *ReplayController::CreateOutput(WindowingSystem system, void *data, ReplayOutputType type) +ReplayOutput *ReplayController::CreateOutput(WindowingData window, ReplayOutputType type) { - ReplayOutput *out = new ReplayOutput(this, system, data, type); + ReplayOutput *out = new ReplayOutput(this, window, type); m_Outputs.push_back(out); diff --git a/renderdoc/replay/replay_controller.h b/renderdoc/replay/replay_controller.h index 705347640..7cafe471d 100644 --- a/renderdoc/replay/replay_controller.h +++ b/renderdoc/replay/replay_controller.h @@ -42,12 +42,12 @@ public: void SetMeshDisplay(const MeshDisplay &o); void ClearThumbnails(); - bool AddThumbnail(WindowingSystem system, void *data, ResourceId texID, CompType typeHint); + bool AddThumbnail(WindowingData window, ResourceId texID, CompType typeHint); void Display(); ReplayOutputType GetType() { return m_Type; } - bool SetPixelContext(WindowingSystem system, void *data); + bool SetPixelContext(WindowingData window); void SetPixelContextLocation(uint32_t x, uint32_t y); void DisablePixelContext(); @@ -61,7 +61,7 @@ public: rdcpair PickVertex(uint32_t eventId, uint32_t x, uint32_t y); private: - ReplayOutput(ReplayController *parent, WindowingSystem system, void *data, ReplayOutputType type); + ReplayOutput(ReplayController *parent, WindowingData window, ReplayOutputType type); virtual ~ReplayOutput(); void SetFrameEvent(int eventId); @@ -193,10 +193,10 @@ public: rdcarray GetSupportedWindowSystems(); - void ReplayLoop(WindowingSystem system, void *data, ResourceId texid); + void ReplayLoop(WindowingData window, ResourceId texid); void CancelReplayLoop(); - ReplayOutput *CreateOutput(WindowingSystem, void *data, ReplayOutputType type); + ReplayOutput *CreateOutput(WindowingData window, ReplayOutputType type); void ShutdownOutput(IReplayOutput *output); void Shutdown(); diff --git a/renderdoc/replay/replay_driver.h b/renderdoc/replay/replay_driver.h index be8bce939..b67e4c606 100644 --- a/renderdoc/replay/replay_driver.h +++ b/renderdoc/replay/replay_driver.h @@ -174,7 +174,7 @@ public: virtual vector GetSupportedWindowSystems() = 0; - virtual uint64_t MakeOutputWindow(WindowingSystem system, void *data, bool depth) = 0; + 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 GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h) = 0; diff --git a/renderdoc/replay/replay_output.cpp b/renderdoc/replay/replay_output.cpp index 829b8577f..419f3113c 100644 --- a/renderdoc/replay/replay_output.cpp +++ b/renderdoc/replay/replay_output.cpp @@ -28,23 +28,23 @@ #include "strings/string_utils.h" #include "replay_controller.h" -static uint64_t GetHandle(WindowingSystem system, void *data) +static uint64_t GetHandle(WindowingData window) { #if ENABLED(RDOC_LINUX) - if(system == WindowingSystem::Xlib) + if(window.system == WindowingSystem::Xlib) { #if ENABLED(RDOC_XLIB) - return (uint64_t)((XlibWindowData *)data)->window; + return (uint64_t)window.xlib.window; #else RDCERR("Xlib windowing system data passed in, but support is not compiled in"); #endif } - if(system == WindowingSystem::XCB) + if(window.system == WindowingSystem::XCB) { #if ENABLED(RDOC_XCB) - return (uint64_t)((XCBWindowData *)data)->window; + return (uint64_t)window.xcb.window; #else RDCERR("XCB windowing system data passed in, but support is not compiled in"); #endif @@ -56,21 +56,20 @@ static uint64_t GetHandle(WindowingSystem system, void *data) #elif ENABLED(RDOC_WIN32) - RDCASSERT(system == WindowingSystem::Win32); - return (uint64_t)data; // HWND + RDCASSERT(window.system == WindowingSystem::Win32); + return (uint64_t)window.win32.window; // HWND #elif ENABLED(RDOC_ANDROID) - RDCASSERT(system == WindowingSystem::Android); - return (uint64_t)data; // ANativeWindow * + RDCASSERT(window.system == WindowingSystem::Android); + return (uint64_t)window.android.window; // ANativeWindow * #else RDCFATAL("No windowing data defined for this platform! Must be implemented for replay outputs"); #endif } -ReplayOutput::ReplayOutput(ReplayController *parent, WindowingSystem system, void *data, - ReplayOutputType type) +ReplayOutput::ReplayOutput(ReplayController *parent, WindowingData window, ReplayOutputType type) { m_pRenderer = parent; @@ -96,8 +95,8 @@ ReplayOutput::ReplayOutput(ReplayController *parent, WindowingSystem system, voi m_Type = type; - if(system != WindowingSystem::Unknown) - m_MainOutput.outputID = m_pDevice->MakeOutputWindow(system, data, type == ReplayOutputType::Mesh); + if(window.system != WindowingSystem::Unknown) + m_MainOutput.outputID = m_pDevice->MakeOutputWindow(window, type == ReplayOutputType::Mesh); else m_MainOutput.outputID = 0; m_MainOutput.texture = ResourceId(); @@ -226,9 +225,9 @@ void ReplayOutput::ClearThumbnails() m_Thumbnails.clear(); } -bool ReplayOutput::SetPixelContext(WindowingSystem system, void *data) +bool ReplayOutput::SetPixelContext(WindowingData window) { - m_PixelContext.outputID = m_pDevice->MakeOutputWindow(system, data, false); + m_PixelContext.outputID = m_pDevice->MakeOutputWindow(window, false); m_PixelContext.texture = ResourceId(); m_PixelContext.depthMode = false; @@ -237,12 +236,11 @@ bool ReplayOutput::SetPixelContext(WindowingSystem system, void *data) return m_PixelContext.outputID != 0; } -bool ReplayOutput::AddThumbnail(WindowingSystem system, void *data, ResourceId texID, - CompType typeHint) +bool ReplayOutput::AddThumbnail(WindowingData window, ResourceId texID, CompType typeHint) { OutputPair p; - RDCASSERT(data); + RDCASSERT(window.system != WindowingSystem::Unknown); bool depthMode = false; @@ -258,7 +256,7 @@ bool ReplayOutput::AddThumbnail(WindowingSystem system, void *data, ResourceId t for(size_t i = 0; i < m_Thumbnails.size(); i++) { - if(m_Thumbnails[i].wndHandle == GetHandle(system, data)) + if(m_Thumbnails[i].wndHandle == GetHandle(window)) { m_Thumbnails[i].texture = texID; @@ -272,8 +270,8 @@ bool ReplayOutput::AddThumbnail(WindowingSystem system, void *data, ResourceId t } } - p.wndHandle = GetHandle(system, data); - p.outputID = m_pDevice->MakeOutputWindow(system, data, false); + p.wndHandle = GetHandle(window); + p.outputID = m_pDevice->MakeOutputWindow(window, false); p.texture = texID; p.depthMode = depthMode; p.typeHint = typeHint; diff --git a/renderdoccmd/renderdoccmd_android.cpp b/renderdoccmd/renderdoccmd_android.cpp index a9893466c..28c4851a0 100644 --- a/renderdoccmd/renderdoccmd_android.cpp +++ b/renderdoccmd/renderdoccmd_android.cpp @@ -64,7 +64,7 @@ void DisplayRendererPreview(IReplayController *renderer, TextureDisplay &display pthread_mutex_lock(&m_DrawLock.lock); - IReplayOutput *out = renderer->CreateOutput(WindowingSystem::Android, connectionScreenWindow, + IReplayOutput *out = renderer->CreateOutput(CreateAndroidWindowingData(connectionScreenWindow), ReplayOutputType::Texture); out->SetTextureDisplay(displayCfg); diff --git a/renderdoccmd/renderdoccmd_linux.cpp b/renderdoccmd/renderdoccmd_linux.cpp index ecc80ceb7..d89a83245 100644 --- a/renderdoccmd/renderdoccmd_linux.cpp +++ b/renderdoccmd/renderdoccmd_linux.cpp @@ -282,19 +282,13 @@ void DisplayRendererPreview(IReplayController *renderer, TextureDisplay &display // prefer xcb if(xcb) { - XCBWindowData windowData; - windowData.connection = connection; - windowData.window = window; - - out = renderer->CreateOutput(WindowingSystem::XCB, &windowData, ReplayOutputType::Texture); + out = renderer->CreateOutput(CreateXCBWindowingData(connection, window), + ReplayOutputType::Texture); } else if(xlib) { - XlibWindowData windowData; - windowData.display = display; - windowData.window = (Drawable)window; // safe to cast types - - out = renderer->CreateOutput(WindowingSystem::Xlib, &windowData, ReplayOutputType::Texture); + out = renderer->CreateOutput(CreateXlibWindowingData(display, (Drawable)window), + ReplayOutputType::Texture); } else { diff --git a/renderdoccmd/renderdoccmd_win32.cpp b/renderdoccmd/renderdoccmd_win32.cpp index 40a5f4d8f..e354bc68b 100644 --- a/renderdoccmd/renderdoccmd_win32.cpp +++ b/renderdoccmd/renderdoccmd_win32.cpp @@ -144,7 +144,8 @@ void DisplayRendererPreview(IReplayController *renderer, TextureDisplay &display ShowWindow(wnd, SW_SHOW); UpdateWindow(wnd); - IReplayOutput *out = renderer->CreateOutput(WindowingSystem::Win32, wnd, ReplayOutputType::Texture); + IReplayOutput *out = + renderer->CreateOutput(CreateWin32WindowingData(wnd), ReplayOutputType::Texture); out->SetTextureDisplay(displayCfg);