mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
GeometryShaderGen: Allow stereoscopy to be disabled.
Will facilitate future use of this generator for other purposes.
This commit is contained in:
parent
80616c6e9e
commit
272ea90ca5
@ -44,6 +44,7 @@ static inline void GenerateGeometryShader(T& out, u32 components, API_TYPE ApiTy
|
|||||||
if (ApiType == API_OPENGL)
|
if (ApiType == API_OPENGL)
|
||||||
{
|
{
|
||||||
// Insert layout parameters
|
// Insert layout parameters
|
||||||
|
uid_data->stereo = g_ActiveConfig.bStereo;
|
||||||
out.Write("layout(triangles, invocations = %d) in;\n", g_ActiveConfig.bStereo ? 2 : 1);
|
out.Write("layout(triangles, invocations = %d) in;\n", g_ActiveConfig.bStereo ? 2 : 1);
|
||||||
out.Write("layout(triangle_strip, max_vertices = 3) out;\n");
|
out.Write("layout(triangle_strip, max_vertices = 3) out;\n");
|
||||||
}
|
}
|
||||||
@ -83,6 +84,7 @@ static inline void GenerateGeometryShader(T& out, u32 components, API_TYPE ApiTy
|
|||||||
out.Write("\tfor (int i = 0; i < gl_in.length(); ++i) {\n");
|
out.Write("\tfor (int i = 0; i < gl_in.length(); ++i) {\n");
|
||||||
out.Write("\t\to = v[i];\n");
|
out.Write("\t\to = v[i];\n");
|
||||||
out.Write("\t\teye = gl_InvocationID;\n");
|
out.Write("\t\teye = gl_InvocationID;\n");
|
||||||
|
if (g_ActiveConfig.bStereo)
|
||||||
out.Write("\t\to.pos = float4(dot(" I_STEREOPROJECTION"[eye * 4 + 0], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 1], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 2], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 3], v[i].rawpos)); \n");
|
out.Write("\t\to.pos = float4(dot(" I_STEREOPROJECTION"[eye * 4 + 0], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 1], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 2], v[i].rawpos), dot(" I_STEREOPROJECTION"[eye * 4 + 3], v[i].rawpos)); \n");
|
||||||
out.Write("\t\tgl_Position = o.pos;\n");
|
out.Write("\t\tgl_Position = o.pos;\n");
|
||||||
out.Write("\t\tgl_Layer = eye;\n");
|
out.Write("\t\tgl_Layer = eye;\n");
|
||||||
|
@ -13,7 +13,6 @@ struct geometry_shader_uid_data
|
|||||||
{
|
{
|
||||||
u32 NumValues() const { return sizeof(geometry_shader_uid_data); }
|
u32 NumValues() const { return sizeof(geometry_shader_uid_data); }
|
||||||
|
|
||||||
u32 components : 23;
|
|
||||||
u32 stereo : 1;
|
u32 stereo : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user