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>2022-03-26 13:51:23 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-03-26 15:16:01 +0300
commit6073b6b874e4b5fa990153dfbaa04dac5d884094 (patch)
tree74c58c4bc92b46630aa5b816d14e2bcd1073c1f5 /source/blender/gpu/intern/gpu_shader_create_info.cc
parentab97add5fa125aa8322b4ceacc070d01104f72a5 (diff)
GPU: ShaderBuilder: Skip shader compilation for unsupported shaders.
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader_create_info.cc')
-rw-r--r--source/blender/gpu/intern/gpu_shader_create_info.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_shader_create_info.cc b/source/blender/gpu/intern/gpu_shader_create_info.cc
index aef1984687d..0d26f17ede5 100644
--- a/source/blender/gpu/intern/gpu_shader_create_info.cc
+++ b/source/blender/gpu/intern/gpu_shader_create_info.cc
@@ -264,9 +264,14 @@ bool gpu_shader_create_info_compile_all()
{
using namespace blender::gpu;
int success = 0;
+ int skipped = 0;
int total = 0;
for (ShaderCreateInfo *info : g_create_infos->values()) {
if (info->do_static_compilation_) {
+ if (GPU_compute_shader_support() == false && info->compute_source_ != nullptr) {
+ skipped++;
+ continue;
+ }
total++;
GPUShader *shader = GPU_shader_create_from_info(
reinterpret_cast<const GPUShaderCreateInfo *>(info));
@@ -322,12 +327,11 @@ bool gpu_shader_create_info_compile_all()
GPU_shader_free(shader);
}
}
- printf("===============================\n");
- printf("Shader Test compilation result: \n");
- printf("%d Total\n", total);
- printf("%d Passed\n", success);
- printf("%d Failed\n", total - success);
- printf("===============================\n");
+ printf("Shader Test compilation result: %d / %d passed", success, total);
+ if (skipped > 0) {
+ printf(" (skipped %d for compatibility reasons)", skipped);
+ }
+ printf("\n");
return success == total;
}