Add pipeline layout support for graphics PSOs

This commit is contained in:
2026-03-25 23:49:48 +08:00
parent 83cd2fa591
commit 605ef56e16
8 changed files with 166 additions and 16 deletions

View File

@@ -0,0 +1,25 @@
#pragma once
#include "../RHIPipelineLayout.h"
namespace XCEngine {
namespace RHI {
class OpenGLPipelineLayout : public RHIPipelineLayout {
public:
OpenGLPipelineLayout() = default;
~OpenGLPipelineLayout() override = default;
bool Initialize(const RHIPipelineLayoutDesc& desc) override;
void Shutdown() override;
void* GetNativeHandle() override { return m_initialized ? this : nullptr; }
const RHIPipelineLayoutDesc& GetDesc() const { return m_desc; }
private:
RHIPipelineLayoutDesc m_desc = {};
bool m_initialized = false;
};
} // namespace RHI
} // namespace XCEngine

View File

@@ -9,6 +9,8 @@
namespace XCEngine {
namespace RHI {
class RHIPipelineLayout;
struct Viewport {
float topLeftX;
float topLeftY;
@@ -310,6 +312,7 @@ struct GraphicsPipelineDesc {
ShaderCompileDesc vertexShader;
ShaderCompileDesc fragmentShader;
ShaderCompileDesc geometryShader;
RHIPipelineLayout* pipelineLayout = nullptr;
InputLayoutDesc inputLayout;
RasterizerDesc rasterizerState;
BlendDesc blendState;