summaryrefslogtreecommitdiff
path: root/src/gpu/effects/shader_composer.cc
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/gpu/effects/shader_composer.cc
parent0fcb17f6e0c0ab449c5432f4bbacd6948e1283cd (diff)
fix: suppress spurious shader snippet and auxiliary texture warnings
- 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/gpu/effects/shader_composer.cc')
-rw-r--r--src/gpu/effects/shader_composer.cc6
1 files changed, 5 insertions, 1 deletions
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);
}
}