- TEST_SPEC.md: Updated test directory structure to reflect Core/Asset, Core/IO, and Resources/<Type> subdirectories - TEST_SPEC.md: Updated module names and test counts (852 total) - TEST_SPEC.md: Updated build commands for new Resources subdirectories - README.md: Updated engine structure with Core/Asset/ and Core/IO/ - README.md: Updated Resources section with layered architecture - README.md: Updated test coverage table with accurate counts
41 lines
878 B
C++
41 lines
878 B
C++
#include <XCEngine/Resources/Shader/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
|