SleakEngine 1.0.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)
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 18 of file DirectX12Shader.hpp.

Constructor & Destructor Documentation

◆ DirectX12Shader()

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

Definition at line 10 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 55 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 16 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 39 of file DirectX12Shader.cpp.

◆ GetPipelineState()

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

Definition at line 73 of file DirectX12Shader.cpp.

◆ getPixelShaderBlob()

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

Definition at line 65 of file DirectX12Shader.cpp.

◆ getVertexShaderBlob()

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

Definition at line 61 of file DirectX12Shader.cpp.

◆ SetCommandList()

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

Definition at line 77 of file DirectX12Shader.cpp.

◆ SetPipelineState()

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

Definition at line 69 of file DirectX12Shader.cpp.