Fix: GPU: Compiling python gpu shaders

Compiling of graphics shaders via gpu crashed. The vulkan backend found
a compute source and continued the evaluation as if it was a compute
shader.

The compute source was added by the preprocessor that wraps the shader
source. Even empty sources were wrapped. Detection based on empty shader
sources failed.

This is not a Vulkan only issue as other platforms would have similar issues when
creating a compute shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/133036
This commit is contained in:
Jeroen Bakker 2025-01-14 10:51:24 +01:00
parent 8a199dc77f
commit 9091085277

View file

@ -297,6 +297,9 @@ GPUShader *GPU_shader_create_from_info(const GPUShaderCreateInfo *_info)
static std::string preprocess_source(StringRefNull original)
{
if (original.is_empty()) {
return original;
}
gpu::shader::Preprocessor processor;
return processor.process(original);
};