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

D3D12 vertex+pixel shader pair; the pipeline state object itself is owned per-shader. More...

#include <DirectX12Shader.hpp>

Inheritance diagram for Sleak::RenderEngine::DirectX12Shader:

Public Member Functions

 DirectX12Shader (ID3D12Device *device)
 ~DirectX12Shader () override
void bind () override
 Binds the shader's cached PSO to the current command list.
bool compile (const std::string &shaderPath) override
 Compiles the combined-path convention (vs_main/ps_main entry points) from a single HLSL file.
bool compile (const std::string &vertPath, const std::string &fragPath) override
 Compiles separate vertex and pixel shader HLSL files.
ID3D12PipelineState * GetPipelineState () const
ID3DBlob * getPixelShaderBlob () const
ID3DBlob * getVertexShaderBlob () const
void SetCommandList (ID3D12GraphicsCommandList *cmdList)
void SetPipelineState (Microsoft::WRL::ComPtr< ID3D12PipelineState > pso)
void SetRenderer (DirectX12Renderer *renderer)
 Routes bind() through the renderer so pass-specific PSOs are respected.
Public Member Functions inherited from Sleak::RenderEngine::Shader
virtual ~Shader ()=default

Detailed Description

D3D12 vertex+pixel shader pair; the pipeline state object itself is owned per-shader.

Definition at line 19 of file DirectX12Shader.hpp.

Constructor & Destructor Documentation

◆ DirectX12Shader()

Sleak::RenderEngine::DirectX12Shader::DirectX12Shader ( ID3D12Device * device)

Definition at line 14 of file DirectX12Shader.cpp.

◆ ~DirectX12Shader()

Sleak::RenderEngine::DirectX12Shader::~DirectX12Shader ( )
overridedefault

Member Function Documentation

◆ bind()

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

Binds the shader's cached PSO to the current command list.

Implements Sleak::RenderEngine::Shader.

Definition at line 59 of file DirectX12Shader.cpp.

◆ compile() [1/2]

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

Compiles the combined-path convention (vs_main/ps_main entry points) from a single HLSL file.

Implements Sleak::RenderEngine::Shader.

Definition at line 20 of file DirectX12Shader.cpp.

◆ compile() [2/2]

bool Sleak::RenderEngine::DirectX12Shader::compile ( const std::string & vertPath,
const std::string & fragPath )
overridevirtual

Compiles separate vertex and pixel shader HLSL files.

Implements Sleak::RenderEngine::Shader.

Definition at line 43 of file DirectX12Shader.cpp.

◆ GetPipelineState()

ID3D12PipelineState * Sleak::RenderEngine::DirectX12Shader::GetPipelineState ( ) const

Definition at line 80 of file DirectX12Shader.cpp.

◆ getPixelShaderBlob()

ID3DBlob * Sleak::RenderEngine::DirectX12Shader::getPixelShaderBlob ( ) const

Definition at line 72 of file DirectX12Shader.cpp.

◆ getVertexShaderBlob()

ID3DBlob * Sleak::RenderEngine::DirectX12Shader::getVertexShaderBlob ( ) const

Definition at line 68 of file DirectX12Shader.cpp.

◆ SetCommandList()

void Sleak::RenderEngine::DirectX12Shader::SetCommandList ( ID3D12GraphicsCommandList * cmdList)

Definition at line 84 of file DirectX12Shader.cpp.

◆ SetPipelineState()

void Sleak::RenderEngine::DirectX12Shader::SetPipelineState ( Microsoft::WRL::ComPtr< ID3D12PipelineState > pso)

Definition at line 76 of file DirectX12Shader.cpp.

◆ SetRenderer()

void Sleak::RenderEngine::DirectX12Shader::SetRenderer ( DirectX12Renderer * renderer)

Routes bind() through the renderer so pass-specific PSOs are respected.

Definition at line 88 of file DirectX12Shader.cpp.