Implement IShader and ISwapChain interfaces for D3D12 backend
- D3D12Shader now implements IShader interface with GetBytecode, GetBytecodeSize, GetType, GetInputLayout - D3D12SwapChain now implements ISwapChain interface with GetBackBuffer returning IResource* - Added D3D12Texture back buffer storage to SwapChain - Fixed ISwapChain const correctness (GetCurrentBackBufferIndex, GetBackBuffer) - main.cpp: use GetD3D12Bytecode() instead of GetBytecode() for PSO creation
This commit is contained in:
@@ -57,7 +57,7 @@ void D3D12Shader::Shutdown() {
|
||||
m_error.Reset();
|
||||
}
|
||||
|
||||
const D3D12_SHADER_BYTECODE D3D12Shader::GetBytecode() const {
|
||||
const D3D12_SHADER_BYTECODE D3D12Shader::GetD3D12Bytecode() const {
|
||||
D3D12_SHADER_BYTECODE bytecode = {};
|
||||
if (m_bytecode) {
|
||||
bytecode.pShaderBytecode = m_bytecode->GetBufferPointer();
|
||||
@@ -66,5 +66,27 @@ const D3D12_SHADER_BYTECODE D3D12Shader::GetBytecode() const {
|
||||
return bytecode;
|
||||
}
|
||||
|
||||
const void* D3D12Shader::GetBytecode() const {
|
||||
if (m_bytecode) {
|
||||
return m_bytecode->GetBufferPointer();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
size_t D3D12Shader::GetBytecodeSize() const {
|
||||
if (m_bytecode) {
|
||||
return m_bytecode->GetBufferSize();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const InputLayoutDesc& D3D12Shader::GetInputLayout() const {
|
||||
return m_inputLayout;
|
||||
}
|
||||
|
||||
ShaderType D3D12Shader::GetType() const {
|
||||
return m_type;
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user