[Chore] (...): Format code.

This commit is contained in:
BZLZHH
2025-11-28 15:17:50 +08:00
parent c67e6e26fa
commit a6b34ee5bf
27 changed files with 344 additions and 345 deletions
@@ -174,18 +174,17 @@ namespace MobileGL {
return std::unexpected(r);
}
for (auto [name, loc]: attrib.explicitVertexInLocations) {
for (auto [name, loc] : attrib.explicitVertexInLocations) {
MGLOG_D("%s: got explicitly set - layout(location = %d) %s;", __func__, loc, name.c_str());
}
// UniquePtr<glslang::TIoMapResolver> resolver;
UniquePtr<TMglGlslIoResolver> resolver;
for (unsigned stage = 0; stage < EShLangCount; stage++) {
if (program->getIntermediate((EShLanguage)stage) == nullptr)
continue;
resolver = MakeUnique<TMglGlslIoResolver>(*program, (EShLanguage)stage,
attrib.explicitVertexInLocations,
attrib.explicitFragmentOutLocations);
if (program->getIntermediate((EShLanguage)stage) == nullptr) continue;
resolver =
MakeUnique<TMglGlslIoResolver>(*program, (EShLanguage)stage, attrib.explicitVertexInLocations,
attrib.explicitFragmentOutLocations);
break;
}
auto ioMapper = UniquePtr<glslang::TIoMapper>(glslang::GetGlslIoMapper());
@@ -64,9 +64,10 @@ namespace MobileGL {
// TODO: We should assert we're really dealing with vertex shader here
SPVC_CHK_INIT
const spvc_reflected_resource *list = nullptr;
const spvc_reflected_resource* list = nullptr;
size_t count = 0;
SPVC_CHK_RESULT(spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_STAGE_INPUT, &list, &count));
SPVC_CHK_RESULT(spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_STAGE_INPUT,
&list, &count));
for (size_t i = 0; i < count; ++i) {
auto& resource = list[i];
auto it = location.find(resource.name);
@@ -24,4 +24,4 @@ namespace MobileGL {
}
TDefaultGlslIoResolver::reserverStorageSlot(ent, infoSink);
}
}
} // namespace MobileGL
@@ -14,18 +14,19 @@
#include "MG_Util/Types.h"
namespace MobileGL {
class TMglGlslIoResolver: public glslang::TDefaultGlslIoResolver {
class TMglGlslIoResolver : public glslang::TDefaultGlslIoResolver {
public:
using ExplicitVarSlotMap = UnorderedMap<String, Uint>;
TMglGlslIoResolver(const glslang::TIntermediate& intermediate, const ExplicitVarSlotMap& vertexIns, const ExplicitVarSlotMap& fragOuts):
TDefaultGlslIoResolver(intermediate), m_explicitVertexIns(vertexIns), m_explicitFragOuts(fragOuts) {}
TMglGlslIoResolver(const glslang::TProgram& program, const EShLanguage stage, const ExplicitVarSlotMap& vertexIns, const ExplicitVarSlotMap& fragOuts):
TMglGlslIoResolver(*program.getIntermediate(stage), vertexIns, fragOuts) {}
TMglGlslIoResolver(const glslang::TIntermediate& intermediate, const ExplicitVarSlotMap& vertexIns,
const ExplicitVarSlotMap& fragOuts)
: TDefaultGlslIoResolver(intermediate), m_explicitVertexIns(vertexIns), m_explicitFragOuts(fragOuts) {}
TMglGlslIoResolver(const glslang::TProgram& program, const EShLanguage stage,
const ExplicitVarSlotMap& vertexIns, const ExplicitVarSlotMap& fragOuts)
: TMglGlslIoResolver(*program.getIntermediate(stage), vertexIns, fragOuts) {}
void reserverStorageSlot(glslang::TVarEntryInfo& ent, TInfoSink& infoSink) override;
protected:
const ExplicitVarSlotMap& m_explicitVertexIns;
const ExplicitVarSlotMap& m_explicitFragOuts;
};
}
} // namespace MobileGL
@@ -14,7 +14,7 @@
namespace glslang {
struct TVarEntryInfo {
long long id;
TIntermSymbol *symbol;
TIntermSymbol* symbol;
bool live;
TLayoutPacking upgradedToPushConstantPacking; // ElpNone means it hasn't been upgraded
int newBinding;
@@ -26,4 +26,4 @@ namespace glslang {
void clearNewAssignments();
};
}
} // namespace glslang