9 PipelineGLES::PipelineGLES(std::shared_ptr<ReactorGLES> reactor,
10 std::weak_ptr<PipelineLibrary> library,
11 const PipelineDescriptor& desc,
12 std::shared_ptr<UniqueHandleGLES> handle)
13 : Pipeline(
std::move(library), desc),
14 reactor_(
std::move(reactor)),
15 handle_(
std::move(handle)),
16 is_valid_(handle_->IsValid()) {
18 reactor_->SetDebugLabel(handle_->Get(), GetDescriptor().GetLabel());
23 PipelineGLES::~PipelineGLES() =
default;
26 bool PipelineGLES::IsValid()
const {
30 const HandleGLES& PipelineGLES::GetProgramHandle()
const {
31 return handle_->Get();
34 const std::shared_ptr<UniqueHandleGLES> PipelineGLES::GetSharedHandle()
const {
39 return buffer_bindings_.get();
44 if (buffer_bindings_) {
47 auto vtx_desc = std::make_unique<BufferBindingsGLES>();
48 if (!vtx_desc->RegisterVertexStageInput(
49 gl, GetDescriptor().GetVertexDescriptor()->GetStageInputs(),
50 GetDescriptor().GetVertexDescriptor()->GetStageLayouts())) {
53 if (!vtx_desc->ReadUniformsBindings(gl, program)) {
56 buffer_bindings_ = std::move(vtx_desc);
60 [[nodiscard]]
bool PipelineGLES::BindProgram()
const {
61 if (!handle_->IsValid()) {
64 auto handle = reactor_->GetGLHandle(handle_->Get());
65 if (!handle.has_value()) {
68 reactor_->GetProcTable().UseProgram(handle.value());
72 [[nodiscard]]
bool PipelineGLES::UnbindProgram()
const {
74 reactor_->GetProcTable().UseProgram(0u);
Sets up stage bindings for single draw call in the OpenGLES backend.
Represents a handle to an underlying OpenGL object. Unlike OpenGL object handles, these handles can b...