cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

RadeonLegend
Adept I

Issue with buffer initialization on Minecraft Java Edition shaderpacks

Steps to produce: Minecraft Java Edition 1.19.4 with Optifine installed, load shaders that uses temporal effects (like PTGI, irradiance cache, and so on), press F3+R to reload shades, or smaller window size as described below.

Since driver 23.7.2, there is an issue that greatly affect some Minecraft Java Edition shaderpacks. If the clear in every frame is disabled for some buffer, then the first frame of this buffer will be extremely strange. Below image provides the image after reloading shaders, using the shader from https://github.com/GeForceLegend/SEUS_PTGI_GFME . Since the first frame is filled with random data, GI on hand becomes extremely bright (ground initial data will not pass depth check so GI on ground looks correct).

Hand GI when reload shaderHand GI when reload shader

Another thing might relates to it is the strange output when smaller window size. When using the shader provided above and resizing window to smaller, screen will be filled with extremely black and white area, and irradiance cache on reflection will also become strange. Is the pointer of buffer changes without initialization, making shaders reading polluted data, and then creates tons of nan or inf?

Image after smaller window sizeImage after smaller window size

 

There are additional images: I modded another shader, and reading a buffer with clear disabled that is never writed. The first image is loading the modded shader after loading the unmodified one, I get the last TAA frame from the unmodified shader with some noise (part of this noise looks like data from other buffer). Since the TAA data comes from unmodified shader, but current loaded shader is the modified one and it never writes to this buffer, this frame never changes even if moving player camera. And if I reload shader for more times, or launching game with modified shader on, then the result is a pure black image with noise looks like data from other place.

311d0200b828a6401de1503c5e6e3841.png7e79928729fc4f799674dabf88919c85.png

 

Possible reason in my opinion: Optifine (the shader loader mod of Minecraft Java Edition) does not clear buffer when declare a buffer, but clear it on the begin of every frame; but if disable the buffer clear on the begin of each frame, this buffer is never cleared. Maybe on the driver before 23.7.2, or other vendors' card, the buffer is cleared on declaration; but from driver 23.7.2, declare a buffer will not clear its memory, unless developer call a glClear manually.

 

Tested on machine:

984190C2-CA7B-15DF-89D3-EB37D6791B14.png

 

 

0 Likes
1 Solution

Hi @RadeonLegend ,

Could you please try the latest Adrenalin 23.12.1 and share your observation?

Thanks.

View solution in original post

0 Likes
8 Replies
dipak
Big Boss

Hi @RadeonLegend ,

Thank you for reporting the above issue. I have forwarded the issue to the OpenGL team and filed an internal ticket to track it.

Thanks.

0 Likes
dipak
Big Boss

Hi @RadeonLegend ,

The OpenGL team wants to know the exact packages that you used to reproduce the issues shown in the above images?

Thanks.

0 Likes

The top 2 images are using https://github.com/GeForceLegend/SEUS_PTGI_GFME , it needs to follow the readme file to extract the shaderpack (needed file can be downloaded from https://www.patreon.com/posts/download-seus-2-45141775 ). Steps to reproduce these 2 image is provided already. I have also tested it on RX580 and RX6700 with driver 23.7.2 weeks ago, both of them can reproduce these issue.

Shaderpack used in image 3 and 4 is my personal modifcation to another shaderpack, it might be illegal to distribute it. And I can't access any device with AMD graphics card for a while, I'm not sure if I can make a simple shaderpack that can reproduce image 3 and 4. If image 1 and 2, and their related shaderpack is not enough for the OpenGL team, I'll try finding someone's help as soon as possible.

Extra info: In the provided shaderpack of image 1 and 2, temporal GI accum buffer is colortex4, and irradiance cache buffer is colortex5. Both of them are read and writed in deferred2 program.

0 Likes

Thanks for the information. The OpenGL team has informed that they were able to reproduce the issue with the following packages:  Iris, Optifine, SEUS PTGI E12. 

Thanks.

0 Likes

Update:

The OpenGL team has implemented a fix for this issue. 

0 Likes

Hi @RadeonLegend ,

Could you please try the latest Adrenalin 23.12.1 and share your observation?

Thanks.

0 Likes

Sorry that I have to wait for some days before I can test this. I'll send feedback as soon as possible.

Confirmed fixed. Happy new year!

0 Likes