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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-03-15 18:04:41 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-03-15 18:04:41 +0300
commit45b637e1e79f817b182031246233c29a4344d159 (patch)
tree3b29920b99ee194a88d110b7a4a3b258359035be /source/blender/gpu/opengl
parente08180fdab8925328ed505333f6e5a721b18e0b4 (diff)
GPU capabilities: detect max SSBO bindings
This adds detection of the maximum number of shader storage buffer bindings that is supported on the current platform. This can be useful to turn off features that require compute shaders but use more buffer bindings than available. Differential Revision: https://developer.blender.org/D14337
Diffstat (limited to 'source/blender/gpu/opengl')
-rw-r--r--source/blender/gpu/opengl/gl_backend.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc
index f0d7a23ef82..9885b16966b 100644
--- a/source/blender/gpu/opengl/gl_backend.cc
+++ b/source/blender/gpu/opengl/gl_backend.cc
@@ -485,6 +485,8 @@ void GLBackend::capabilities_init()
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, &GCaps.max_work_group_size[0]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1, &GCaps.max_work_group_size[1]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2, &GCaps.max_work_group_size[2]);
+ glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS,
+ &GCaps.max_shader_storage_buffer_bindings);
}
GCaps.shader_storage_buffer_objects_support = GLEW_ARB_shader_storage_buffer_object;
/* GL specific capabilities. */