Null-MC / Shrimple

A simple Minecraft Java shader that attempts to maintain the vanilla aesthetic while adding optional shadows & colored lighting.
Other
131 stars 6 forks source link

The shader breaks on Iris beta + AMD. #4

Closed NyaomiDEV closed 1 year ago

NyaomiDEV commented 1 year ago

Trying to run RTX preset just for the sake of it fails on Iris 1.6.0 beta 5, using 1.19.4. If that helps, I am using Windows, and an AMD card with driver version 23.3.2.

[Render thread/ERROR]: Failed to create shader rendering pipeline, disabling shaders!
net.coderbot.iris.gl.shader.ShaderCompileException: shadow_terrain_cutout.gsh: ERROR: 0:321: 'atomicOr' : atomic operations only can perform on buffer or shared storage. 
ERROR: 0:321: '' : compilation terminated 
ERROR: 2 compilation errors.  No code generated.
null511 commented 1 year ago

I've seen this issue before, but only on AMD. It also only seems to happen with a specific (latest?) version of the drivers, but I don't have AMD myself to test with so I'm not entirely certain rolling back will fix.

null511 commented 1 year ago

following up, I've been told AMD driver version 22.5.1 should be fine.

edit: also, can confirm that fixed the same problem for another user.

NyaomiDEV commented 1 year ago

AMD driver version 22.5.1 is ancient by today's standards, though. Bleeding edge and top tier cards users will either not be able to use that driver pack at all or take huge performance hits across the board; especially so after the release of driver package 23.2.2 which merged development efforts between RDNA2 cards (which now go super fast - the AMD FineWine joke still present) and RDNA3 cards.

I was informed that the bug is totally fixable, at least it was for some people. For example the NobleRT developer fixed it in their shaderpack recently.

As for me, I would gladly wait until this issue disappears either with time or with a contribution, as I can't rollback to that driver package version.

null511 commented 1 year ago

I was informed that the bug is totally fixable, at least it was for some people. For example the NobleRT developer fixed it in their shaderpack recently.

This is completely unrelated; Belmu is not using SSBO's or atomic operations at all, which is what is crashing for you. There are tons of different issues that can occur with AMD, he fixed something else specific to his usage. The only report of the specific error you are running into was around using newer AMD drivers, it works fine on all other vendors.

As far as I'm aware, there isn't anything I can do to fix this on my end.

tajemniktv commented 1 year ago

Hiya, amd user here (23.3.1). Can confirm that it also doesn't work on my end. Many shaders have issues with amd cards, sadly... I'm guessing that won't help much or even at all, but here are some logs. Full logs: https://mclo.gs/2K1odrR Just the error: https://mclo.gs/9Ycs7Z4

Eh, screw amd XD

DeadbushCarrot commented 1 year ago

Yeah if block lighting mode is not set to default it just crashes. I got a rx 5500xt [Edit] if shadow type is to anything but none in the nether its just black and enchanted tools are transparent only when shadow type is not set none and is fixed when normal mapping is on also there a weird gray like flat square in the sky to and the rain glows and when subsurface scattering is set to hard coded the shader just disables until its switched!

null511 commented 1 year ago

@DeadbushCarrot Are you using Optifine? And is this the last release [0.7] or the in-dev code download from github?

DeadbushCarrot commented 1 year ago

@DeadbushCarrot Are you using Optifine? And is this the last release [0.7] or the in-dev code download from github?

Am using Iris 1.6.1 and 0.7 from modrinth

null511 commented 1 year ago

Try using the latest in-dev version: https://github.com/Null-MC/Shrimple/archive/refs/heads/main.zip most if not all those issues should be fixed. I'm in the middle of preparing a 0.8 release rn...

DeadbushCarrot commented 1 year ago

Nether darkness is fixed. transparent enchants are fixed. subsurface scattering is fixed. glowing rain is fixed. ok but the flat gray thing is still there disappears when clouds are turned off. porosity is broken when set to Integrated. colored lighting is broken only when placed. there weird black squares below entity's. Block light is slightly better per-vertex doesn't crash but now it disable the shader until switched per-pixel crashes and so does ray-tracing.

null511 commented 1 year ago

I've made some changes, and Shrimple should now work with the latest AMD drivers. Basically AMD only broke atomicOr for SSBO's, but they still work fine on CU's, so I moved the voxel data there.

