Skip to content

Commit

Permalink
Fixed memeory leak, EndDrawInfo was missing
Browse files Browse the repository at this point in the history
  • Loading branch information
hh79 committed Feb 26, 2020
1 parent 2bc4a17 commit 8b15566
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/gl/stereo3d/gl_openvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class VRControllerModel : public FModel
auto* di = FDrawInfo::StartDrawInfo(r_viewpoint, nullptr);
FGLModelRenderer renderer(di, -1);
BuildVertexBuffer(&renderer);

di->EndDrawInfo();
return true;
}
loadState = LOADSTATE_ERROR;
Expand Down Expand Up @@ -733,19 +733,28 @@ void OpenVREyePose::AdjustHud() const
true,
pitch_offset);
di->ApplyVPUniforms();
di->EndDrawInfo();
}

void OpenVREyePose::AdjustBlend(FDrawInfo *di) const
{
bool new_di = false;
if (di == nullptr)
{
di = FDrawInfo::StartDrawInfo(r_viewpoint, nullptr);
new_di = true;
}

VSMatrix& proj = di->VPUniforms.mProjectionMatrix;
proj.loadIdentity();
proj.translate(-1, 1, 0);
proj.scale(2.0 / SCREENWIDTH, -2.0 / SCREENHEIGHT, -1.0);
di->ApplyVPUniforms();

if (new_di)
{
di->EndDrawInfo();
}
}

OpenVRMode::OpenVRMode(OpenVREyePose eyes[2])
Expand Down

0 comments on commit 8b15566

Please sign in to comment.