With libepoxy we can choose between EGL and GLX at runtime, as well as dynamically open EGL and GLX libraries without linking to them. This will make it possible to build with Wayland, EGL, GLVND support while still running on systems that only have X11, GLX and libGL. It also paves the way for headless rendering through EGL. libepoxy is a new library dependency, and is included in the precompiled libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed. Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton and Sergey Sharybin. Ref T76428 Differential Revision: https://developer.blender.org/D15291
43 lines
810 B
C++
43 lines
810 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2020 Blender Foundation. All rights reserved. */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
#include "gpu_uniform_buffer_private.hh"
|
|
|
|
namespace blender {
|
|
namespace gpu {
|
|
|
|
/**
|
|
* Implementation of Uniform Buffers using OpenGL.
|
|
*/
|
|
class GLUniformBuf : public UniformBuf {
|
|
private:
|
|
/** Slot to which this UBO is currently bound. -1 if not bound. */
|
|
int slot_ = -1;
|
|
/** OpenGL Object handle. */
|
|
GLuint ubo_id_ = 0;
|
|
|
|
public:
|
|
GLUniformBuf(size_t size, const char *name);
|
|
~GLUniformBuf();
|
|
|
|
void update(const void *data) override;
|
|
void bind(int slot) override;
|
|
void unbind() override;
|
|
|
|
private:
|
|
void init();
|
|
|
|
MEM_CXX_CLASS_ALLOC_FUNCS("GLUniformBuf");
|
|
};
|
|
|
|
} // namespace gpu
|
|
} // namespace blender
|