Hubris Engine Dev
A Project to learn and get into Game Engine developement.
 
Loading...
Searching...
No Matches
vkShader.cpp
Go to the documentation of this file.
1#include "pch.h"
3
4using namespace Hubris::Graphics;
5
6Hubris::Graphics::Vulkan::vkShader::vkShader(const std::vector<char> &code, ShaderStage _stage) : Shader(_stage) {
7 VkShaderModuleCreateInfo createInfo{};
8 createInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
9 createInfo.codeSize = code.size();
10 createInfo.pCode = reinterpret_cast<const uint32_t *>(code.data());
11
12 if (vkCreateShaderModule(vkBackend::GetDevice(), &createInfo, nullptr, &shaderModule) != VK_SUCCESS)
13 {
14 Logger::Log("failed to create shader module!");
16 return;
17 }
18 Logger::Log("{} Shader created succesfully.", VertexStageToString(_stage));
19
20}
Shader(const ShaderStage &type) noexcept
Definition Shader.h:43
static VkDevice GetDevice() noexcept
Definition vkBackend.h:252
vkShader(const std::vector< char > &code, ShaderStage stage)
Definition vkShader.cpp:6
static void Log(const char *message)
Definition Logger.h:104
Contains all graphics related classes and structs.
Definition Format.h:9
constexpr const char * VertexStageToString(const Hubris::Graphics::ShaderStage stage) noexcept
Definition Shader.h:18