Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-07 19:52:30 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-07 20:37:04 +0300
commit171b36683a774d70a8f25529858b9c002a2a317e (patch)
treec87999c9f5ae85936d283868fc70f192af44263d /source/blender/gpu/opengl/gl_uniform_buffer.cc
parent360489c75167d47653bc34ad9ba9a65076bf384c (diff)
GPUExtensions: GL backend isolation
This is part of the Vulkan task T68990. This commits changes a few things: - Rename extensions to capabilities (but left the file name untouched). - Cubemap mip render workaround detection is rewritten using gl commands to avoid using the GPU API before initialization. - Put all the capabilities that are only relevant for the GL backend inside GLContext as static variables. - Cleanup the names of the limit variables. - Separate all GL related workaround search inside the GL module.
Diffstat (limited to 'source/blender/gpu/opengl/gl_uniform_buffer.cc')
-rw-r--r--source/blender/gpu/opengl/gl_uniform_buffer.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/gpu/opengl/gl_uniform_buffer.cc b/source/blender/gpu/opengl/gl_uniform_buffer.cc
index 0e0c64e5c60..82b7341d145 100644
--- a/source/blender/gpu/opengl/gl_uniform_buffer.cc
+++ b/source/blender/gpu/opengl/gl_uniform_buffer.cc
@@ -42,6 +42,7 @@ namespace blender::gpu {
GLUniformBuf::GLUniformBuf(size_t size, const char *name) : UniformBuf(size, name)
{
/* Do not create ubo GL buffer here to allow allocation from any thread. */
+ BLI_assert(size <= GLContext::max_ubo_size);
}
GLUniformBuf::~GLUniformBuf()
@@ -90,12 +91,12 @@ void GLUniformBuf::update(const void *data)
void GLUniformBuf::bind(int slot)
{
- if (slot >= GPU_max_ubo_binds()) {
+ if (slot >= GLContext::max_ubo_binds) {
fprintf(stderr,
"Error: Trying to bind \"%s\" ubo to slot %d which is above the reported limit of %d.",
name_,
slot,
- GPU_max_ubo_binds());
+ GLContext::max_ubo_binds);
return;
}