From 3bb4597b2d23d5d3afd342c432b5cac23e2ba755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Tue, 15 Mar 2022 16:07:32 +0100 Subject: 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 --- source/blender/blenkernel/intern/subdiv_modifier.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/intern/subdiv_modifier.c') 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; -- cgit v1.2.3