feat(RHI): 实现 RHIPipelineState 抽象基类
This commit is contained in:
@@ -85,5 +85,11 @@ D3D12_INPUT_ELEMENT_DESC D3D12PipelineState::CreateInputElement(
|
||||
return CreateInputElement(semanticName, semanticIndex, format, inputSlot, D3D12_APPEND_ALIGNED_ELEMENT);
|
||||
}
|
||||
|
||||
void D3D12PipelineState::Bind() {
|
||||
}
|
||||
|
||||
void D3D12PipelineState::Unbind() {
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
|
||||
@@ -268,5 +268,25 @@ void OpenGLPipelineState::DetachShader() {
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
void OpenGLPipelineState::Shutdown() {
|
||||
m_program = 0;
|
||||
m_programAttached = false;
|
||||
}
|
||||
|
||||
void OpenGLPipelineState::Bind() {
|
||||
if (m_programAttached) {
|
||||
glUseProgram(m_program);
|
||||
}
|
||||
Apply();
|
||||
}
|
||||
|
||||
void OpenGLPipelineState::Unbind() {
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
void* OpenGLPipelineState::GetNativeHandle() {
|
||||
return reinterpret_cast<void*>(static_cast<uintptr_t>(m_program));
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user