1#ifndef _DIRECTX12_SHADER_H_
2#define _DIRECTX12_SHADER_H_
5#include <d3dcompiler.h>
24 bool compile(
const std::string& shaderPath)
override;
26 bool compile(
const std::string& vertPath,
27 const std::string& fragPath)
override;
41 bool compileShader(
const std::string& filePath,
42 const std::string& entryPoint,
43 const std::string& profile,
44 Microsoft::WRL::ComPtr<ID3DBlob>& blob);
46 Microsoft::WRL::ComPtr<ID3D12Device> m_device;
48 Microsoft::WRL::ComPtr<ID3DBlob> m_vertexShaderBlob;
49 Microsoft::WRL::ComPtr<ID3DBlob> m_pixelShaderBlob;
50 Microsoft::WRL::ComPtr<ID3D12PipelineState> m_pipelineState;
51 ID3D12GraphicsCommandList* m_commandList =
nullptr;
void bind() override
Binds the shader's cached PSO to the current command list.
void SetCommandList(ID3D12GraphicsCommandList *cmdList)
ID3DBlob * getVertexShaderBlob() const
ID3DBlob * getPixelShaderBlob() const
void SetPipelineState(Microsoft::WRL::ComPtr< ID3D12PipelineState > pso)
~DirectX12Shader() override
ID3D12PipelineState * GetPipelineState() const
DirectX12Shader(ID3D12Device *device)
bool compile(const std::string &shaderPath) override
Compiles the combined-path convention (vs_main/ps_main entry points) from a single HLSL file.
Backend-agnostic compiled shader program.
Backend-facing rendering layer shared by the four graphics backends.
Root namespace for everything the engine exposes.