Exemplo n.º 1
0
        internal D3D12GraphicsPipelineSignature(D3D12GraphicsDevice device, ReadOnlySpan <GraphicsPipelineInput> inputs, ReadOnlySpan <GraphicsPipelineResource> resources)
            : base(device, inputs, resources)
        {
            _d3d12RootSignature = new ValueLazy <Pointer <ID3D12RootSignature> >(CreateD3D12RootSignature);

            _ = _state.Transition(to: Initialized);
        }
Exemplo n.º 2
0
        internal D3D12GraphicsFence(D3D12GraphicsDevice device)
            : base(device)
        {
            _d3d12Fence            = new ValueLazy <Pointer <ID3D12Fence> >(CreateD3D12Fence);
            _d3d12FenceSignalEvent = new ValueLazy <HANDLE>(CreateEventHandle);

            _ = _state.Transition(to: Initialized);
        }
Exemplo n.º 3
0
            static D3D12GraphicsContext[] CreateContexts(D3D12GraphicsDevice device, int contextCount)
            {
                var contexts = new D3D12GraphicsContext[contextCount];

                for (var index = 0; index < contexts.Length; index++)
                {
                    contexts[index] = new D3D12GraphicsContext(device, index);
                }

                return(contexts);
            }
Exemplo n.º 4
0
        internal D3D12GraphicsContext(D3D12GraphicsDevice device, int index)
            : base(device, index)
        {
            _fence = new D3D12GraphicsFence(device);
            _waitForExecuteCompletionFence = new D3D12GraphicsFence(device);

            _d3d12CommandAllocator     = new ValueLazy <Pointer <ID3D12CommandAllocator> >(CreateD3D12CommandAllocator);
            _d3d12GraphicsCommandList  = new ValueLazy <Pointer <ID3D12GraphicsCommandList> >(CreateD3D12GraphicsCommandList);
            _d3d12RenderTargetView     = new ValueLazy <D3D12_CPU_DESCRIPTOR_HANDLE>(CreateD3D12RenderTargetDescriptor);
            _d3d12RenderTargetResource = new ValueLazy <Pointer <ID3D12Resource> >(CreateD3D12RenderTargetResource);

            _ = _state.Transition(to: Initialized);
        }
Exemplo n.º 5
0
        internal D3D12GraphicsShader(D3D12GraphicsDevice device, GraphicsShaderKind kind, ReadOnlySpan <byte> bytecode, string entryPointName)
            : base(device, kind, entryPointName)
        {
            var bytecodeLength = (nuint)bytecode.Length;

            _d3d12ShaderBytecode.pShaderBytecode = Allocate(bytecodeLength);
            _d3d12ShaderBytecode.BytecodeLength  = bytecodeLength;

            var destination = new Span <byte>(_d3d12ShaderBytecode.pShaderBytecode, (int)bytecodeLength);

            bytecode.CopyTo(destination);

            _ = _state.Transition(to: Initialized);
        }
 internal D3D12GraphicsMemoryAllocator(D3D12GraphicsDevice device, in GraphicsMemoryAllocatorSettings settings)
Exemplo n.º 7
0
 internal D3D12GraphicsTexture(D3D12GraphicsDevice device, GraphicsTextureKind kind, in GraphicsMemoryRegion <GraphicsMemoryBlock> blockRegion, GraphicsResourceCpuAccess cpuAccess, uint width, uint height, ushort depth)
Exemplo n.º 8
0
#pragma warning restore IDE0044

        internal D3D12GraphicsBuffer(D3D12GraphicsDevice device, GraphicsBufferKind kind, in GraphicsMemoryRegion <GraphicsMemoryBlock> blockRegion, GraphicsResourceCpuAccess cpuAccess)
Exemplo n.º 9
0
 internal D3D12GraphicsPrimitive(D3D12GraphicsDevice device, D3D12GraphicsPipeline pipeline, in GraphicsMemoryRegion <GraphicsResource> vertexBufferRegion, uint vertexBufferStride, in GraphicsMemoryRegion <GraphicsResource> indexBufferRegion, uint indexBufferStride, ReadOnlySpan <GraphicsMemoryRegion <GraphicsResource> > inputResourceRegion)
Exemplo n.º 10
0
 private protected D3D12GraphicsBuffer(D3D12GraphicsDevice device, GraphicsBufferKind kind, in GraphicsMemoryRegion <GraphicsMemoryBlock> blockRegion, GraphicsResourceCpuAccess cpuAccess)
Exemplo n.º 11
0
 private protected D3D12GraphicsMemoryBlock(D3D12GraphicsDevice device, D3D12GraphicsMemoryBlockCollection collection)
     : base(device, collection)
 {
     _d3d12Heap = new ValueLazy <Pointer <ID3D12Heap> >(CreateD3D12Heap);
 }
Exemplo n.º 12
0
#pragma warning restore IDE0044

        internal D3D12GraphicsMemoryBlock(D3D12GraphicsDevice device, D3D12GraphicsMemoryBlockCollection collection, ulong size)
            : base(device, collection)
        {
            ref readonly var allocatorSettings = ref collection.Allocator.Settings;
 internal D3D12GraphicsMemoryBlockCollection(D3D12GraphicsDevice device, D3D12GraphicsMemoryAllocator allocator, D3D12_HEAP_FLAGS d3d12HeapFlags, D3D12_HEAP_TYPE d3d12HeapType)
     : base(device, allocator)
 {
     _d3d12HeapFlags = d3d12HeapFlags;
     _d3d12HeapType  = d3d12HeapType;
 }
Exemplo n.º 14
0
 internal D3D12GraphicsPipeline(D3D12GraphicsDevice device, D3D12GraphicsPipelineSignature signature, D3D12GraphicsShader?vertexShader, D3D12GraphicsShader?pixelShader)
     : base(device, signature, vertexShader, pixelShader)
 {
     _d3d12PipelineState = new ValueLazy <Pointer <ID3D12PipelineState> >(CreateD3D12GraphicsPipelineState);
     _ = _state.Transition(to: Initialized);
 }