Skip to main content

GPURenderer.dll

Sourcesrc/Renderer/
CMake targetGPURenderer (DLL, OUTPUT_NAME GPURenderer)
TypeWin32 DLL
FamilyDirectUI engine layer

Integration status (#25): standalone experimental scaffolding. MovieMakerCore no longer constructs or links this stack; MF PlaybackController is the live application playback path. A future integration needs a catalog and UI tick.

At a glance​

A focused rendering device wrapper in the DirectUI namespace: owns a D3D11 device and a D2D1.1 device context bound to it, and exposes a minimal draw/present surface — including DrawVideoFrame(ID3D11Texture2D*, RECT) for video compositing. The engine layer's rendering workhorse (MovieMakerCore instead uses its own HMREngine).

Public surface (header Renderer.h)​

namespace DirectUI {

class __declspec(dllexport) GPURenderer {
public:
GPURenderer();
~GPURenderer();

HRESULT Initialize(HWND hwnd);
HRESULT Resize(int width, int height);
HRESULT BeginDraw();
HRESULT EndDraw();
HRESULT Present();

ID3D11Device* GetDevice() const;
ID2D1DeviceContext* GetD2DContext() const;
HRESULT DrawVideoFrame(ID3D11Texture2D* pTexture, const RECT& destRect);

private:
void Cleanup();
ID3D11Device* m_pDevice = nullptr;
ID2D1DeviceContext* m_pD2DContext = nullptr;
// ...
};

} // namespace DirectUI

Implementation notes​

  • D3D11 → D2D1.1 interop: the D2D context is created on top of the D3D11 device (via DXGI), so D2D drawing and D3D video textures share one swap chain — the same interop strategy HMRAVSource's TextureInterop uses in the main engine.
  • BeginDraw/EndDraw bracket D2D batch work; Present flips the swap chain.
  • Resize handles swap-chain buffer recreation (window resize).
  • Links d3d11, d2d1, dxgi (through the common set) — no D3DX dependency (see SDK Compatibility).

Testing​

  • Built in the CI matrix as GPURenderer.
  • Consumed by PlaybackEngine, which receives a GPURenderer* at construction.

Analysis artifacts​

Engine-layer reconstruction; for the original engine's renderer analysis see analysis/MovieMakerCore/ and analysis/D3DCOMPILER_46/.