VulkanMod icon indicating copy to clipboard operation
VulkanMod copied to clipboard

Shaders cannot be compiled

Open Jack253-png opened this issue 7 months ago • 6 comments

I am building a MMD model(a type of high-precision model) renderer, when I am writing shaders for resolving performance issues, I found it cannot be compiled on vulkan renderer and there aren't any error logs available. I cannot prevent crashing using NEC mod, because after the shader null pointer exception is a native exception. loader source: https://github.com/PrimogemStudio/Advanced-Framework the shader is at src/resources/assets/advancedfmkshaders/core/ refrences are at src/main/java/com/primogemstudio/advancedfmk/mmd/renderer/Renderer.kt image (idea debugger, the model has 68604 vertices, throws NullPointerException) hs_err_pid10184.log And it causes the native exception and the whole JVM program crashes.

Jack253-png avatar Jan 15 '24 01:01 Jack253-png

it sometimes prints the complie error and it pointed out at this line image but it also contains in the minecraft core shader -> rendertype_entity_cutout, and this shader can be complied

Jack253-png avatar Jan 15 '24 01:01 Jack253-png

thanks!And you can create a fork and open a pr at my repository

---- Replied Message ---- | From | @.> | | Date | 01/16/2024 22:52 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [xCollateral/VulkanMod] Shaders cannot be compiled (Issue #364) |

(TBh we are not the most active on Github, so if you need more direct+detailed support i would suggest the #development channel in the VulkanMod Discord)

This is not a SPIR-V compilation issue; You are calling a GL11 function, which is GL11.glPolygonMode() GL functions aren't loaded with VulkanMod, so they throw a Segfault in native code

Thankfully this is extremely trivial to fix glPolygonMode() only sets Draw mode and Face Direction, this maps very well tot the Pipeline System VulkanMod uses)_

OTOH our Dev team is tiny (Its just me + Collateral), Collateral is being swamped with IRL stuff, so this mod is going to be dead for about a month

I can't push commits on this repo, so if you need a fix now i will need to setup an unofficial test branch for you that adds glPolygonMode()

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Jack253-png avatar Jan 16 '24 22:01 Jack253-png

Yes, I need this fix, and for the compatibility, I disabled the custom shader

---- Replied Message ---- | From | @.> | | Date | 01/16/2024 22:52 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [xCollateral/VulkanMod] Shaders cannot be compiled (Issue #364) |

(TBh we are not the most active on Github, so if you need more direct+detailed support i would suggest the #development channel in the VulkanMod Discord)

This is not a SPIR-V compilation issue; You are calling a GL11 function, which is GL11.glPolygonMode() GL functions aren't loaded with VulkanMod, so they throw a Segfault in native code

Thankfully this is extremely trivial to fix glPolygonMode() only sets Draw mode and Face Direction, this maps very well tot the Pipeline System VulkanMod uses)_

OTOH our Dev team is tiny (Its just me + Collateral), Collateral is being swamped with IRL stuff, so this mod is going to be dead for about a month

I can't push commits on this repo, so if you need a fix now i will need to setup an unofficial test branch for you that adds glPolygonMode()

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Jack253-png avatar Jan 16 '24 22:01 Jack253-png

but this caused a big performance issue

---- Replied Message ---- | From | @.> | | Date | 01/16/2024 22:52 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [xCollateral/VulkanMod] Shaders cannot be compiled (Issue #364) |

(TBh we are not the most active on Github, so if you need more direct+detailed support i would suggest the #development channel in the VulkanMod Discord)

This is not a SPIR-V compilation issue; You are calling a GL11 function, which is GL11.glPolygonMode() GL functions aren't loaded with VulkanMod, so they throw a Segfault in native code

Thankfully this is extremely trivial to fix glPolygonMode() only sets Draw mode and Face Direction, this maps very well tot the Pipeline System VulkanMod uses)_

OTOH our Dev team is tiny (Its just me + Collateral), Collateral is being swamped with IRL stuff, so this mod is going to be dead for about a month

I can't push commits on this repo, so if you need a fix now i will need to setup an unofficial test branch for you that adds glPolygonMode()

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Jack253-png avatar Jan 16 '24 22:01 Jack253-png

MB i was completely mistaken (Deleted my prior comment as its incorrect: I didn't read the crash log properly) Ignore what i said about glPolygon(): its N/A as its related to notenoughcrashes Which is completely unrelated to the actually relevant issue w/ Advanced-Framework

If you are referring to the Rendersystem.GetShader() NullPointer Exception, then this is a known VulkanMod bug; (ignore the below if thats not your issue)

Minecraft lacks an effective method of getting the name of the required Shader As Minecraft doesn't have a way of providing the shader name, VulkanMod can't determine the correct shader+Pipeline to load hence the NPE's when attempting to call Rendersystem.GetShader()

thr3343 avatar Jan 16 '24 23:01 thr3343

In short, I can look into fixing this Rendersystem.GetShader() NPE if its helpful So external mods can load the correct shader they need properly

(Was planning on doing this anyway as it effects mod compat w/ other mods as well (e.g. Botania also has the Rendersystem.GetShader() NPE))

thr3343 avatar Jan 16 '24 23:01 thr3343