| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <memory> |
| 7 |
#include <string> |
| 8 |
#include <string_view> |
| 9 |
|
| 10 |
#include "Common/CommonTypes.h" |
| 11 |
#include "Common/GL/GLExtensions/GLExtensions.h" |
| 12 |
#include "VideoCommon/AbstractShader.h" |
| 13 |
|
| 14 |
namespace OGL |
| 15 |
{ |
| 16 |
class OGLShader final : public AbstractShader |
| 17 |
{ |
| 18 |
public: |
| 19 |
explicit OGLShader(ShaderStage stage, GLenum gl_type, GLuint gl_id, std::string source, |
| 20 |
std::string name); |
| 21 |
explicit OGLShader(GLuint gl_compute_program_id, std::string source, std::string name); |
| 22 |
~OGLShader() override; |
| 23 |
|
| 24 |
u64 GetID() const { return m_id; } |
| 25 |
GLenum GetGLShaderType() const { return m_type; } |
| 26 |
GLuint GetGLShaderID() const { return m_gl_id; } |
| 27 |
GLuint GetGLComputeProgramID() const { return m_gl_compute_program_id; } |
| 28 |
const std::string& GetSource() const { return m_source; } |
| 29 |
|
| 30 |
static std::unique_ptr<OGLShader> CreateFromSource(ShaderStage stage, std::string_view source, |
| 31 |
VideoCommon::ShaderIncluder* shader_includer, |
| 32 |
std::string_view name); |
| 33 |
|
| 34 |
private: |
| 35 |
u64 m_id; |
| 36 |
GLenum m_type; |
| 37 |
GLuint m_gl_id = 0; |
| 38 |
GLuint m_gl_compute_program_id = 0; |
| 39 |
std::string m_source; |
| 40 |
std::string m_name; |
| 41 |
}; |
| 42 |
|
| 43 |
} |