Fix render image output flags when UAV is not supported

This commit is contained in:
Wojtek Figat
2026-03-24 17:00:26 +01:00
parent 45feda8f07
commit ce5dd6bc16

View File

@@ -542,7 +542,7 @@ void RenderInner(SceneRenderTask* task, RenderContext& renderContext, RenderCont
// Get the light accumulation buffer
auto outputFormat = renderContext.Buffers->GetOutputFormat();
auto tempFlags = GPUTextureFlags::ShaderResource | GPUTextureFlags::RenderTarget;
if (GPUDevice::Instance->Limits.HasCompute)
if (GPUDevice::Instance->Limits.HasCompute && EnumHasAllFlags(GPUDevice::Instance->GetFormatFeatures(outputFormat).Support, FormatSupport::UnorderedAccessReadOnly | FormatSupport::UnorderedAccessWriteOnly))
tempFlags |= GPUTextureFlags::UnorderedAccess;
auto tempDesc = GPUTextureDescription::New2D(renderContext.Buffers->GetWidth(), renderContext.Buffers->GetHeight(), outputFormat, tempFlags);
auto lightBuffer = RenderTargetPool::Get(tempDesc);