Skip to content

Commit ef18d06

Browse files
Critsium-xyclaude
andcommitted
Streamline: report why a feature is unavailable
Capability probing threw away the result of slIsFeatureSupported and kept only a boolean, so a feature that failed to come up was indistinguishable from one the adapter genuinely cannot do. Under --verbose each feature now reports its result code, which separates an unsupported adapter from an out of date driver, a missing plugin or a version mismatch. Streamline's own log also went to a separate console window, where it was invisible to anything capturing the engine's output. It is now routed through a log callback into Godot's output, mapping Streamline's error and warning levels onto ERR_PRINT and WARN_PRINT, so `rendering/streamline/streamline_log` produces something usable. This is what identified why DLSS Ray Reconstruction reports unavailable here: the vendored headers are Streamline 2.10, where Ray Reconstruction is kFeatureDLSS_RR backed by sl.dlss_d, while the 2.13 runtime has moved it to DLSS-NR backed by sl.dlss_nr. Requesting the old feature id makes the runtime skip the new plugin as "not requested by the host" and fall back to the old one, which then needs an nvngx_dlssd.dll that current drivers no longer ship. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgxxgYZUnriDqgepZHiKpY
1 parent 8ffb18f commit ef18d06

1 file changed

Lines changed: 37 additions & 8 deletions

File tree

drivers/streamline/streamline_context.cpp

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#endif
6363

6464
#include "core/config/engine.h"
65+
#include "core/os/os.h"
6566
#include "core/config/project_settings.h"
6667

6768
StreamlineContext &StreamlineContext::get() {
@@ -129,14 +130,27 @@ void StreamlineContext::load_functions_post_init() {
129130
}
130131

131132
static void _enumerate_support(StreamlineContext *self, sl::AdapterInfo &adapterInfo, StreamlineCapabilities &outSupport) {
132-
if (self->slIsFeatureSupported) {
133-
outSupport.dlss_available = self->slIsFeatureSupported(sl::kFeatureDLSS, adapterInfo) == sl::Result::eOk;
134-
outSupport.dlss_g_available = self->slIsFeatureSupported(sl::kFeatureDLSS_G, adapterInfo) == sl::Result::eOk;
135-
outSupport.dlss_rr_available = self->slIsFeatureSupported(sl::kFeatureDLSS_RR, adapterInfo) == sl::Result::eOk;
136-
outSupport.reflex_available = self->slIsFeatureSupported(sl::kFeatureReflex, adapterInfo) == sl::Result::eOk;
137-
outSupport.pcl_available = self->slIsFeatureSupported(sl::kFeaturePCL, adapterInfo) == sl::Result::eOk;
138-
outSupport.nis_available = self->slIsFeatureSupported(sl::kFeatureNIS, adapterInfo) == sl::Result::eOk;
133+
if (!self->slIsFeatureSupported) {
134+
return;
139135
}
136+
137+
// Report why a feature is unavailable rather than only that it is; the result
138+
// distinguishes an unsupported adapter from an out of date driver or a missing plugin.
139+
const bool verbose = OS::get_singleton() && OS::get_singleton()->is_stdout_verbose();
140+
auto supported = [&](sl::Feature p_feature, const char *p_name) {
141+
sl::Result result = self->slIsFeatureSupported(p_feature, adapterInfo);
142+
if (verbose) {
143+
print_line(vformat("Streamline: %s -> %s", p_name, StreamlineContext::result_to_string(result)));
144+
}
145+
return result == sl::Result::eOk;
146+
};
147+
148+
outSupport.dlss_available = supported(sl::kFeatureDLSS, "DLSS");
149+
outSupport.dlss_g_available = supported(sl::kFeatureDLSS_G, "DLSS Frame Generation");
150+
outSupport.dlss_rr_available = supported(sl::kFeatureDLSS_RR, "DLSS Ray Reconstruction");
151+
outSupport.reflex_available = supported(sl::kFeatureReflex, "Reflex");
152+
outSupport.pcl_available = supported(sl::kFeaturePCL, "PCL");
153+
outSupport.nis_available = supported(sl::kFeatureNIS, "NIS");
140154
}
141155

142156
#if STREAMLINE_ENABLED_VULKAN
@@ -324,6 +338,20 @@ const char *StreamlineContext::result_to_string(sl::Result result) {
324338
}
325339
}
326340

341+
static void _streamline_log_callback(sl::LogType p_type, const char *p_msg) {
342+
String msg = String("Streamline: ") + String::utf8(p_msg).strip_edges();
343+
if (msg.is_empty()) {
344+
return;
345+
}
346+
if (p_type == sl::LogType::eError) {
347+
ERR_PRINT(msg);
348+
} else if (p_type == sl::LogType::eWarn) {
349+
WARN_PRINT(msg);
350+
} else {
351+
print_line(msg);
352+
}
353+
}
354+
327355
void StreamlineContext::initialize(bool d3d12) {
328356
StreamlineContext::get().is_game = true;
329357
if (Engine::get_singleton()->is_editor_hint() || Engine::get_singleton()->is_project_manager_hint()) {
@@ -365,7 +393,8 @@ void StreamlineContext::initialize(bool d3d12) {
365393

366394
if (bool(GLOBAL_GET("rendering/streamline/streamline_log"))) {
367395
pref.logLevel = sl::LogLevel::eVerbose;
368-
pref.showConsole = true;
396+
pref.showConsole = false;
397+
pref.logMessageCallback = &_streamline_log_callback;
369398
} else {
370399
pref.logLevel = sl::LogLevel::eOff;
371400
pref.showConsole = false;

0 commit comments

Comments
 (0)