From 9d99817d84137a05c60e98611d1c7efc26cd02d2 Mon Sep 17 00:00:00 2001 From: liach <7806504+liach@users.noreply.github.com> Date: Wed, 19 May 2021 19:45:15 +0700 Subject: [PATCH] framebuffer, screenshots, gl info (#2402) Signed-off-by: liach Co-authored-by: liach --- .../blaze3d/platform/GlDebugInfo.mapping | 2 ++ .../blaze3d/systems/RenderCallStorage.mapping | 25 +++++++++++++++ .../minecraft/client/MinecraftClient.mapping | 28 +++++++++++++++++ .../minecraft/client/gl/ShaderEffect.mapping | 4 +++ .../client/gl/SimpleFramebuffer.mapping | 6 ++++ .../client/gl/WindowFramebuffer.mapping | 30 ++++++++++++++++++ .../client/render/GameRenderer.mapping | 4 +++ .../client/render/WorldRenderer.mapping | 1 + .../client/util/GlInfoConsumer.mapping | 11 +++++++ .../minecraft/client/util/GlfwUtil.mapping | 4 +++ ...hotUtils.mapping => Screenshooter.mapping} | 31 ++++++++++++++++++- .../minecraft/unused/FixedDataSetter.mapping | 10 ------ .../net/minecraft/util/math/Matrix4f.mapping | 7 +++++ 13 files changed, 152 insertions(+), 11 deletions(-) create mode 100644 mappings/net/minecraft/client/gl/SimpleFramebuffer.mapping create mode 100644 mappings/net/minecraft/client/gl/WindowFramebuffer.mapping create mode 100644 mappings/net/minecraft/client/util/GlInfoConsumer.mapping rename mappings/net/minecraft/client/util/{ScreenshotUtils.mapping => Screenshooter.mapping} (50%) delete mode 100644 mappings/net/minecraft/unused/FixedDataSetter.mapping diff --git a/mappings/com/mojang/blaze3d/platform/GlDebugInfo.mapping b/mappings/com/mojang/blaze3d/platform/GlDebugInfo.mapping index bddb9f7f6f..a2f6dcbf2a 100644 --- a/mappings/com/mojang/blaze3d/platform/GlDebugInfo.mapping +++ b/mappings/com/mojang/blaze3d/platform/GlDebugInfo.mapping @@ -5,5 +5,7 @@ CLASS net/minecraft/class_4494 com/mojang/blaze3d/platform/GlDebugInfo METHOD method_22091 getVersion ()Ljava/lang/String; METHOD method_35611 allocateMemory (I)Ljava/nio/ByteBuffer; ARG 0 size + METHOD method_35612 feedTo (Lnet/minecraft/class_6184;)V + ARG 0 consumer METHOD method_35613 freeMemory (Ljava/nio/Buffer;)V ARG 0 buffer diff --git a/mappings/com/mojang/blaze3d/systems/RenderCallStorage.mapping b/mappings/com/mojang/blaze3d/systems/RenderCallStorage.mapping index 7415c6f5a4..1588742355 100644 --- a/mappings/com/mojang/blaze3d/systems/RenderCallStorage.mapping +++ b/mappings/com/mojang/blaze3d/systems/RenderCallStorage.mapping @@ -1,2 +1,27 @@ CLASS net/minecraft/class_4491 com/mojang/blaze3d/systems/RenderCallStorage + COMMENT A storage of render calls with recording and processing states. It exposes + COMMENT three queues: a recording queue, a processing queue, and a last processed + COMMENT queue. The recording queue is equal to the processing queue during processing + COMMENT and different during recording. + COMMENT + COMMENT

This storage appears to be a work in progress, as its processing currently + COMMENT performs no operation. FIELD field_20453 recordingQueues Ljava/util/List; + FIELD field_20454 recordingIndex I + FIELD field_20455 processingIndex I + FIELD field_20456 lastProcessedIndex I + FIELD field_31899 recording Z + FIELD field_31900 processing Z + METHOD method_35599 canRecord ()Z + METHOD method_35600 record (Lnet/minecraft/class_4573;)V + ARG 1 call + METHOD method_35601 startRecording ()Z + METHOD method_35602 stopRecording ()V + METHOD method_35603 canProcess ()Z + METHOD method_35604 startProcessing ()Z + METHOD method_35605 process ()V + COMMENT No-op, but it seems like processing by method order and the check in method body. + METHOD method_35606 stopProcessing ()V + METHOD method_35607 getLastProcessedQueue ()Ljava/util/concurrent/ConcurrentLinkedQueue; + METHOD method_35608 getRecordingQueue ()Ljava/util/concurrent/ConcurrentLinkedQueue; + METHOD method_35609 getProcessingQueue ()Ljava/util/concurrent/ConcurrentLinkedQueue; diff --git a/mappings/net/minecraft/client/MinecraftClient.mapping b/mappings/net/minecraft/client/MinecraftClient.mapping index 3fffe29a72..ae96d1d3e0 100644 --- a/mappings/net/minecraft/client/MinecraftClient.mapping +++ b/mappings/net/minecraft/client/MinecraftClient.mapping @@ -163,6 +163,10 @@ CLASS net/minecraft/class_310 net/minecraft/client/MinecraftClient FIELD field_27388 blockEntityRenderDispatcher Lnet/minecraft/class_824; FIELD field_29569 debugRecorder Lnet/minecraft/class_5962; FIELD field_33697 resourceReloadLogger Lnet/minecraft/class_6360; + FIELD field_33735 GL_ERROR_DIALOGUE Ljava/lang/String; + COMMENT A message, in English, displayed in a dialog when a GLFW error is encountered. + COMMENT + COMMENT @see net.minecraft.client.util.Window#throwGlError(int, long) METHOD (Lnet/minecraft/class_542;)V ARG 1 args METHOD method_1476 checkIs64Bit ()Z @@ -303,6 +307,7 @@ CLASS net/minecraft/class_310 net/minecraft/client/MinecraftClient ARG 0 name ARG 1 displayName ARG 2 alwaysEnabled + ARG 3 packFactory ARG 4 metadata ARG 5 insertionPosition ARG 6 source @@ -414,8 +419,31 @@ CLASS net/minecraft/class_310 net/minecraft/client/MinecraftClient METHOD method_34745 toggleDebugProfiler (Ljava/lang/Runnable;Ljava/util/function/Consumer;)V ARG 1 startAction ARG 2 completeAction + METHOD method_35698 takePanorama (Ljava/io/File;II)Lnet/minecraft/class_2561; + COMMENT Takes a panorama. The panorama is stored in the given {@code directory}, in + COMMENT where 6 screenshots of size {@code width} and {@code height} will be taken. + COMMENT + COMMENT @return a user-oriented piece of text for screenshot result + ARG 1 directory + ARG 2 width + ARG 3 height + METHOD method_35699 takeHugeScreenshot (Ljava/io/File;IIII)Lnet/minecraft/class_2561; + COMMENT Takes a huge screenshot in the tga file format. + COMMENT + COMMENT

The {@code unitWidth} and {@code unitHeight} controls the size of the + COMMENT partial image rendered; it does not affect the screenshot outcome, but may + COMMENT affect the screenshot performance. + COMMENT + COMMENT @return a user-oriented piece of text for screenshot result + ARG 1 gameDirectory + ARG 2 unitWidth + ARG 3 unitHeight + ARG 4 width + ARG 5 height METHOD method_35702 getCurrentFps ()I METHOD method_35703 getWorldGenerationProgressTracker ()Lnet/minecraft/class_3953; + METHOD method_35705 addGlInfo (Lnet/minecraft/class_1276;)V + ARG 0 snooper METHOD method_35706 isRealmsEnabled ()Z METHOD method_36561 reloadResources (Z)Ljava/util/concurrent/CompletableFuture; ARG 1 force diff --git a/mappings/net/minecraft/client/gl/ShaderEffect.mapping b/mappings/net/minecraft/client/gl/ShaderEffect.mapping index 180e7260dc..100b6bea08 100644 --- a/mappings/net/minecraft/client/gl/ShaderEffect.mapping +++ b/mappings/net/minecraft/client/gl/ShaderEffect.mapping @@ -10,10 +10,14 @@ CLASS net/minecraft/class_279 net/minecraft/client/gl/ShaderEffect FIELD field_1500 lastTickDelta F FIELD field_1501 time F FIELD field_1502 resourceManager Lnet/minecraft/class_3300; + FIELD field_32770 MAIN_TARGET_NAME Ljava/lang/String; METHOD (Lnet/minecraft/class_1060;Lnet/minecraft/class_3300;Lnet/minecraft/class_276;Lnet/minecraft/class_2960;)V + ARG 1 textureManager + ARG 2 resourceManager ARG 3 framebuffer ARG 4 location METHOD method_1256 parseEffect (Lnet/minecraft/class_1060;Lnet/minecraft/class_2960;)V + ARG 1 textureManager ARG 2 location METHOD method_1257 parsePass (Lnet/minecraft/class_1060;Lcom/google/gson/JsonElement;)V ARG 2 jsonPass diff --git a/mappings/net/minecraft/client/gl/SimpleFramebuffer.mapping b/mappings/net/minecraft/client/gl/SimpleFramebuffer.mapping new file mode 100644 index 0000000000..2eb6829099 --- /dev/null +++ b/mappings/net/minecraft/client/gl/SimpleFramebuffer.mapping @@ -0,0 +1,6 @@ +CLASS net/minecraft/class_6367 net/minecraft/client/gl/SimpleFramebuffer + METHOD (IIZZ)V + ARG 1 width + ARG 2 height + ARG 3 useDepth + ARG 4 getError diff --git a/mappings/net/minecraft/client/gl/WindowFramebuffer.mapping b/mappings/net/minecraft/client/gl/WindowFramebuffer.mapping new file mode 100644 index 0000000000..1a78c154cf --- /dev/null +++ b/mappings/net/minecraft/client/gl/WindowFramebuffer.mapping @@ -0,0 +1,30 @@ +CLASS net/minecraft/class_6364 net/minecraft/client/gl/WindowFramebuffer + FIELD field_33724 DEFAULT_WIDTH I + FIELD field_33725 DEFAULT_HEIGHT I + FIELD field_33726 DEFAULT Lnet/minecraft/class_6364$class_6366; + METHOD (II)V + ARG 1 width + ARG 2 height + METHOD method_36801 supportColor (Lnet/minecraft/class_6364$class_6366;)Z + ARG 1 size + METHOD method_36802 initSize (II)V + ARG 1 width + ARG 2 height + METHOD method_36803 supportsDepth (Lnet/minecraft/class_6364$class_6366;)Z + ARG 1 size + METHOD method_36804 findSuitableSize (II)Lnet/minecraft/class_6364$class_6366; + ARG 1 width + ARG 2 height + CLASS class_6365 Attachment + FIELD field_33731 VALUES [Lnet/minecraft/class_6364$class_6365; + METHOD method_36807 with (Lnet/minecraft/class_6364$class_6365;)Lnet/minecraft/class_6364$class_6365; + ARG 1 other + CLASS class_6366 Size + FIELD field_33733 width I + FIELD field_33734 height I + METHOD (II)V + ARG 1 width + ARG 2 height + METHOD method_36808 findCompatible (II)Ljava/util/List; + ARG 0 width + ARG 1 height diff --git a/mappings/net/minecraft/client/render/GameRenderer.mapping b/mappings/net/minecraft/client/render/GameRenderer.mapping index de5daba008..50331875ed 100644 --- a/mappings/net/minecraft/client/render/GameRenderer.mapping +++ b/mappings/net/minecraft/client/render/GameRenderer.mapping @@ -209,6 +209,10 @@ CLASS net/minecraft/class_757 net/minecraft/client/render/GameRenderer METHOD method_34549 getPositionTexColorNormalShader ()Lnet/minecraft/class_5944; METHOD method_35764 getPositionTexLightmapColorShader ()Lnet/minecraft/class_5944; METHOD method_35765 isRenderingPanorama ()Z + METHOD method_35766 renderWithZoom (FFF)V + ARG 1 zoom + ARG 2 zoomX + ARG 3 zoomY METHOD method_35768 setRenderHand (Z)V ARG 1 renderHand METHOD method_35769 setBlockOutlineEnabled (Z)V diff --git a/mappings/net/minecraft/client/render/WorldRenderer.mapping b/mappings/net/minecraft/client/render/WorldRenderer.mapping index fcc20f5c84..b24438e62f 100644 --- a/mappings/net/minecraft/client/render/WorldRenderer.mapping +++ b/mappings/net/minecraft/client/render/WorldRenderer.mapping @@ -291,6 +291,7 @@ CLASS net/minecraft/class_761 net/minecraft/client/render/WorldRenderer METHOD method_34810 getChunkBuilder ()Lnet/minecraft/class_846; METHOD method_34811 getChunkCount ()D METHOD method_34812 getViewDistance ()D + METHOD method_35774 reloadTransparencyShader ()V METHOD method_8562 playSong (Lnet/minecraft/class_3414;Lnet/minecraft/class_2338;)V ARG 1 song ARG 2 songPosition diff --git a/mappings/net/minecraft/client/util/GlInfoConsumer.mapping b/mappings/net/minecraft/client/util/GlInfoConsumer.mapping new file mode 100644 index 0000000000..085bdbb83e --- /dev/null +++ b/mappings/net/minecraft/client/util/GlInfoConsumer.mapping @@ -0,0 +1,11 @@ +CLASS net/minecraft/class_6184 net/minecraft/client/util/GlInfoConsumer + COMMENT A functional interface with a method to set a key-value pair of information. + COMMENT + COMMENT @see net.minecraft.util.snooper.Snooper#addInitialInfo + METHOD setFixedData (Ljava/lang/String;Ljava/lang/Object;)V + COMMENT Sets a value associated to a key. + COMMENT + COMMENT

"Fixed" means immutable or static information; it is not related in any way + COMMENT to data fixers. + ARG 1 key + ARG 2 value diff --git a/mappings/net/minecraft/client/util/GlfwUtil.mapping b/mappings/net/minecraft/client/util/GlfwUtil.mapping index 658ac4dd5b..58d6ebaf9f 100644 --- a/mappings/net/minecraft/client/util/GlfwUtil.mapping +++ b/mappings/net/minecraft/client/util/GlfwUtil.mapping @@ -1,3 +1,7 @@ CLASS net/minecraft/class_3673 net/minecraft/client/util/GlfwUtil METHOD method_15973 makeJvmCrash ()V METHOD method_15974 getTime ()D + METHOD method_35596 accessRecordingQueue (Lnet/minecraft/class_4491;F)V + ARG 0 storage + METHOD method_35597 accessProcessingQueue (Lnet/minecraft/class_4491;F)V + ARG 0 storage diff --git a/mappings/net/minecraft/client/util/ScreenshotUtils.mapping b/mappings/net/minecraft/client/util/Screenshooter.mapping similarity index 50% rename from mappings/net/minecraft/client/util/ScreenshotUtils.mapping rename to mappings/net/minecraft/client/util/Screenshooter.mapping index ffaf204bbe..29f7358fd5 100644 --- a/mappings/net/minecraft/client/util/ScreenshotUtils.mapping +++ b/mappings/net/minecraft/client/util/Screenshooter.mapping @@ -1,6 +1,22 @@ -CLASS net/minecraft/class_318 net/minecraft/client/util/ScreenshotUtils +CLASS net/minecraft/class_318 net/minecraft/client/util/Screenshooter + COMMENT A screenshooter takes screenshots and saves them into tga file format. It also + COMMENT holds a few utility methods for other types of screenshots. FIELD field_1973 DATE_FORMAT Ljava/text/DateFormat; FIELD field_1974 LOGGER Lorg/apache/logging/log4j/Logger; + FIELD field_32157 unitHeight I + FIELD field_32158 stream Ljava/io/DataOutputStream; + FIELD field_32159 buffer [B + FIELD field_32160 width I + FIELD field_32161 height I + FIELD field_32162 file Ljava/io/File; + METHOD (Ljava/io/File;III)V + COMMENT Creates a screenshooter for huge screenshots. + COMMENT + COMMENT @see net.minecraft.client.MinecraftClient#takeHugeScreenshot + ARG 1 gameDirectory + ARG 2 width + ARG 3 height + ARG 4 unitHeight METHOD method_1659 saveScreenshot (Ljava/io/File;IILnet/minecraft/class_276;Ljava/util/function/Consumer;)V ARG 0 gameDirectory ARG 1 framebufferWidth @@ -27,3 +43,16 @@ CLASS net/minecraft/class_318 net/minecraft/client/util/ScreenshotUtils ARG 3 framebufferHeight ARG 4 framebuffer ARG 5 messageReceiver + METHOD method_35710 writeToStream ()V + COMMENT Writes the contents in the {@link #buffer} into the {@link #stream}. + METHOD method_35711 getIntoBuffer (Ljava/nio/ByteBuffer;IIII)V + COMMENT Transports image data from {@code data} into {@link #buffer}. + ARG 1 data + ARG 2 startWidth + ARG 3 startHeight + ARG 4 unitWidth + ARG 5 unitHeight + METHOD method_35712 finish ()Ljava/io/File; + COMMENT Finish taking the screenshot and return the complete tga file. + COMMENT + COMMENT @return the tga file diff --git a/mappings/net/minecraft/unused/FixedDataSetter.mapping b/mappings/net/minecraft/unused/FixedDataSetter.mapping deleted file mode 100644 index f27dfaaf43..0000000000 --- a/mappings/net/minecraft/unused/FixedDataSetter.mapping +++ /dev/null @@ -1,10 +0,0 @@ -CLASS net/minecraft/class_6184 net/minecraft/unused/FixedDataSetter - COMMENT A functional (single-abstract-method) interface with a method to set fixed - COMMENT data. - COMMENT - COMMENT @apiNote Since the {@link #setFixedData} is not obfuscated, it might have been - COMMENT used by some other (removed) code in a bootstrap method as a lambda. This class - COMMENT is not used anywhere otherwise. - METHOD setFixedData (Ljava/lang/String;Ljava/lang/Object;)V - ARG 1 key - ARG 2 value diff --git a/mappings/net/minecraft/util/math/Matrix4f.mapping b/mappings/net/minecraft/util/math/Matrix4f.mapping index c6c9c6623d..282f4b9daf 100644 --- a/mappings/net/minecraft/util/math/Matrix4f.mapping +++ b/mappings/net/minecraft/util/math/Matrix4f.mapping @@ -54,6 +54,13 @@ CLASS net/minecraft/class_1159 net/minecraft/util/math/Matrix4f ARG 1 x ARG 2 y ARG 3 z + METHOD method_34239 projectionMatrix (FFFFFF)Lnet/minecraft/class_1159; + ARG 0 left + ARG 1 right + ARG 2 bottom + ARG 3 top + ARG 4 nearPlane + ARG 5 farPlane METHOD method_35434 load (Lnet/minecraft/class_1159;)V ARG 1 source METHOD method_35435 readRowFirst (Ljava/nio/FloatBuffer;)V