g3d: Implement ResMaterial and ResShaderParam - #3
arayaphong wants to merge 2 commits into
Conversation
ResMaterial\ and \ResShaderParam\|
That is unfortunate and I think we might have to change the setup to cross build for arm64 |
|
I found SIMDe (https://github.com/simd-everywhere/simde), which could let the NEON intrinsics compile on x86_64. I haven't tried it yet, so I'm not sure how stable it is. |
|
I don't think it's worth to add more hacks on top of |
|
Hi there! The aarch64 toolchain is set up. If you rebase and revert the CMakeLists.txt changes (it's automatically globbed now), it should build (hopefully) |
509a7c5 to
fc6eb42
Compare
|
Investigating the arm_neon failure.. |
|
I didn't include lib/clang headers, will fix that |
|
it should be fixed now. Also there are some clang warnings, please consider addressing those since we might turn on -Werror for checks in this repo in the future :) |
|
Fixed in 13116f7: removed unused-parameter warnings and replaced the incompatible callback casts. |
Implements
nn::g3d::ResMaterialandnn::g3d::ResShaderParam(lib/g3d/src/g3d/g3d_ResMaterial.cpp), ported from the closed open-ead/nnheaders#88 as requested.ResMaterial.omatch.ResShaderParam::ConvertSrt3dCallbackis non-matching (SIMD scheduling and register allocation), markedNON_MATCHINGwith a decomp.me link: https://decomp.me/scratch/lkHXplib/g3d/include/nn/g3d/g3d_ResMaterial.h, adds the source tolib/g3d/CMakeLists.txt, and forward-declaresstruct TextureRefing3d_ResFile.h,g3d_ResModel.handg3d_ResMaterialAnim.h(they previously hadtypedef void* TextureRef, which conflicts with the real struct definition).nn/util/util_Arithmetic.handnn/gfx/gfx_Sampler.halready provide everything used here.One thing to decide:
ConvertSrt3dCallbackuses NEON intrinsics (<arm_neon.h>), which only compile for ARM targets. The PR workflow builds for the x86_64 host, so this file does not compile there. I verified the port itself is correct by compiling it for an aarch64 target, and clang-format/clang-tidy are clean. How would you like architecture-specific code handled here - an aarch64 build path, a guard, or something else?Formatted with this repo clang-format config; clang-tidy is clean.
This change is