Ejemplo n.º 1
0
        protected override void CreateImpl()
        {
            SharpDX.Direct3D12.DescriptorHeapDescription descDx = new SharpDX.Direct3D12.DescriptorHeapDescription
            {
                DescriptorCount = (int) Desc.NumResourceDescriptors,
                NodeMask = 0
            };

            switch (Desc.Type)
            {
                case Descriptor.ResourceDescriptorType.ShaderResource:
                    descDx.Type = DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView;
                    descDx.Flags = DescriptorHeapFlags.ShaderVisible;
                    break;
                case Descriptor.ResourceDescriptorType.Sampler:
                    descDx.Type = DescriptorHeapType.Sampler;
                    descDx.Flags = DescriptorHeapFlags.ShaderVisible;
                    break;
                case Descriptor.ResourceDescriptorType.RenderTarget:
                    descDx.Type = DescriptorHeapType.RenderTargetView;
                    descDx.Flags = DescriptorHeapFlags.None;
                    break;
                case Descriptor.ResourceDescriptorType.DepthStencil:
                    descDx.Type = DescriptorHeapType.DepthStencilView;
                    descDx.Flags = DescriptorHeapFlags.None;
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            DescriptorHeapDX12 = ((Device) Device).DeviceD3D12.CreateDescriptorHeap(descDx);
        }
Ejemplo n.º 2
0
        protected override void CreateImpl()
        {
            SharpDX.Direct3D12.DescriptorHeapDescription descDx = new SharpDX.Direct3D12.DescriptorHeapDescription
            {
                DescriptorCount = (int)Desc.NumResourceDescriptors,
                NodeMask        = 0
            };

            switch (Desc.Type)
            {
            case Descriptor.ResourceDescriptorType.ShaderResource:
                descDx.Type  = DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView;
                descDx.Flags = DescriptorHeapFlags.ShaderVisible;
                break;

            case Descriptor.ResourceDescriptorType.Sampler:
                descDx.Type  = DescriptorHeapType.Sampler;
                descDx.Flags = DescriptorHeapFlags.ShaderVisible;
                break;

            case Descriptor.ResourceDescriptorType.RenderTarget:
                descDx.Type  = DescriptorHeapType.RenderTargetView;
                descDx.Flags = DescriptorHeapFlags.None;
                break;

            case Descriptor.ResourceDescriptorType.DepthStencil:
                descDx.Type  = DescriptorHeapType.DepthStencilView;
                descDx.Flags = DescriptorHeapFlags.None;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            DescriptorHeapDX12 = ((Device)Device).DeviceD3D12.CreateDescriptorHeap(descDx);
        }