Esempio n. 1
0
        internal VulkanGraphicsPipeline(VulkanGraphicsDevice device, VulkanGraphicsPipelineSignature signature, VulkanGraphicsShader?vertexShader, VulkanGraphicsShader?pixelShader)
            : base(device, signature, vertexShader, pixelShader)
        {
            _vulkanPipeline = new ValueLazy <VkPipeline>(CreateVulkanPipeline);

            _ = _state.Transition(to: Initialized);
        }
Esempio n. 2
0
        internal VulkanGraphicsFence(VulkanGraphicsDevice device)
            : base(device)
        {
            _vulkanFence = new ValueLazy <VkFence>(CreateVulkanFence);

            _ = _state.Transition(to: Initialized);
        }
        internal VulkanGraphicsPipelineSignature(VulkanGraphicsDevice device, ReadOnlySpan <GraphicsPipelineInput> inputs, ReadOnlySpan <GraphicsPipelineResource> resources)
            : base(device, inputs, resources)
        {
            _vulkanDescriptorPool      = new ValueLazy <VkDescriptorPool>(CreateVulkanDescriptorPool);
            _vulkanDescriptorSet       = new ValueLazy <VkDescriptorSet>(CreateVulkanDescriptorSet);
            _vulkanDescriptorSetLayout = new ValueLazy <VkDescriptorSetLayout>(CreateVulkanDescriptorSetLayout);
            _vulkanPipelineLayout      = new ValueLazy <VkPipelineLayout>(CreateVulkanPipelineLayout);

            _ = _state.Transition(to: Initialized);
        }
            static VulkanGraphicsContext[] CreateGraphicsContexts(VulkanGraphicsDevice device, int contextCount)
            {
                var contexts = new VulkanGraphicsContext[contextCount];

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

                return(contexts);
            }
        internal VulkanGraphicsContext(VulkanGraphicsDevice device, int index)
            : base(device, index)
        {
            _fence = new VulkanGraphicsFence(device);
            _waitForExecuteCompletionFence = new VulkanGraphicsFence(device);

            _vulkanCommandBuffer      = new ValueLazy <VkCommandBuffer>(CreateVulkanCommandBuffer);
            _vulkanCommandPool        = new ValueLazy <VkCommandPool>(CreateVulkanCommandPool);
            _vulkanFramebuffer        = new ValueLazy <VkFramebuffer>(CreateVulkanFramebuffer);
            _vulkanSwapChainImageView = new ValueLazy <VkImageView>(CreateVulkanSwapChainImageView);

            _ = _state.Transition(to: Initialized);
        }
Esempio n. 6
0
        internal VulkanGraphicsShader(VulkanGraphicsDevice device, GraphicsShaderKind kind, ReadOnlySpan <byte> bytecode, string entryPointName)
            : base(device, kind, entryPointName)
        {
            var bytecodeLength = (nuint)bytecode.Length;

            _vulkanShaderModuleCreateInfo.sType    = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
            _vulkanShaderModuleCreateInfo.codeSize = bytecodeLength;
            _vulkanShaderModuleCreateInfo.pCode    = AllocateArray <uint>(AlignUp(bytecodeLength, SizeOf <nuint>()));

            var destination = new Span <byte>(_vulkanShaderModuleCreateInfo.pCode, (int)bytecodeLength);

            bytecode.CopyTo(destination);

            _vulkanShaderModule = new ValueLazy <VkShaderModule>(CreateVulkanShaderModule);

            _ = _state.Transition(to: Initialized);
        }
Esempio n. 7
0
 internal VulkanGraphicsPrimitive(VulkanGraphicsDevice device, VulkanGraphicsPipeline pipeline, in GraphicsMemoryRegion <GraphicsResource> vertexBufferView, uint vertexBufferStride, in GraphicsMemoryRegion <GraphicsResource> indexBufferView, uint indexBufferStride, ReadOnlySpan <GraphicsMemoryRegion <GraphicsResource> > inputResourceRegions = default)
 private protected VulkanGraphicsMemoryBlock(VulkanGraphicsDevice device, VulkanGraphicsMemoryBlockCollection collection)
     : base(device, collection)
 {
     _vulkanDeviceMemory = new ValueLazy <VkDeviceMemory>(CreateVulkanDeviceMemory);
 }
Esempio n. 9
0
#pragma warning restore IDE0044

        internal VulkanGraphicsTexture(VulkanGraphicsDevice device, GraphicsTextureKind kind, in GraphicsMemoryRegion <GraphicsMemoryBlock> blockRegion, GraphicsResourceCpuAccess cpuAccess, uint width, uint height, ushort depth, VkImage vulkanImage)
Esempio n. 10
0
#pragma warning restore IDE0044

        internal VulkanGraphicsMemoryBlock(VulkanGraphicsDevice device, VulkanGraphicsMemoryBlockCollection collection, ulong size)
            : base(device, collection)
        {
            ref readonly var allocatorSettings = ref collection.Allocator.Settings;
Esempio n. 11
0
 private protected VulkanGraphicsBuffer(VulkanGraphicsDevice device, GraphicsBufferKind kind, in GraphicsMemoryRegion <GraphicsMemoryBlock> blockRegion, GraphicsResourceCpuAccess cpuAccess, VkBuffer vulkanBuffer)
Esempio n. 12
0
 internal VulkanGraphicsMemoryAllocator(VulkanGraphicsDevice device, in GraphicsMemoryAllocatorSettings settings)
Esempio n. 13
0
 internal VulkanGraphicsMemoryBlockCollection(VulkanGraphicsDevice device, VulkanGraphicsMemoryAllocator allocator, uint memoryTypeIndex)
     : base(device, allocator)
 {
     _vulkanMemoryTypeIndex = memoryTypeIndex;
 }