refactor: reorganize Resources module into Core/Asset, Core/IO and Resources subdirectories
- Split core resource architecture into Core/Asset/ (IResource, ResourceManager, ResourceCache, etc.)
- Moved IO layer into Core/IO/ (IResourceLoader, ResourceFileSystem, etc.)
- Reorganized concrete resource types into Resources/{Texture,Mesh,Material,Shader,AudioClip}/
- Updated all include paths from relative to <XCEngine/...> format
- Fixed circular dependency in Material.h (removed unnecessary ResourceManager.h include)
- Fixed malformed include syntax in ResourceManager.h and AsyncLoader.h
- Fixed glad.h path issues in CMakeLists.txt
This commit is contained in:
40
engine/src/Resources/Shader/Shader.cpp
Normal file
40
engine/src/Resources/Shader/Shader.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#include "Resources/Shader.h"
|
||||
|
||||
namespace XCEngine {
|
||||
namespace Resources {
|
||||
|
||||
Shader::Shader() = default;
|
||||
|
||||
Shader::~Shader() = default;
|
||||
|
||||
void Shader::Release() {
|
||||
m_sourceCode.Clear();
|
||||
m_compiledBinary.Clear();
|
||||
m_uniforms.Clear();
|
||||
m_attributes.Clear();
|
||||
m_rhiResource = nullptr;
|
||||
m_isValid = false;
|
||||
}
|
||||
|
||||
void Shader::SetSourceCode(const Containers::String& source) {
|
||||
m_sourceCode = source;
|
||||
}
|
||||
|
||||
void Shader::SetCompiledBinary(const Containers::Array<Core::uint8>& binary) {
|
||||
m_compiledBinary = binary;
|
||||
}
|
||||
|
||||
void Shader::AddUniform(const ShaderUniform& uniform) {
|
||||
m_uniforms.PushBack(uniform);
|
||||
}
|
||||
|
||||
void Shader::AddAttribute(const ShaderAttribute& attribute) {
|
||||
m_attributes.PushBack(attribute);
|
||||
}
|
||||
|
||||
void Shader::SetRHIResource(class IRHIShader* resource) {
|
||||
m_rhiResource = resource;
|
||||
}
|
||||
|
||||
} // namespace Resources
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user