| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <memory> |
| 7 |
|
| 8 |
#include "VideoBackends/OGL/ProgramShaderCache.h" |
| 9 |
#include "VideoCommon/AbstractPipeline.h" |
| 10 |
#include "VideoCommon/RenderState.h" |
| 11 |
|
| 12 |
namespace OGL |
| 13 |
{ |
| 14 |
class OGLPipeline final : public AbstractPipeline |
| 15 |
{ |
| 16 |
public: |
| 17 |
explicit OGLPipeline(const AbstractPipelineConfig& config, const GLVertexFormat* vertex_format, |
| 18 |
RasterizationState rasterization_state, DepthState depth_state, |
| 19 |
BlendingState blending_state, PipelineProgram* program, GLenum gl_primitive); |
| 20 |
~OGLPipeline() override; |
| 21 |
|
| 22 |
const GLVertexFormat* GetVertexFormat() const { return m_vertex_format; } |
| 23 |
const RasterizationState& GetRasterizationState() const { return m_rasterization_state; } |
| 24 |
const DepthState& GetDepthState() const { return m_depth_state; } |
| 25 |
const BlendingState& GetBlendingState() const { return m_blending_state; } |
| 26 |
const PipelineProgram* GetProgram() const { return m_program; } |
| 27 |
bool HasVertexInput() const { return m_vertex_format != nullptr; } |
| 28 |
GLenum GetGLPrimitive() const { return m_gl_primitive; } |
| 29 |
CacheData GetCacheData() const override; |
| 30 |
static std::unique_ptr<OGLPipeline> Create(const AbstractPipelineConfig& config, |
| 31 |
const void* cache_data, size_t cache_data_size); |
| 32 |
|
| 33 |
private: |
| 34 |
const GLVertexFormat* m_vertex_format; |
| 35 |
RasterizationState m_rasterization_state; |
| 36 |
DepthState m_depth_state; |
| 37 |
BlendingState m_blending_state; |
| 38 |
PipelineProgram* m_program; |
| 39 |
GLenum m_gl_primitive; |
| 40 |
}; |
| 41 |
|
| 42 |
} |