summaryrefslogtreecommitdiff
path: root/sc/sc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sc/sc.cpp')
-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();