Exemplo n.º 1
0
        private void ProcessCopyStage(CommandList cl, RenderCommandQueueItem command)
        {
            var source = _surfaceManager.RetrieveSurface(command.Texture0, new GpuSurfaceType[] { GpuSurfaceType.Internal });
            var target = _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.Internal });

            _copyStageRenderer.Render(cl, source, target);
        }
Exemplo n.º 2
0
        public void DispatchToRenderStage(IBlurStageModel stage, CommandList cl, RenderCommandQueueItem command)
        {
            var surface = _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.Internal });
            var source  = _surfaceManager.RetrieveSurface(command.Texture0, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });

            _blur2DEffectStageRenderer.Render(cl, stage, source, surface);
        }
Exemplo n.º 3
0
        public void DispatchToRenderStage(IDrawStageModel stage, CommandList cl, RenderCommandQueueItem command)
        {
            stage.Process();
            var surface = _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.Internal });
            var camera  = _cameraManager.RetrieveCameraModel2D(command.Camera);

            _drawStageRenderer.Render(cl, stage, surface, camera);
        }
Exemplo n.º 4
0
        public void DispatchToRenderStage(IMixStageModel stage, CommandList cl, RenderCommandQueueItem command)
        {
            var surface = _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.Internal });
            var t0      = command.Camera == 0UL ? null : _surfaceManager.RetrieveSurface(command.Camera, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });
            var t1      = command.Texture0 == 0UL ? null : _surfaceManager.RetrieveSurface(command.Texture0, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });
            var t2      = command.Texture1 == 0UL ? null : _surfaceManager.RetrieveSurface(command.Texture1, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });
            var t3      = command.SpareId0 == 0UL ? null : _surfaceManager.RetrieveSurface(command.SpareId0, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });
            var mix     = command.SpareId1 == 0UL ? null : _surfaceManager.RetrieveSurface(command.SpareId1, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });

            _mixRenderer.Render(cl, stage, mix, t0, t1, t2, t3, surface);
        }
Exemplo n.º 5
0
        private void ProcessRenderStage(CommandList cl, RenderCommandQueueItem command)
        {
            var renderStageModel = _renderStageManager.RetrieveStageModel(command.Stage);

            if (renderStageModel == null)
            {
                _frameworkMessenger.Report("Unable to process render stage command: error trying to locate model (null or wrong type");
                return;
            }

            renderStageModel.SendToRenderStage(_renderStageVisitor, cl, command);
        }
Exemplo n.º 6
0
        private void ClearDepthTarget(CommandList cl, RenderCommandQueueItem command)
        {
            var surface = _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.RenderTarget | GpuSurfaceType.Internal });

            //Textures (not rendertargets) are fixed content and do not have depth
            //Cannot use internal render targets as reserved for framework use

            if (surface == null)
            {
                return;
            }

            cl.SetFramebuffer(surface.Framebuffer);
            cl.ClearDepthStencil(1.0f);
        }
Exemplo n.º 7
0
        public void Process(CommandList cl, RenderCommandQueueItem command)
        {
            switch (command.Type)
            {
            case RenderCommandType.ClearColourTarget:
                ClearColourTarget(cl, command);
                break;

            case RenderCommandType.ClearDepthTarget:
                ClearDepthTarget(cl, command);
                break;

            case RenderCommandType.SetViewport:
                ProcessSetViewport(cl, command);
                break;

            case RenderCommandType.ClearViewport:
                ProcessClearViewport(cl, command);
                break;

            case RenderCommandType.DrawStage:
            case RenderCommandType.ColourEffectStage:
            case RenderCommandType.BloomEffectStage:
            case RenderCommandType.Blur1DEffectStage:
            case RenderCommandType.Blur2DEffectStage:
            case RenderCommandType.StyleEffect:
            case RenderCommandType.MeshRender:
            case RenderCommandType.DistortionStage:
            case RenderCommandType.MixStage:
            case RenderCommandType.CustomShader:
            case RenderCommandType.CustomVeldrid:
            case RenderCommandType.GpuToCpuSurfaceCopy:
                ProcessRenderStage(cl, command);
                break;

            case RenderCommandType.CopyStage:
                ProcessCopyStage(cl, command);
                break;
            }
        }
Exemplo n.º 8
0
 public void SendToRenderStage(IRenderStageVisitor visitor, CommandList cl, RenderCommandQueueItem command) => visitor.DispatchToRenderStage(this, cl, command);
Exemplo n.º 9
0
        public void DispatchToRenderStage(ISurfaceCopyStageModel stage, CommandList cl, RenderCommandQueueItem command)
        {
            var source = command.Surface == 0UL ? null : _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.Internal });

            _surfaceCopyStageRenderer.Render(cl, stage, source);
        }
Exemplo n.º 10
0
        public void DispatchToRenderStage(IMeshRenderStageModel stage, CommandList cl, RenderCommandQueueItem command)
        {
            var surface = _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.Internal });
            var source  = _surfaceManager.RetrieveSurface(command.Texture0, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });
            var camera  = _cameraManager.RetrieveCameraModel3D(command.Camera);

            _meshRenderer.Render(cl, stage, source, surface, camera);
        }
Exemplo n.º 11
0
        public void DispatchToRenderStage(IDistortionStageModel stage, CommandList cl, RenderCommandQueueItem command)
        {
            stage.Process();
            var surface = _surfaceManager.RetrieveSurface(command.Surface, new GpuSurfaceType[] { GpuSurfaceType.Texture, GpuSurfaceType.Internal });
            var source  = _surfaceManager.RetrieveSurface(command.Texture0, new GpuSurfaceType[] { GpuSurfaceType.SwapChainOutput, GpuSurfaceType.Internal });
            var camera  = _cameraManager.RetrieveCameraModel2D(command.Camera);

            _distortionEffectStageRenderer.Render(cl, stage, source, surface, camera);
        }
Exemplo n.º 12
0
 private void ProcessClearViewport(CommandList cl, RenderCommandQueueItem command)
 {
     _viewportManager.ClearActiveViewport();
 }
Exemplo n.º 13
0
 private void ProcessSetViewport(CommandList cl, RenderCommandQueueItem command)
 {
     _viewportManager.SetActiveViewport(command.SpareId0);
 }