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:07:32 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-03-15 18:07:32 +0300
commit3bb4597b2d23d5d3afd342c432b5cac23e2ba755 (patch)
treead5a4b2493c565775576651771334cc6af6de9fa /source/blender/blenkernel/intern/subdiv_modifier.c
parent45b637e1e79f817b182031246233c29a4344d159 (diff)
Disable GPU subdivision if the maximum number of SSBO binding is reached
Some old platforms and drivers have limited amount of SSBO binding per compute shader. This disables GPU subdivision if we cannot possibly bind all required buffers within this limit. For now the maximum number of buffers used by the GPU code is hardcoded, but will be programmatically detected when shader creation is automated. Ref D14337
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv_modifier.c')
-rw-r--r--source/blender/blenkernel/intern/subdiv_modifier.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_modifier.c b/source/blender/blenkernel/intern/subdiv_modifier.c
index 34dfdaf7595..83772f153d9 100644
--- a/source/blender/blenkernel/intern/subdiv_modifier.c
+++ b/source/blender/blenkernel/intern/subdiv_modifier.c
@@ -77,6 +77,10 @@ static bool is_subdivision_evaluation_possible_on_gpu(void)
return false;
}
+ if (GPU_max_shader_storage_buffer_bindings() < MAX_GPU_SUBDIV_SSBOS) {
+ return false;
+ }
+
const int available_evaluators = openSubdiv_getAvailableEvaluators();
if ((available_evaluators & OPENSUBDIV_EVALUATOR_GLSL_COMPUTE) == 0) {
return false;