53 lines
1.7 KiB
C++
53 lines
1.7 KiB
C++
#include "ShaderAuthoringParser.h"
|
|
|
|
#include "Internal/ShaderAuthoringInternal.h"
|
|
|
|
namespace XCEngine {
|
|
namespace Resources {
|
|
|
|
bool LooksLikeShaderAuthoring(const std::string& sourceText) {
|
|
std::vector<std::string> lines;
|
|
Internal::SplitShaderAuthoringLines(sourceText, lines);
|
|
return !lines.empty() && Internal::StartsWithKeyword(lines.front(), "Shader");
|
|
}
|
|
|
|
void AppendAuthoringSourceBlock(
|
|
Containers::String& target,
|
|
const Containers::String& sourceBlock) {
|
|
Internal::AppendAuthoringSourceBlock(target, sourceBlock);
|
|
}
|
|
|
|
void CollectQuotedIncludeDependencyPaths(
|
|
const Containers::String& sourcePath,
|
|
const Containers::String& sourceText,
|
|
std::unordered_set<std::string>& seenPaths,
|
|
Containers::Array<Containers::String>& outDependencies) {
|
|
Internal::CollectQuotedIncludeDependencyPaths(sourcePath, sourceText, seenPaths, outDependencies);
|
|
}
|
|
|
|
Containers::String StripShaderAuthoringPragmas(const Containers::String& sourceText) {
|
|
return Internal::StripShaderAuthoringPragmas(sourceText);
|
|
}
|
|
|
|
std::vector<ShaderKeywordSet> BuildShaderKeywordVariantSets(
|
|
const Containers::Array<ShaderKeywordDeclaration>& declarations) {
|
|
return Internal::BuildShaderKeywordVariantSets(declarations);
|
|
}
|
|
|
|
Containers::String BuildKeywordVariantSource(
|
|
const Containers::String& baseSource,
|
|
const ShaderKeywordSet& requiredKeywords) {
|
|
return Internal::BuildKeywordVariantSource(baseSource, requiredKeywords);
|
|
}
|
|
|
|
bool ParseShaderAuthoring(
|
|
const Containers::String& path,
|
|
const std::string& sourceText,
|
|
ShaderIR& outDesc,
|
|
Containers::String* outError) {
|
|
return Internal::ParseShaderAuthoring(path, sourceText, outDesc, outError);
|
|
}
|
|
|
|
} // namespace Resources
|
|
} // namespace XCEngine
|