Vulkan: Detect Vulkan Incompatibility When Running OpenGL/MTL

Now that all shaders have been converted to be Vulkan Compatible it is
safe to test for incompatibility when running in OpenGL or MTL.

This detection is only done when blender is compiled in debug mode.
This commit is contained in:
Jeroen Bakker
2023-08-18 08:44:30 +02:00
parent accc80c73b
commit 8477f62ba1
2 changed files with 8 additions and 5 deletions

View File

@@ -232,6 +232,14 @@ std::string ShaderCreateInfo::check_error() const
}
}
#ifdef DEBUG
if (!this->is_vulkan_compatible()) {
error += this->name_ +
" contains a stage interface using an instance name and mixed interpolation modes. "
"This is not compatible with Vulkan and need to be adjusted.\n";
}
#endif
return error;
}

View File

@@ -663,11 +663,6 @@ bool VKShader::finalize(const shader::ShaderCreateInfo *info)
if (compilation_failed_) {
return false;
}
#if DEBUG
if (!info->is_vulkan_compatible()) {
std::cout << "'" << info->name_ << "' stage interfaces are not compatible with Vulkan.\n";
}
#endif
VKShaderInterface *vk_interface = new VKShaderInterface();
vk_interface->init(*info);