summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-01-02 13:22:46 +1100
committerquou <quou@disroot.org>2025-01-02 13:22:46 +1100
commitcb111c1a73fa0b2168b2003120a002bc207bdeed (patch)
tree8d993e71306a4516a50b25f11ecbd96c13f559e9
parentc6a76a0e5e6ab209dc64a7907c7715f2cbb2e81a (diff)
fix shader interpolator with no values
-rw-r--r--sc/sc.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/sc/sc.cpp b/sc/sc.cpp
index dfe4325..2bd1406 100644
--- a/sc/sc.cpp
+++ b/sc/sc.cpp
@@ -474,10 +474,12 @@ struct Desc {
ss << attr.name << ";\n";
}
}
- ss << "layout (location = 0) out _Interpolator {\n";
- for (const auto& i : interp)
- ss << i.tname << " " << i.name << ";\n";
- ss << "} interpolator;\n";
+ if (interp.size()) {
+ ss << "layout (location = 0) out _Interpolator {\n";
+ for (const auto& i : interp)
+ ss << i.tname << " " << i.name << ";\n";
+ ss << "} interpolator;\n";
+ }
add_textures(ss, shader_type_vertex);
add_cbuffers(ss, shader_type_vertex);
return ss.str();
@@ -492,10 +494,12 @@ struct Desc {
ss << attr.tname << " ";
ss << attr.name << ";\n";
}
- ss << "layout (location = 0) in _Interpolator {\n";
- for (const auto& i : interp)
- ss << i.tname << " " << i.name << ";\n";
- ss << "} interpolator;\n";
+ if (interp.size()) {
+ ss << "layout (location = 0) in _Interpolator {\n";
+ for (const auto& i : interp)
+ ss << i.tname << " " << i.name << ";\n";
+ ss << "} interpolator;\n";
+ }
add_textures(ss, shader_type_fragment);
add_cbuffers(ss, shader_type_fragment);
return ss.str();