Canvas Renderer

Canvas Renderer

202k Downloads

Material samplers don't reload on pipeline change

spiralhalo opened this issue ยท 1 comments

commented

This issue is first discovered by heyman on May 23 although back then the cause or its reproducibility was unknown.

Now I have a hypothesis on the cause. It seems that these lines of code are evaluated once and not re-evaluated on pipeline reload.

https://github.com/grondag/canvas/blob/48000a958ef9ffb812a983ef02df5ba35e8f8ffc/src/main/java/grondag/canvas/shader/ShaderData.java#L62-L67

How to test this issue: use Canvas standard pipeline before loading any world. Then after loading a world, switch to Lumi Lights (latest commit) and set "Enchantment glint mode" to "Glint Texture". Notice glitch on enchanted items in the inventory GUI and hotbar.

The current workaround for this issue is restarting minecraft after changing pipelines.

p.s. For anyone out of the loop, I am responsible for the quoted code and I will PR a fix later. Opening this issue in case Grondag finds it trivial to fix it himself.

commented

So there is already a reload function:

https://github.com/grondag/canvas/blob/48000a958ef9ffb812a983ef02df5ba35e8f8ffc/src/main/java/grondag/canvas/shader/MaterialProgramManager.java#L52-L58

I don't know how to invalidate/remove existing uniforms. Should we just make the existing programs null on reload or is there any reason to only create the material programs once?