DeadbushCarrot commented 1 year ago

Porosity is fixed. the weird black squares below entity's are fixed. Block lighting is better again but it still doesn't work but now it won't crash your game just disables the shader. the glitch cloud is still there. colored lighting is the same as before

null511 commented 1 year ago

This was using the latest github code download, and not release 0.8, right? The AMD changes have been pushed up, but not included into an official release yet.

DeadbushCarrot commented 1 year ago

Nope it was 0.8 i dont know how fast your pushing alphas out aka the GitHub version

null511 commented 1 year ago

yeah my bad I should have specified that originally. I just posted the 0.8 release the other day, but found/made the AMD fix today.

DeadbushCarrot commented 1 year ago

VERTEX IS WORKING BUT BUGGY AS HELL EDIT PER PIXEL IS WORKING TOO. ALSO BUGGY AS HELL

DeadbushCarrot commented 1 year ago

uhh ray tracing is wack 2023-04-24_21 29 18 so is per pixel/vertex 2023-04-24_21 31 10

null511 commented 1 year ago

Sorry about that, I indeed broke things in the latest commit making the buffers dynamically sized. I've fixed that now so the latest commit should be good.

DeadbushCarrot commented 1 year ago

We're getting there 2023-04-25_00 04 46 2023-04-25_00 07 05

null511 commented 1 year ago

If you have a lot of lights, you may need to tweak the settings a bit, try:

Block Lighting > Advanced:

Using a smaller bin-size allows more dense lighting. Increase the max count as needed, but more lights means less performance too.

DeadbushCarrot commented 1 year ago

yeah that fixed it but for worlds like mine I would have to set it to very high values

DeadbushCarrot commented 1 year ago

also why is the torch flicker really hard it gets really close to green

NyaomiDEV commented 1 year ago

wait are you really fixing the atomics?

null511 commented 1 year ago

also why is the torch flicker really hard it gets really close to green

weird, I'll check that out. You can also disable the brightness/hue change by turning off "flicker" in block light settings.

wait are you really fixing the atomics?

Should already be fixed in the latest github commit (not release).

NyaomiDEV commented 1 year ago

Tested it. I don't know on RDNA and other cards, but on my card it stutters a lot, in a very similar way to what I got with another shader, Rethinking Voxels. I am starting to think that either my card is horrendously damaged for Minecraft shader usage, or that AMD did multiple f-ups with their drivers.

DeadbushCarrot commented 1 year ago

also why is the torch flicker really hard it gets really close to green

weird, I'll check that out. You can also disable the brightness/hue change by turning off "flicker" in block light settings.

wait are you really fixing the atomics?

Should already be fixed in the latest github commit (not release).

No I ment in general you could make a option to turn on the flicker

DeadbushCarrot commented 1 year ago

Tested it. I don't know on RDNA and other cards, but on my card it stutters a lot, in a very similar way to what I got with another shader, Rethinking Voxels. I am starting to think that either my card is horrendously damaged for Minecraft shader usage, or that AMD did multiple f-ups with their drivers.

Whats your gpu?

NyaomiDEV commented 1 year ago

Whats your gpu?

RX 6900 XT

DeadbushCarrot commented 1 year ago

Whats your gpu?

RX 6900 XT

Am still in school but when I get home I tell what you should change in your drivers also is your drivers up to date?

NyaomiDEV commented 1 year ago

Am still in school but when I get home I tell what you should change in your drivers also is your drivers up to date?

I think there's nothing wrong with my setup - and of course drivers are up to date. I made this very issue because I had drivers up to date, and I am still updating.

null511 commented 1 year ago

There's several things that can be affecting performance, voxelizing and ray-tracing the world is also not a cheap technique in general. A good way to test your "peak performance" is by creating a flat world, and placing 1 to 3 lights and a few blocks for testing.

As for gameplay scenarios, you can try reducing some of the block-light bin settings:

Also block-light VL is currently very slow; best to avoid using it until I finish implementing the flood-fill LPV. It's off by default.

DeadbushCarrot commented 1 year ago

was trying to help i was gunna say try turning off anit-lag also funny how my drivers aren't update to date

null511 commented 1 year ago

Closing this now since AMD compatibility has been confirmed with the latest github main branch. This will be released soon as part of the 1.0 release of Shrimple.