SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
VulkanShaderModule.h
1#pragma once
2
3#include "spark/render/Resource.h"
4#include "spark/render/Shader.h"
5#include "spark/render/ShaderStages.h"
6#include "spark/render/vk/Export.h"
7#include "spark/render/vk/Helpers.h"
8
9#include <filesystem>
10#include <string>
11
12SPARK_FWD_DECLARE_VK_HANDLE(VkShaderModule)
13
14namespace spark::render::vk
15{
16 class VulkanDevice;
17
21 class SPARK_RENDER_VK_EXPORT VulkanShaderModule final : public IShaderModule, public Resource<VkShaderModule>
22 {
23 public:
34 explicit VulkanShaderModule(const VulkanDevice& device, ShaderStage type, const std::filesystem::path& file_name, const std::string& entry_point = "main");
35
46 explicit VulkanShaderModule(const VulkanDevice& device, ShaderStage type, std::istream& stream, const std::string& name, const std::string& entry_point = "main");
47 ~VulkanShaderModule() override;
48
49 VulkanShaderModule(const VulkanShaderModule& other) = delete;
50 VulkanShaderModule(VulkanShaderModule&& other) noexcept = delete;
51 VulkanShaderModule& operator=(const VulkanShaderModule& other) = delete;
52 VulkanShaderModule& operator=(VulkanShaderModule&& other) noexcept = delete;
53
58 [[nodiscard]] const std::string& byteCode() const noexcept;
59
61 [[nodiscard]] ShaderStage stage() const noexcept override;
62
64 [[nodiscard]] const std::string& fileName() const noexcept override;
65
67 [[nodiscard]] const std::string& entryPoint() const noexcept override;
68
69 private:
70 struct Impl;
71 std::unique_ptr<Impl> m_impl;
72 };
73}
Interface representing a single shader module, a part of a IShaderProgram.
Definition Shader.h:18
Definition Resource.h:34
Vulkan implementation of IGraphicsDevice.
Definition VulkanDevice.h:25
Vulkan implementation of a IShaderModule.
Definition VulkanShaderModule.h:22
Definition VulkanShaderModule.cpp:40