Closed sunwanxin213 closed 2 years ago
Already done - if you decompress the XNB and pass what's left it is expected to work, as it does in FNA:
https://github.com/FNA-XNA/FNA/tree/master/src/Graphics/Effect
I see that FNA3D uses MOJOSHADER_compileEffect to process effect code data. But don't see the procedure calling MOJOSHADER_parse . So I want to know if the MOJOSHADER_parse function can support processing XNA bytecode. thanks~
There is MOJOSHADER_parseEffect which should do what you want - it's the effects equivalent of parse() for standalone shaders.
I noticed that MOJOSHADER_parseEffect has been renamed to MOJOSHADER_compileEffect, but it still leaves a comment indicating that it used to be MOJOSHADER_parseEffect. By communicating with you, I already know the problem, thank you very much for your reply!
After I tried it, I found that it didn't work well in WebAssembly, and I can use MOJOSHADER_parseEffect after going back to the version 2 years ago. The screenshot is as follows, I hope to consider restoring this usage in the future. Picture
Right, forgot I redid that export... like the log says, it's been a couple years 😅
You can cheat by using an effectShaderContext that doesn't do any compilation work, and instead just reads and parses what you need - though this looks very XNA-like, so I wonder if FNA's experimental wasm target could be of interest?
I will try FNA to wasm.(>^ω^<)
Current guide (I think): https://gist.github.com/TheSpydog/e94c8c23c01615a5a3b2cc1a0857415c
like MOJOSHADER_compileEffect , support XNA Effect ByteCode.