diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-10-16 18:52:32 +0200 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-11-23 14:22:55 +0100 |
| commit | b005f61a2e8e34e9de10183d1fe6f873f7dd9133 (patch) | |
| tree | ff37bdf24c63fed58d0979de95dc41fdac55abdb /Source/Core/VideoBackends/OGL/ProgramShaderCache.h | |
| parent | 6670cacddcc6aacc17181409457c575c6539cace (diff) | |
Add geometry shader generator for stereo 3D.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/ProgramShaderCache.h')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/ProgramShaderCache.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h index dd376142be..7286ade6ef 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h @@ -9,6 +9,7 @@ #include "VideoBackends/OGL/GLUtil.h" #include "VideoCommon/PixelShaderGen.h" #include "VideoCommon/VertexShaderGen.h" +#include "VideoCommon/GeometryShaderGen.h" namespace OGL { @@ -18,10 +19,11 @@ class SHADERUID public: VertexShaderUid vuid; PixelShaderUid puid; + GeometryShaderUid guid; SHADERUID() {} - SHADERUID(const SHADERUID& r) : vuid(r.vuid), puid(r.puid) {} + SHADERUID(const SHADERUID& r) : vuid(r.vuid), puid(r.puid), guid(r.guid) {} bool operator <(const SHADERUID& r) const { @@ -34,12 +36,18 @@ public: if (vuid < r.vuid) return true; + if (r.vuid < vuid) + return false; + + if (guid < r.guid) + return true; + return false; } bool operator ==(const SHADERUID& r) const { - return puid == r.puid && vuid == r.vuid; + return puid == r.puid && vuid == r.vuid && guid == r.guid; } }; @@ -54,7 +62,7 @@ struct SHADER } GLuint glprogid; // opengl program id - std::string strvprog, strpprog; + std::string strvprog, strpprog, strgprog; void SetProgramVariables(); void SetProgramBindings(); @@ -83,7 +91,7 @@ public: static SHADER* SetShader(DSTALPHA_MODE dstAlphaMode, u32 components); static void GetShaderId(SHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 components); - static bool CompileShader(SHADER &shader, const char* vcode, const char* pcode); + static bool CompileShader(SHADER &shader, const char* vcode, const char* pcode, const char* gcode = nullptr); static GLuint CompileSingleShader(GLuint type, const char *code); static void UploadConstants(); @@ -104,6 +112,7 @@ private: static UidChecker<PixelShaderUid,PixelShaderCode> pixel_uid_checker; static UidChecker<VertexShaderUid,VertexShaderCode> vertex_uid_checker; + static UidChecker<GeometryShaderUid,ShaderCode> geometry_uid_checker; static u32 s_ubo_buffer_size; static s32 s_ubo_align; |
