public override bool Register(ref RenderPassBuilder builder, ref Resolver resolver) { var resources = resolver.GetComponent <PipelineResources>(); builder.MarkUsage(resources.SceneColor, ResourceState.CopySource); return(true); }
public override bool Register(ref RenderPassBuilder builder, ref Resolver resolver) { var color = builder.GetInput <TextureHandle>(); var settings = resolver.GetComponent <RenderSettings>(); builder.MarkUsage(color, settings.Msaa.IsMultiSampled ? ResourceState.ResolveSource : ResourceState.CopySource); return(true); }
public override bool Register(ref RenderPassBuilder builder, ref Resolver resolver) { var resources = resolver.GetComponent <PipelineResources>(); var settings = resolver.GetComponent <PipelineSettings>(); if (settings.Msaa.IsMultiSampled) { resources.SampledOutput = builder.CreatePrimaryOutputRelativeTexture( TextureDesc.CreateRenderTargetDesc(DataFormat.R8G8B8A8UnsignedNormalized, Rgba128.CornflowerBlue), ResourceState.ResolveDestination, debugName: nameof(resources.SampledOutput) ); resolver.SetComponent(resources); builder.MarkUsage(resources.SceneColor, ResourceState.ResolveSource); return(true); } else { resolver.SetComponent(resources); resources.SampledOutput = resources.SceneColor; return(false); } }