2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 11:44:55 +00:00

Add initial imgui implementation

This commit is contained in:
2021-05-24 17:25:31 -04:00
parent 94f10bb002
commit 1a5ec8b569
16 changed files with 585 additions and 40 deletions

View File

@@ -40,6 +40,7 @@ set(HECL_HEADERS
../include/hecl/MathExtras.hpp
../include/hecl/UniformBufferPool.hpp
../include/hecl/VertexBufferPool.hpp
../include/hecl/IndexBufferPool.hpp
../include/hecl/PipelineBase.hpp
../include/hecl/Pipeline.hpp
../include/hecl/Compilers.hpp)

View File

@@ -164,4 +164,4 @@ SPECIALIZE_STAGE_CONVERTER(PlatformType::NX)
#endif
} // namespace hecl
} // namespace hecl

View File

@@ -537,6 +537,9 @@ bool Compiler::compileFile(SystemStringView file, std::string_view baseName,
fmt::print(out.second, FMT_STRING("static const boo::VertexElementDescriptor {}_vtxfmtelems[] = {{\n"), shaderName);
for (const auto& attr : shaderAttributes) {
switch (attr.first & boo::VertexSemantic::SemanticMask) {
case boo::VertexSemantic::Position2:
SemanticOut(out.second, attr, FMT_STRING("{{boo::VertexSemantic::Position2{}, {}}},\n"));
break;
case boo::VertexSemantic::Position3:
SemanticOut(out.second, attr, FMT_STRING("{{boo::VertexSemantic::Position3{}, {}}},\n"));
break;
@@ -611,7 +614,9 @@ bool Compiler::compileFile(SystemStringView file, std::string_view baseName,
boo::VertexSemantic orsem = inst ? boo::VertexSemantic::Instanced : boo::VertexSemantic::None;
int idxNum = int(strtoul(idx.c_str(), nullptr, 10));
std::transform(semantic.begin(), semantic.end(), semantic.begin(), ::tolower);
if (semantic == "position3")
if (semantic == "position2")
shaderAttributes.push_back(std::make_pair(boo::VertexSemantic::Position2 | orsem, idxNum));
else if (semantic == "position3")
shaderAttributes.push_back(std::make_pair(boo::VertexSemantic::Position3 | orsem, idxNum));
else if (semantic == "position4")
shaderAttributes.push_back(std::make_pair(boo::VertexSemantic::Position4 | orsem, idxNum));
@@ -794,7 +799,7 @@ bool Compiler::compileFile(SystemStringView file, std::string_view baseName,
out.first << "<P, S>,";
}
out.first << "\n";
return true;
}