diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-11-28 11:45:38 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-11-28 11:45:38 -0600 |
| commit | ce059769f6bf13118366f77fea926727efcf4510 (patch) | |
| tree | 8ea7f2014f086f1df0f661697863c5b72d633a5b /Source/Core/VideoBackends/OGL/ProgramShaderCache.h | |
| parent | 0e3d20c349ead263a630463beeb4335aaf512e42 (diff) | |
| parent | 6d51455195e95a1bb97eb263fcd3423c757f59e7 (diff) | |
Merge pull request #1439 from Armada651/ogl-stereo-3d
OGL: Stereoscopic 3D Support
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 cab5107eea..d1e3a5ee54 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h @@ -7,6 +7,7 @@ #include "Common/LinearDiskCache.h" #include "Core/ConfigManager.h" #include "VideoBackends/OGL/GLUtil.h" +#include "VideoCommon/GeometryShaderGen.h" #include "VideoCommon/PixelShaderGen.h" #include "VideoCommon/VertexShaderGen.h" @@ -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; |
