SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::RenderEngine::VulkanShader Class Reference

Vulkan vertex+fragment shader pair, loaded from precompiled SPIR-V modules. More...

#include <VulkanShader.hpp>

Inheritance diagram for Sleak::RenderEngine::VulkanShader:

Public Member Functions

 VulkanShader (VkDevice dev)
 ~VulkanShader ()
virtual void bind () override
 No-op: Vulkan binds shader stages via pipeline creation, not a runtime bind call.
virtual bool compile (const std::string &shaderPath) override
 Loads the combined-path convention's .vert.spv/.frag.spv pair.
virtual bool compile (const std::string &vert, const std::string &frag) override
 Loads separate vertex and fragment SPIR-V modules.
bool compileVertexOnly (const std::string &vertPath)
 Loads only the vertex stage (used for depth-only/shadow pipelines with no fragment shader).
VkPipelineShaderStageCreateInfo GetFragInfo ()
VkShaderModule GetFragmentShader ()
VkPipelineShaderStageCreateInfo GetVertexInfo ()
VkShaderModule GetVertexShader ()
VkShaderModule LoadSPIRV (const char *path)
 Reads a .spv file and creates a VkShaderModule from it.
Public Member Functions inherited from Sleak::RenderEngine::Shader
virtual ~Shader ()=default

Detailed Description

Vulkan vertex+fragment shader pair, loaded from precompiled SPIR-V modules.

Definition at line 12 of file VulkanShader.hpp.

Constructor & Destructor Documentation

◆ VulkanShader()

Sleak::RenderEngine::VulkanShader::VulkanShader ( VkDevice dev)
inline

Definition at line 14 of file VulkanShader.hpp.

◆ ~VulkanShader()

Sleak::RenderEngine::VulkanShader::~VulkanShader ( )

Definition at line 11 of file VulkanShader.cpp.

Member Function Documentation

◆ bind()

void Sleak::RenderEngine::VulkanShader::bind ( )
overridevirtual

No-op: Vulkan binds shader stages via pipeline creation, not a runtime bind call.

Implements Sleak::RenderEngine::Shader.

Definition at line 89 of file VulkanShader.cpp.

◆ compile() [1/2]

bool Sleak::RenderEngine::VulkanShader::compile ( const std::string & shaderPath)
overridevirtual

Loads the combined-path convention's .vert.spv/.frag.spv pair.

Implements Sleak::RenderEngine::Shader.

Definition at line 18 of file VulkanShader.cpp.

◆ compile() [2/2]

bool Sleak::RenderEngine::VulkanShader::compile ( const std::string & vert,
const std::string & frag )
overridevirtual

Loads separate vertex and fragment SPIR-V modules.

Implements Sleak::RenderEngine::Shader.

Definition at line 28 of file VulkanShader.cpp.

◆ compileVertexOnly()

bool Sleak::RenderEngine::VulkanShader::compileVertexOnly ( const std::string & vertPath)

Loads only the vertex stage (used for depth-only/shadow pipelines with no fragment shader).

Definition at line 62 of file VulkanShader.cpp.

◆ GetFragInfo()

VkPipelineShaderStageCreateInfo Sleak::RenderEngine::VulkanShader::GetFragInfo ( )
inline

Definition at line 32 of file VulkanShader.hpp.

◆ GetFragmentShader()

VkShaderModule Sleak::RenderEngine::VulkanShader::GetFragmentShader ( )
inline

Definition at line 29 of file VulkanShader.hpp.

◆ GetVertexInfo()

VkPipelineShaderStageCreateInfo Sleak::RenderEngine::VulkanShader::GetVertexInfo ( )
inline

Definition at line 31 of file VulkanShader.hpp.

◆ GetVertexShader()

VkShaderModule Sleak::RenderEngine::VulkanShader::GetVertexShader ( )
inline

Definition at line 28 of file VulkanShader.hpp.

◆ LoadSPIRV()

VkShaderModule Sleak::RenderEngine::VulkanShader::LoadSPIRV ( const char * path)

Reads a .spv file and creates a VkShaderModule from it.

Definition at line 83 of file VulkanShader.cpp.