Draw render targets in the renderer process
CI / build (push) Successful in 48s

While the renderer process runs, the adapter makes the client's render targets
itself and the renderer process draws frames into them: texture targets are
drawn with like any texture, and a pixmap target's frame is read back through
the channel into its Pixmap (protocol version 4: BeginFrame names its target,
CreateRenderTarget, Channel::readSize and the -read event). Frames into render
targets are drawn even while the window is hidden.

The client uses pixmap targets for snapshots (outfit pictures, photos), checked
to look right. The render target interfaces are declared from IMVU's vtables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-10-28 19:09:48 -07:00
1 parent fa883892db
commit 6e4fe589e5
18 files changed
+523 -58

No files matched your search

+32 -3
View File
@@ -6,6 +6,7 @@
#include <cstdint>
#include "t5de/imvu/shared_ptr.hpp"
#include "t5de/imvu/types.hpp"
namespace t5de::imvu {
@@ -39,8 +40,36 @@ public:
virtual Pixmap* read(Pixmap* result) const = 0;
};
class PiRenderTarget;
class PiPixmapRenderTarget;
class PiTextureRenderTarget;
// What frames can be drawn into besides the window (PiRenderEngine::beginRendering). IMVU's Direct3D engine returns
// each as a pointer into its own object (single inheritance from these, so the PiRenderTarget pointer is the same).
class PiRenderTarget {
public:
virtual ~PiRenderTarget() = default;
};
// Drawn into, then read: after each frame drawn into it, getPixmap() has its pixels (IMVU's engine copies them at the
// end of the frame). Used for snapshots: outfit pictures, the photo widget.
class PiPixmapRenderTarget : public PiRenderTarget {
public:
// Constructs a copy of the pixels in result (a Pixmap returned by value).
virtual Pixmap* getPixmap(Pixmap* result) const = 0;
};
// The part of the texture the target covers, in texture coordinates. IMVU's Direct3D engine always returns 0, 0, 1, 1.
struct TextureArea {
float left;
float top;
float right;
float bottom;
};
// Drawn into, then drawn with as a texture.
class PiTextureRenderTarget : public PiRenderTarget {
public:
// Constructs the area in result (returned by value).
virtual TextureArea* area(TextureArea* result) const = 0;
// Constructs, in result, a new texture object for what's been drawn (a shared pointer returned by value).
virtual SharedPtr<PiRenderTexture>* texture(SharedPtr<PiRenderTexture>* result) const = 0;
};
} // namespace t5de::imvu