Draw particles, match the client's fog, and measure frame delay

Particles (point sprites) are drawn as instanced camera-facing squares sized like Direct3D 9's. Fog is by depth buffer value, as Direct3D 9 does with IMVU's projections. At most one frame is queued for display, frames carry the adapter's timestamp so the renderer process logs the delay to presenting, and the log's lines from several processes no longer mix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-10-28 06:11:51 -07:00
1 parent 42fc55cb91
commit a04dba18c1
12 files changed
+293 -90

No files matched your search

+15 -2
View File
@@ -90,8 +90,21 @@ static_assert(sizeof(VertexAttributeArray<Vec3f>) == 12);
// (width, height, pitch, rowBytes, pixels, ...).
class Pixmap;
// Unknown so far: used only by drawPointSprites (particles), as a Visual C++ 2010 std::vector<PointSprite>.
struct PointSpriteVector;
// A particle (drawPointSprites): a point drawn as a camera-facing square, textured, about viewport height / distance
// pixels across (1 to 64), as the Direct3D engine's point sprites are.
struct PointSprite {
Vec3f position;
Color color;
};
static_assert(sizeof(PointSprite) == 16);
// std::vector<PointSprite> as Visual C++ 2010 lays it out (release builds): its elements are [first, last).
struct PointSpriteVector {
const PointSprite* first;
const PointSprite* last;
const PointSprite* end; // of the allocation
};
// Region lists IMVU passes to texture updates; unknown so far.
class CompoundRegion;
+8 -1
View File
@@ -32,6 +32,7 @@ enum class Op : std::uint16_t {
DestroyBuffer,
DrawTriangles,
DrawArrays,
DrawPointSprites,
};
struct Header {
@@ -47,7 +48,7 @@ struct BeginFrame {
};
struct EndFrame {
std::uint32_t unused;
std::uint64_t sentAt; // the adapter's QueryPerformanceCounter (the same clock in every process)
};
struct Clear {
@@ -172,6 +173,12 @@ struct DrawArrays {
std::uint32_t hasColors;
};
// Particles: payload count sprites of 16 bytes, a position (3 floats) and a color. Each is a camera-facing square,
// viewport height / distance pixels across (1 to 64), textured with the first texture over the whole square.
struct DrawPointSprites {
std::uint32_t count;
};
static_assert(sizeof(Header) == 8 && sizeof(SetProjection) == 72 && sizeof(SetLight) == 28
&& sizeof(DrawArrays) == 20);