Fix #146057: Crash when using Convolve node with GPU
The Convolve node crashes Blender if used with GPU device and its output is used multiple times. This is due to a use after free error, because the convolve node ignored the reference count of the output. To fix this, we retain the reference count of the output by stealing the data of the GPU-side buffer, instead of overwriting the output with it. Pull Request: https://projects.blender.org/blender/blender/pulls/146074
This commit is contained in:
@@ -252,7 +252,8 @@ void convolve(Context &context,
|
||||
});
|
||||
|
||||
if (context.use_gpu()) {
|
||||
output = output_cpu.upload_to_gpu(true);
|
||||
Result output_gpu = output_cpu.upload_to_gpu(true);
|
||||
output.steal_data(output_gpu);
|
||||
output_cpu.release();
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user