diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-03-26 13:51:23 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-26 15:16:01 +0300 |
commit | 6073b6b874e4b5fa990153dfbaa04dac5d884094 (patch) | |
tree | 74c58c4bc92b46630aa5b816d14e2bcd1073c1f5 /source/blender/gpu | |
parent | ab97add5fa125aa8322b4ceacc070d01104f72a5 (diff) |
GPU: ShaderBuilder: Skip shader compilation for unsupported shaders.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_shader_create_info.cc | 16 | ||||
-rw-r--r-- | source/blender/gpu/opengl/gl_shader.cc | 2 |
2 files changed, 11 insertions, 7 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; } diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 5a55a2e8020..71428633d79 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -868,7 +868,7 @@ GLuint GLShader::create_shader_stage(GLenum gl_stage, MutableSpan<const char *> { GLuint shader = glCreateShader(gl_stage); if (shader == 0) { - fprintf(stderr, "GLShader: Error: Could not create shader object."); + fprintf(stderr, "GLShader: Error: Could not create shader object.\n"); return 0; } |