From b005f61a2e8e34e9de10183d1fe6f873f7dd9133 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Thu, 16 Oct 2014 18:52:32 +0200 Subject: Add geometry shader generator for stereo 3D. --- Source/Core/VideoBackends/OGL/ProgramShaderCache.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/ProgramShaderCache.h') 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 pixel_uid_checker; static UidChecker vertex_uid_checker; + static UidChecker geometry_uid_checker; static u32 s_ubo_buffer_size; static s32 s_ubo_align; -- cgit v1.2.3 From d7804a4d3e9a5cbc5347148a0e37aa669e9e9e2b Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Thu, 30 Oct 2014 23:40:03 +0100 Subject: Cosmetics. --- Source/Core/VideoBackends/OGL/ProgramShaderCache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoBackends/OGL/ProgramShaderCache.h') diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h index 7286ade6ef..5c95313fa7 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h @@ -7,9 +7,9 @@ #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" -#include "VideoCommon/GeometryShaderGen.h" namespace OGL { -- cgit v1.2.3