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

+30
View File
@@ -0,0 +1,30 @@
#include "log.hpp"
#include <windows.h>
#include <filesystem>
#include <string>
namespace t5de::log {
// Each line is one appending write, so lines from several processes don't mix.
void write(std::string_view line)
{
static const HANDLE file = [] {
wchar_t temp[MAX_PATH + 1];
const DWORD length = GetTempPathW(MAX_PATH + 1, temp);
if (length == 0 || length > MAX_PATH) {
return INVALID_HANDLE_VALUE;
}
return CreateFileW((std::filesystem::path(temp) / L"t5de-renderer-process.log").c_str(), FILE_APPEND_DATA,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL, nullptr);
}();
if (file != INVALID_HANDLE_VALUE) {
const std::string text = std::format("{}: {}\n", GetCurrentProcessId(), line);
DWORD written = 0;
WriteFile(file, text.data(), static_cast<DWORD>(text.size()), &written, nullptr);
}
}
} // namespace t5de::log