Skip to content

Commit

Permalink
fix stupid crash, because rubidium/embeddium don't ship regular joml
Browse files Browse the repository at this point in the history
  • Loading branch information
fayer3 committed Sep 15, 2024
1 parent 34b3d04 commit 1e26ae6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import net.irisshaders.iris.api.v0.IrisApi;
import org.joml.Matrix4f;
import org.joml.Matrix4fc;
import org.vivecraft.client.Xplat;
import org.vivecraft.client_vr.settings.VRSettings;
import org.vivecraft.client_xr.render_pass.RenderPassManager;
Expand Down Expand Up @@ -101,12 +100,12 @@ public static void unregisterDHIfThere(Object pipeline) {
/**
* needed, because some Iris versions return a Matrix4f and others a Matrix4fc, which causes a runtime exception
* @param source CapturedRenderingState INSTANCE to call this on
* @return Matrix4fc current projection matrix
* @return Matrix4fc as Object, current projection matrix
*/
public static Matrix4fc getGbufferProjection(Object source) {
public static Object getGbufferProjection(Object source) {
if (init() && dhPresent) {
try {
return (Matrix4fc) CapturedRenderingState_getGbufferProjection.invoke(source);
return CapturedRenderingState_getGbufferProjection.invoke(source);
} catch (IllegalAccessException | InvocationTargetException e) {
VRSettings.logger.error("Vivecraft: couldn't get iris gbuffer projection matrix: {}", e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class IrisDHCompatVRMixin {
ClientDataHolderVR.getInstance().currentPass == RenderPass.RIGHT) {
// VR projections are not centered

Matrix4fc vrProjection = IrisHelper.getGbufferProjection(CapturedRenderingState.INSTANCE);
Matrix4fc vrProjection = (Matrix4fc) IrisHelper.getGbufferProjection(CapturedRenderingState.INSTANCE);
Matrix4f dhProjection = cir.getReturnValue();

dhProjection.m00(vrProjection.m00());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class IrisLodRenderProgramVRMixin {
ClientDataHolderVR.getInstance().currentPass == RenderPass.RIGHT) {
// VR projections are not centered

Matrix4fc vrProjection = IrisHelper.getGbufferProjection(CapturedRenderingState.INSTANCE);
Matrix4fc vrProjection = (Matrix4fc) IrisHelper.getGbufferProjection(CapturedRenderingState.INSTANCE);

Matrix4f dhProjectionMutable = new Matrix4f(dhProjection);

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version=1.19.2
enabled_platforms=fabric,forge

archives_base_name=vivecraft
mod_version=1.1.12
mod_version=1.1.13
maven_group=org.vivecraft

architectury_version=6.5.90
Expand Down

0 comments on commit 1e26ae6

Please sign in to comment.