Close shader authoring pipeline and UsePass dependency tracking

This commit is contained in:
2026-04-07 18:49:37 +08:00
parent 2f9b1696cd
commit 901a6ecc26
12 changed files with 565 additions and 319 deletions

View File

@@ -22,6 +22,9 @@ bool IsBuiltinTexturePath(const Containers::String& path);
bool TryGetBuiltinShaderPathByShaderName(
const Containers::String& shaderName,
Containers::String& outPath);
bool TryResolveBuiltinShaderAssetPath(
const Containers::String& builtinShaderPath,
Containers::String& outPath);
const char* GetBuiltinPrimitiveDisplayName(BuiltinPrimitiveType primitiveType);
Containers::String GetBuiltinPrimitiveMeshPath(BuiltinPrimitiveType primitiveType);

View File

@@ -31,8 +31,6 @@ enum class ShaderBackend : Core::uint8 {
Vulkan
};
// Keep shader property kinds close to Unity's public shader syntax so the
// runtime contract can be reused when ShaderLab-compatible parsing is added.
enum class ShaderPropertyType : Core::uint8 {
Float = 0,
Range,
@@ -119,18 +117,6 @@ public:
size_t GetMemorySize() const override { return m_memorySize; }
void Release() override;
void SetShaderType(ShaderType type);
ShaderType GetShaderType() const { return m_shaderType; }
void SetShaderLanguage(ShaderLanguage lang);
ShaderLanguage GetShaderLanguage() const { return m_language; }
void SetSourceCode(const Containers::String& source);
const Containers::String& GetSourceCode() const { return m_sourceCode; }
void SetCompiledBinary(const Containers::Array<Core::uint8>& binary);
const Containers::Array<Core::uint8>& GetCompiledBinary() const { return m_compiledBinary; }
void AddUniform(const ShaderUniform& uniform);
const Containers::Array<ShaderUniform>& GetUniforms() const { return m_uniforms; }
@@ -181,14 +167,6 @@ public:
private:
ShaderPass& GetOrCreatePass(const Containers::String& passName);
ShaderStageVariant& GetOrCreateLegacyVariant();
void SyncLegacyVariant();
ShaderType m_shaderType = ShaderType::Fragment;
ShaderLanguage m_language = ShaderLanguage::GLSL;
Containers::String m_sourceCode;
Containers::Array<Core::uint8> m_compiledBinary;
Containers::Array<ShaderUniform> m_uniforms;
Containers::Array<ShaderAttribute> m_attributes;