From 879c76f91ad26e7f848f54996cad8fdeaa6f683d Mon Sep 17 00:00:00 2001 From: chrg6 Date: Fri, 13 Nov 2026 19:25:14 -0500 Subject: [PATCH] Name every caller of reflex_state in nx2_sl.cpp's comment on why its calls never overlap. The review found the comment incomplete: it named nx2sl_available on the device's thread and nx2sl_reflex2 under the runtime's present lock, but nx2sl_reflex2 also runs on the device's thread with no lock (vk_dlssg.c vk_dlssg_device_ready, reflex_apply(0)), and an older runtime reaches it through nx2sl_reflex. The comment now says the runtime calls them on the device's thread before any present or under its present lock, never two at once; the conclusion is unchanged. Comment only: the DLL builds with MSVC against the pinned Streamline SDK and passes the export check. Co-Authored-By: Claude Opus 5.5 --- runtime/dlssg/nx2_sl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/dlssg/nx2_sl.cpp b/runtime/dlssg/nx2_sl.cpp index 4756886d..f9402a59 100644 --- a/runtime/dlssg/nx2_sl.cpp +++ b/runtime/dlssg/nx2_sl.cpp @@ -71,8 +71,9 @@ template T *proc(const char *name) { return reinterpret_cast(GetP // Whether Reflex's sleep runs on this GPU and driver: Streamline takes a frame limit without it and then sets nothing // (its slReflexSetOptions hands the limit to the driver only with the low-latency sleep available). Asked until -// Streamline answers, from nx2sl_available on the device's thread and from nx2sl_reflex2 under the runtime's present -// lock, never at once: slReflexGetState is not thread safe. +// Streamline answers, from nx2sl_available and nx2sl_reflex2 (nx2sl_reflex too, which an older runtime calls), which +// the runtime calls on the device's thread before any present or under its present lock (vk_dlssg.c reflex_apply), +// never two at once: slReflexGetState is not thread safe. void reflex_state() { static sl::ReflexState rs; if (g_low_latency < 0 && p_reflex_state && p_reflex_state(rs) == sl::Result::eOk)