Skip to content

Commit

Permalink
Merge pull request #148 from Techjar/vive_1_7_10
Browse files Browse the repository at this point in the history
Added a few profiler sections, fixed some redundant naming
  • Loading branch information
jrbudda authored Jun 27, 2016
2 parents 9cb2805 + 309eee2 commit 8e619df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
22 changes: 13 additions & 9 deletions patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell;
@@ -150,2988 +168,4763 @@
@@ -150,2988 +168,4767 @@
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.WorldInfo;
Expand Down Expand Up @@ -3003,6 +3003,7 @@
+ }
+ clearGLError();
+
+ this.mcProfiler.startSection("setup");
+ this.framebufferMc.bindFramebuffer(true); //draw to eye texture.
+
+ this.currentEye = this.stereoProvider.eyeRenderOrder(eye);
Expand Down Expand Up @@ -3038,6 +3039,7 @@
+ if (Reflector.FMLCommonHandler_instance.exists()) {
+ fmlCommonHandler = Reflector.call(Reflector.FMLCommonHandler_instance, new Object[0]);
+ }
+ this.mcProfiler.endSection();
+
+ if (!this.skipRenderWorld)
+ {
Expand All @@ -3047,7 +3049,7 @@
+ Reflector.callVoid(fmlCommonHandler, Reflector.FMLCommonHandler_onRenderTickStart, new Object[]{this.timer.renderPartialTicks});
+ }
+ }
+ this.mcProfiler.startSection("updateCameraAndRender:" + currentEye.ordinal());
+ this.mcProfiler.startSection("updateCameraAndRender");
+
+ ///THIS IS WHERE EVERYTHING IS RENDERED
+ this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
Expand All @@ -3063,31 +3065,33 @@
+ }
+
+
+ this.mcProfiler.startSection("postProcessing:" + currentEye.ordinal());
+ this.mcProfiler.startSection("postProcessing");
+ GL11.glPushMatrix();
+ doPostProcessing(frameIndex, this.currentEye);
+ GL11.glPopMatrix();
+ this.mcProfiler.endSection();
+
+ GL11.glPushMatrix();
+ //GL11.glPushMatrix();
+ //this.entityRenderer.func_152430_c(this.timer.renderPartialTicks); // <-- TODO: What does this do? Some sort of stream status overlay? REENABLE, move to GUI FBO?
+ GL11.glPopMatrix();
+ //GL11.glPopMatrix();
+
+ this.mcProfiler.startSection("framebufferDraw");
+ framebufferEye.bindFramebuffer(true); //draw to eye tex
+ framebuffer.framebufferRender(framebufferEye.framebufferWidth, framebufferEye.framebufferHeight);
+ this.mcProfiler.endSection();
+
+ this.mcProfiler.startSection("OpenGL Finish:" + currentEye.ordinal());
+ //this.mcProfiler.startSection("OpenGL Finish");
+ // GL11.glFinish();
+ this.mcProfiler.endSection();
+ //this.mcProfiler.endSection();
+
+ this.mcProfiler.startSection("compositorSubmit:" + currentEye.ordinal());
+ this.mcProfiler.startSection("compositorSubmit");
+ if(this.stereoProvider.isStereo())
+ this.stereoProvider.endFrame(this.currentEye);
+ else
+ this.stereoProvider.endFrame();
+ this.mcProfiler.endSection();
+
+ this.mcProfiler.startSection("Mirror:" + currentEye.ordinal());
+ this.mcProfiler.startSection("mirror");
+ shouldupdate = copyToMirror(this.currentEye);
+ this.mcProfiler.endSection();
+
Expand Down
8 changes: 6 additions & 2 deletions src/com/mtbs3d/minecrift/provider/MCOpenVR.java
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ public boolean initOpenVRControlPanel()

public static void poll(long frameIndex)
{
Minecraft.getMinecraft().mcProfiler.startSection("input");
pollInputEvents();

updateControllerButtonState();
Expand All @@ -471,13 +472,15 @@ public static void poll(long frameIndex)
processTouchpadSampleBuffer();

// GUI controls
Minecraft.getMinecraft().mcProfiler.endStartSection("gui");
if( mc.currentScreen != null )
{
processGui();
}

Minecraft.getMinecraft().mcProfiler.endStartSection("updatePose");
updatePose();

Minecraft.getMinecraft().mcProfiler.endSection();
}

static GuiTextField keyboardGui;
Expand Down Expand Up @@ -1348,7 +1351,9 @@ private static void updatePose()
if ( vrsystem == null || vrCompositor == null )
return;

Minecraft.getMinecraft().mcProfiler.startSection("waitForPoses");
vrCompositor.WaitGetPoses.apply(hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount, null, 0);
Minecraft.getMinecraft().mcProfiler.endSection();

for (int nDevice = 0; nDevice < JOpenVRLibrary.k_unMaxTrackedDeviceCount; ++nDevice )
{
Expand Down Expand Up @@ -1390,7 +1395,6 @@ private static void updatePose()
}

updateAim();

}

/**
Expand Down

0 comments on commit 8e619df

Please sign in to comment.