mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-01 16:02:39 +00:00
Add geometry shader generator for stereo 3D.
This commit is contained in:
parent
6670cacddc
commit
b005f61a2e
13 changed files with 209 additions and 25 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue