ladybird/Userland/Libraries/LibGL/Shaders/Shader.cpp
Stephan Unverwerth 848f1d2689 LibGL: Make shader compilation and program linking always succeed
This will help with testing until the actual compilation infrastructure
is in place.
2022-12-17 22:39:09 -07:00

31 lines
644 B
C++

/*
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/String.h>
#include <LibGL/Shaders/Shader.h>
namespace GL {
NonnullRefPtr<Shader> Shader::create(GLenum shader_type)
{
return adopt_ref(*new Shader(shader_type));
}
ErrorOr<void> Shader::add_source(StringView source_code)
{
auto source_code_content = TRY(String::from_utf8(source_code));
TRY(m_sources.try_append(move(source_code_content)));
return {};
}
ErrorOr<void> Shader::compile()
{
// FIXME: Implement actual shader compilation
m_compile_status = true;
return {};
}
}