Beispiel #1
0
        public override bool Register(ref RenderPassBuilder builder, ref Resolver resolver)
        {
            var resources = resolver.GetComponent <PipelineResources>();

            builder.MarkUsage(resources.SceneColor, ResourceState.CopySource);

            return(true);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
            }
        }