duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

vulkan_pipeline.h (1166B)


      1 // SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
      2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
      3 
      4 #include "gpu_device.h"
      5 #include "vulkan_loader.h"
      6 
      7 class VulkanDevice;
      8 
      9 class VulkanShader final : public GPUShader
     10 {
     11   friend VulkanDevice;
     12 
     13 public:
     14   ~VulkanShader() override;
     15 
     16   ALWAYS_INLINE VkShaderModule GetModule() const { return m_module; }
     17 
     18   void SetDebugName(std::string_view name) override;
     19 
     20 private:
     21   VulkanShader(GPUShaderStage stage, VkShaderModule mod);
     22 
     23   VkShaderModule m_module;
     24 };
     25 
     26 class VulkanPipeline final : public GPUPipeline
     27 {
     28   friend VulkanDevice;
     29 
     30 public:
     31   ~VulkanPipeline() override;
     32 
     33   ALWAYS_INLINE VkPipeline GetPipeline() const { return m_pipeline; }
     34   ALWAYS_INLINE Layout GetLayout() const { return m_layout; }
     35   ALWAYS_INLINE u8 GetVerticesPerPrimitive() const { return m_vertices_per_primitive; }
     36 
     37   void SetDebugName(std::string_view name) override;
     38 
     39 private:
     40   VulkanPipeline(VkPipeline pipeline, Layout layout, u8 vertices_per_primitive, RenderPassFlag render_pass_flags);
     41 
     42   VkPipeline m_pipeline;
     43   Layout m_layout;
     44   u8 m_vertices_per_primitive;
     45   RenderPassFlag m_render_pass_flags;
     46 };