summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-12 01:53:21 +0100
committerskal <pascal.massimino@gmail.com>2026-02-12 01:53:21 +0100
commit9595e9efaf343a8d37c9641eeb89f1c847a568a6 (patch)
treea9cfd9c9d0ef84b470d3872079ef496ff2d85725 /src
parent0fcb17f6e0c0ab449c5432f4bbacd6948e1283cd (diff)
fix: suppress spurious shader snippet and auxiliary texture warningsHEADmain
- Add render/scene_query_mode to known placeholders in VerifyIncludes - Remove warning for duplicate auxiliary texture registration (valid for multiple CNNEffect stacks) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/effect.cc6
-rw-r--r--src/gpu/effects/shader_composer.cc6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/effect.cc b/src/gpu/effect.cc
index e0a9c24..3ee2acd 100644
--- a/src/gpu/effect.cc
+++ b/src/gpu/effect.cc
@@ -457,13 +457,9 @@ void MainSequence::register_auxiliary_texture(const char* name, int width,
int height) {
const std::string key(name);
- // Check if already exists
+ // Check if already exists (silent, idempotent registration is valid)
auto it = auxiliary_textures_.find(key);
if (it != auxiliary_textures_.end()) {
-#if !defined(STRIP_ALL)
- fprintf(stderr, "Warning: Auxiliary texture '%s' already registered\n",
- name);
-#endif /* !defined(STRIP_ALL) */
return;
}
diff --git a/src/gpu/effects/shader_composer.cc b/src/gpu/effects/shader_composer.cc
index fe3ad74..9234b7a 100644
--- a/src/gpu/effects/shader_composer.cc
+++ b/src/gpu/effects/shader_composer.cc
@@ -89,6 +89,9 @@ ShaderComposer::Compose(const std::vector<std::string>& dependencies,
void ShaderComposer::VerifyIncludes() const {
#if !defined(STRIP_ALL)
+ // Known placeholders that get substituted at composition time
+ std::set<std::string> known_placeholders = {"render/scene_query_mode"};
+
std::set<std::string> missing;
for (const auto& [name, code] : snippets_) {
std::istringstream stream(code);
@@ -99,7 +102,8 @@ void ShaderComposer::VerifyIncludes() const {
size_t end = line.find('"', start + 1);
if (start != std::string::npos && end != std::string::npos) {
std::string included = line.substr(start + 1, end - start - 1);
- if (snippets_.find(included) == snippets_.end()) {
+ if (snippets_.find(included) == snippets_.end() &&
+ known_placeholders.find(included) == known_placeholders.end()) {
missing.insert(included);
}
}