diff options
author | quou <quou@disroot.org> | 2025-01-02 13:22:46 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-01-02 13:22:46 +1100 |
commit | cb111c1a73fa0b2168b2003120a002bc207bdeed (patch) | |
tree | 8d993e71306a4516a50b25f11ecbd96c13f559e9 | |
parent | c6a76a0e5e6ab209dc64a7907c7715f2cbb2e81a (diff) |
fix shader interpolator with no values
-rw-r--r-- | sc/sc.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -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(); |