Fix #131602: Workbench: Incorrect texture usage depth of field.

Depth of field attaches the half res and scene color texture, but
doesn't provide the correct usage flags. This resulted in validation
errors in Metal & Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/131655
This commit is contained in:
Jeroen Bakker
2024-12-10 11:06:51 +01:00
parent ccab973556
commit 0ac92bda89

View File

@@ -107,7 +107,7 @@ void DofPass::init(const SceneState &scene_state)
int2 half_res = scene_state.resolution / 2;
half_res = {max_ii(half_res.x, 1), max_ii(half_res.y, 1)};
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ;
eGPUTextureUsage usage = GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT;
source_tx_.ensure_2d(GPU_RGBA16F, half_res, usage, nullptr, 3);
source_tx_.ensure_mip_views();
source_tx_.filter_mode(true);