// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Vulkan renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_VULKANRENDERER_VULKANDEVICE_HPP #define NAZARA_VULKANRENDERER_VULKANDEVICE_HPP #include #include #include #include #include namespace Nz { class NAZARA_VULKANRENDERER_API VulkanDevice : public RenderDevice, public Vk::Device { public: inline VulkanDevice(Vk::Instance& instance, const RenderDeviceFeatures& enabledFeatures, RenderDeviceInfo renderDeviceInfo); VulkanDevice(const VulkanDevice&) = delete; VulkanDevice(VulkanDevice&&) = delete; ///TODO? ~VulkanDevice(); const RenderDeviceInfo& GetDeviceInfo() const override; const RenderDeviceFeatures& GetEnabledFeatures() const override; std::shared_ptr InstantiateBuffer(BufferType type, UInt64 size, BufferUsageFlags usageFlags, const void* initialData = nullptr) override; std::shared_ptr InstantiateCommandPool(QueueType queueType) override; std::shared_ptr InstantiateComputePipeline(ComputePipelineInfo pipelineInfo) override; std::shared_ptr InstantiateFramebuffer(unsigned int width, unsigned int height, const std::shared_ptr& renderPass, const std::vector>& attachments) override; std::shared_ptr InstantiateRenderPass(std::vector attachments, std::vector subpassDescriptions, std::vector subpassDependencies) override; std::shared_ptr InstantiateRenderPipeline(RenderPipelineInfo pipelineInfo) override; std::shared_ptr InstantiateRenderPipelineLayout(RenderPipelineLayoutInfo pipelineLayoutInfo) override; std::shared_ptr InstantiateShaderModule(nzsl::ShaderStageTypeFlags stages, const nzsl::Ast::Module& shaderModule, const nzsl::ShaderWriter::States& states) override; std::shared_ptr InstantiateShaderModule(nzsl::ShaderStageTypeFlags stages, ShaderLanguage lang, const void* source, std::size_t sourceSize, const nzsl::ShaderWriter::States& states) override; std::shared_ptr InstantiateSwapchain(WindowHandle windowHandle, const Vector2ui& windowSize, const SwapchainParameters& parameters) override; std::shared_ptr InstantiateTexture(const TextureInfo& params) override; std::shared_ptr InstantiateTexture(const TextureInfo& params, const void* initialData, bool buildMipmaps, unsigned int srcWidth = 0, unsigned int srcHeight = 0) override; std::shared_ptr InstantiateTextureSampler(const TextureSamplerInfo& params) override; bool IsTextureFormatSupported(PixelFormat format, TextureUsage usage) const override; void WaitForIdle() override; VulkanDevice& operator=(const VulkanDevice&) = delete; VulkanDevice& operator=(VulkanDevice&&) = delete; ///TODO? private: RenderDeviceFeatures m_enabledFeatures; RenderDeviceInfo m_renderDeviceInfo; }; } #include #endif // NAZARA_VULKANRENDERER_VULKANDEVICE_HPP