Fix #130555: Vulkan: Crash when using legacy gpu API

Add-ons can still use the legacy API that only works on OpenGL. Vulkan
however was crashing as there is no shader create info available.

Adding a pre-check when finalizing shaders on availability of shader
create info.

Pull Request: https://projects.blender.org/blender/blender/pulls/130660
This commit is contained in:
Jeroen Bakker
2024-11-21 11:14:11 +01:00
parent 1d1811c54b
commit 5665a9d712

View File

@@ -583,6 +583,11 @@ bool VKShader::finalize(const shader::ShaderCreateInfo *info)
if (compilation_failed) {
return false;
}
/* Add-ons that still use old API will crash as the shader create info isn't available.
* See #130555 */
if (info == nullptr) {
return false;
}
if (do_geometry_shader_injection(info)) {
std::string source = workaround_geometry_shader_source_create(*info);