Karma Engine
Loading...
Searching...
No Matches
VulkanShader.h
1#pragma once
2
3#include "krpch.h"
4
5#include "Karma/Renderer/Shader.h"
6#include "glslang/Public/ShaderLang.h"
7#include "Karma/KarmaUtilities.h"
8
9namespace Karma
10{
11 struct VulkanUniformBuffer;
12 class KARMA_API VulkanShader : public Shader
13 {
14 enum Vkenum
15 {
16 VK_VERTEX_SHADER = 0,
17 VK_FRAGMENT_SHADER
18 };
19
20 public:
21 VulkanShader(const std::string& vertexSrc, const std::string& fragmentSrc, std::shared_ptr<UniformBufferObject> ubo);
22 virtual ~VulkanShader() override;
23
24 virtual void Bind() const override;
25 virtual void UnBind() const override;
26
27 std::vector<uint32_t> Compile(const std::string& src, const std::string& source, EShLanguage lang);
28
29 virtual void GenerateUniformBufferObject() override {}
30 virtual void BindUniformBufferObject() override {}
31 void UploadUniformMat4(const std::string& name, const glm::mat4& matrix);
32
33 //Getters
34 const std::vector<uint32_t>& GetVertSpirV() const { return vertSpirV; }
35 const std::vector<uint32_t>& GetFragSpirV() const { return fragSpirV; }
36 std::shared_ptr<VulkanUniformBuffer> GetUniformBufferObject() const { return m_UniformBufferObject; }
37
38 private:
39 std::vector<uint32_t> vertSpirV;
40 std::vector<uint32_t> fragSpirV;
41 std::shared_ptr<VulkanUniformBuffer> m_UniformBufferObject;
42 };
43
44}
Definition Shader.h:11
Definition VulkanShader.h:13