ShaderGen: Work around issue with glslang and dynamic vector subscripts
Seems that vec[eye] will select vec.x no matter what the value of eye is.
This commit is contained in:
parent
7f3a876aae
commit
75e4e42e56
|
@ -240,7 +240,8 @@ ShaderCode GenerateGeometryShaderCode(APIType ApiType, const geometry_shader_uid
|
|||
// the depth value. This results in objects at a distance smaller than the convergence
|
||||
// distance to seemingly appear in front of the screen.
|
||||
// This formula is based on page 13 of the "Nvidia 3D Vision Automatic, Best Practices Guide"
|
||||
out.Write("\tf.pos.x += " I_STEREOPARAMS "[eye] * (f.pos.w - " I_STEREOPARAMS "[2]);\n");
|
||||
out.Write("\tfloat hoffset = (eye == 0) ? " I_STEREOPARAMS ".x : " I_STEREOPARAMS ".y;\n");
|
||||
out.Write("\tf.pos.x += hoffset * (f.pos.w - " I_STEREOPARAMS ".z);\n");
|
||||
}
|
||||
|
||||
if (uid_data->primitive_type == PRIMITIVE_LINES)
|
||||
|
|
Loading…
Reference in New Issue