Ejemplo n.º 1
0
 public unsafe bool Init(RenderPassDesc desc, SwapChain swapChain, DepthStencil depthStencil)
 {
     InitBase(ref desc, 1);
     using (var descNative = new RenderPassDesc_NativeInterop(ref desc))
     {
         return(Orbital_Video_D3D12_RenderPass_Init_WithSwapChain(handle, &descNative, swapChain.handle, depthStencil.handle, depthStencil.stencilUsage) != 0);
     }
 }
 public override void Dispose()
 {
     if (depthStencil != null)
     {
         depthStencil.Dispose();
         depthStencil = null;
     }
     base.Dispose();
 }
 public bool Init(int width, int height, TextureFormat format, byte[] data, StencilUsage stencilUsage, DepthStencilFormat depthStencilFormat, DepthStencilMode depthStencilMode, bool allowRandomAccess, MultiGPUNodeResourceVisibility nodeVisibility)
 {
     depthStencil = new DepthStencil(deviceD3D12, stencilUsage, depthStencilMode);
     if (!depthStencil.Init(width, height, depthStencilFormat, MSAALevel.Disabled))
     {
         return(false);
     }
     return(Init(width, height, format, data, true, allowRandomAccess, MSAALevel.Disabled, nodeVisibility));
 }
Ejemplo n.º 4
0
 public unsafe bool Init(RenderPassDesc desc, RenderTexture2D renderTexture, DepthStencil depthStencil)
 {
     InitBase(ref desc, 1);
     using (var descNative = new RenderPassDesc_NativeInterop(ref desc))
     {
         var renderTextureHandle = renderTexture.handle;
         var usage = renderTexture.usage;
         return(Orbital_Video_D3D12_RenderPass_Init_WithRenderTextures(handle, &descNative, &renderTextureHandle, &usage, 1, depthStencil.handle, depthStencil.stencilUsage) != 0);
     }
 }
Ejemplo n.º 5
0
        public override DepthStencilBase CreateDepthStencil(int width, int height, DepthStencilFormat format, StencilUsage stencilUsage, DepthStencilMode mode, MSAALevel msaaLevel)
        {
            var abstraction = new DepthStencil(this, stencilUsage, mode);

            if (!abstraction.Init(width, height, format, msaaLevel))
            {
                abstraction.Dispose();
                throw new Exception("Failed to create DepthStencil");
            }
            return(abstraction);
        }
Ejemplo n.º 6
0
        public bool Init(WindowBase window, int bufferCount, bool fullscreen, SwapChainFormat format, StencilUsage stencilUsage, DepthStencilFormat depthStencilFormat, DepthStencilMode depthStencilMode, SwapChainVSyncMode vSyncMode)
        {
            var size = window.GetSize(WindowSizeType.WorkingArea);

            depthStencilD3D12 = new DepthStencil(deviceD3D12, stencilUsage, depthStencilMode);
            depthStencil      = depthStencilD3D12;
            if (!depthStencilD3D12.Init(size.width, size.height, depthStencilFormat, MSAALevel.Disabled))
            {
                return(false);
            }
            return(Init(window, bufferCount, fullscreen, format, vSyncMode));
        }
Ejemplo n.º 7
0
        public override void Dispose()
        {
            depthStencil = null;
            if (depthStencilD3D12 != null)
            {
                depthStencilD3D12.Dispose();
                depthStencilD3D12 = null;
            }

            if (handle != IntPtr.Zero)
            {
                Orbital_Video_D3D12_SwapChain_Dispose(handle);
                handle = IntPtr.Zero;
            }
        }
Ejemplo n.º 8
0
        public unsafe bool Init(RenderPassDesc desc, RenderTexture2D[] renderTextures, DepthStencil depthStencil)
        {
            ValidateMSAARenderTextures(renderTextures);
            int length = renderTextures.Length;

            InitBase(ref desc, length);
            using (var descNative = new RenderPassDesc_NativeInterop(ref desc))
            {
                var renderTextureHandles = stackalloc IntPtr[length];
                var usages = stackalloc RenderTextureUsage[length];
                for (int i = 0; i != length; ++i)
                {
                    renderTextureHandles[i] = renderTextures[i].handle;
                    usages[i] = renderTextures[i].usage;
                }
                return(Orbital_Video_D3D12_RenderPass_Init_WithRenderTextures(handle, &descNative, renderTextureHandles, usages, (uint)length, depthStencil.handle, depthStencil.stencilUsage) != 0);
            }
        }