Add renderer backend feature reporting

This commit is contained in:
2026-06-02 17:18:48 +02:00
parent 18617cdbd2
commit 995752da75
11 changed files with 103 additions and 7 deletions

View File

@@ -203,6 +203,11 @@ std::string json_escape(std::string_view value)
return escaped;
}
const char* json_bool(bool value) noexcept
{
return value ? "true" : "false";
}
pp::foundation::Result<float> parse_float_arg(std::string_view text)
{
float value = 0.0F;
@@ -2566,6 +2571,7 @@ int record_render(int argc, char** argv)
}
};
const auto commands = device.commands();
const auto features = device.features();
for (const auto& command : commands) {
if (command.kind == pp::renderer::RecordedRenderCommandKind::begin_render_pass) {
++render_passes;
@@ -2650,6 +2656,14 @@ int record_render(int argc, char** argv)
std::cout << "{\"ok\":true,\"command\":\"record-render\""
<< ",\"backend\":\"" << device.backend_name() << "\""
<< ",\"features\":{\"framebufferFetch\":" << json_bool(features.framebuffer_fetch)
<< ",\"explicitTextureTransitions\":" << json_bool(features.explicit_texture_transitions)
<< ",\"textureCopy\":" << json_bool(features.texture_copy)
<< ",\"renderTargetBlit\":" << json_bool(features.render_target_blit)
<< ",\"frameCapture\":" << json_bool(features.frame_capture)
<< ",\"float16RenderTargets\":" << json_bool(features.float16_render_targets)
<< ",\"float32RenderTargets\":" << json_bool(features.float32_render_targets)
<< "}"
<< ",\"target\":{\"width\":" << args.width
<< ",\"height\":" << args.height
<< ",\"format\":\"rgba8\"}"