-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bd6d61
commit e19ec61
Showing
15 changed files
with
196 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/CompilationCacheMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2023 - 2024 dima_dencep. | ||
* | ||
* Licensed under the Open Software License, Version 3.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* | ||
* You may obtain a copy of the License at | ||
* https://spdx.org/licenses/OSL-3.0.txt | ||
*/ | ||
|
||
package org.redlance.dima_dencep.mods.rrls.mixins.workaround; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import com.llamalad7.mixinextras.sugar.Cancellable; | ||
import net.minecraft.client.renderer.CompiledShaderProgram; | ||
import net.minecraft.client.renderer.ShaderManager; | ||
import net.minecraft.client.renderer.ShaderProgram; | ||
import org.redlance.dima_dencep.mods.rrls.ConfigExpectPlatform; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(ShaderManager.CompilationCache.class) | ||
public class CompilationCacheMixin { | ||
@WrapOperation( | ||
method = "getOrCompileProgram", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/renderer/ShaderManager$CompilationCache;compileProgram(Lnet/minecraft/client/renderer/ShaderProgram;)Lnet/minecraft/client/renderer/CompiledShaderProgram;" | ||
) | ||
) | ||
private CompiledShaderProgram rrls$supressMissingCache(ShaderManager.CompilationCache instance, ShaderProgram shaderProgram, Operation<CompiledShaderProgram> original, @Cancellable CallbackInfoReturnable<?> cir) { | ||
CompiledShaderProgram compiledShaderProgram = original.call(instance, shaderProgram); | ||
|
||
if (compiledShaderProgram == null && ConfigExpectPlatform.hideType().forceClose()) { | ||
cir.setReturnValue(null); | ||
} | ||
|
||
return compiledShaderProgram; | ||
} | ||
|
||
@Inject( | ||
method = { | ||
"loadPostChain", | ||
"compileProgram" | ||
}, | ||
at = @At( | ||
value = "NEW", | ||
target = "(Ljava/lang/String;)Lnet/minecraft/client/renderer/ShaderManager$CompilationException;" | ||
), | ||
cancellable = true | ||
) | ||
private void rrls$supressMissingCache(CallbackInfoReturnable<?> cir) { | ||
if (ConfigExpectPlatform.hideType().forceClose()) { | ||
cir.setReturnValue(null); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
...src/main/java/org/redlance/dima_dencep/mods/rrls/mixins/workaround/VertexBufferMixin.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.