Author Topic: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)  (Read 3108 times)

0 Members and 1 Guest are viewing this topic.

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
Maybe, in not conviced about performance so im going to try to fix 3.7.2.

Just in case, you can add 3.7.4 to git as well? Because fixing 3.7.2 could take a really long time, WCS with 3.7.4 is playable(or at least that whats it looks) right now for example.

But im still not sure, maybe is better to just use 3.7.2 debug build after all. Im going to analyse more closely the performance diferences of 3.7.2 and 3.7.4.

EDIT: Im going to pick 3.7.2 Debug, dont bother with add 3.7.4 to git.
« Last Edit: December 09, 2019, 08:56:31 pm by ShivanSpS »

 

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
Ok ill be uploading the changes here
https://github.com/Shivansps/fs2open.github.com

Nothing great just yet, just the enoght workarounds needed to get Wing Commander Saga working with debug build.

Now ill try to get the SLDC system working and after that implement the pof aligner directly on model load.

 

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
I have a possible solution about the SLDC system(and alignment overall), i hope this dosent cause issues but i think pof version has to be increased by 1 to 2118, version 2118 will signal both the presence of a new SLDC chunk type, and thus the older one must be ignored (but keeped in pof for compatibility), and the second thing, 2118 also signals that the model is aligned and thus no alignment must be done at model load.
pof version 2117 or lower means that the model must be aligned and SLDC data converted to the new format at model load.

i could easily do these changes to the pof aligner, and pcs2 needs to be updated anyway.

 

Offline Goober5000

  • HLP Loremaster
  • Administrator
  • 214
    • Goober5000 Productions
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
Sounds reasonable.

 

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
OK, SLDC now working, i called the new chunk "SLC2". Is the same thing but with a int instead of a char.

Ive added to FSO the ability to convert SLDC to SLC2 on model load for pof versions 2117 or lower, ive already tested on ARM and this works fine, 2117 models load, SLDC data is converted to SLC2 format, and shields collision works fine and whiout a bus error crash.
Its all in the testing branch here
https://github.com/Shivansps/fs2open.github.com/tree/fs2_open_3_7_2_rpi_test

This was crucial, because this works and it means i can implement all other chunk alignment code from the pof aligner as i did for this, directly on FSO as i wanted to do.

I will upload the new pof aligner version probably tomorrow that outputs pof version 2118 with the slc2 chunk already in, all that is already done but i want to get the VP writing code working.

If all goes well i hope to have FSO aligning the pofs on model load very soon.
« Last Edit: December 13, 2019, 10:08:55 pm by ShivanSpS »

 

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
pof_aligner updated, this version outputs pofs with version 2118 and the SLC2 chunk already converted.
https://www.hard-light.net/forums/index.php?topic=96108.0

It also supports VP to VP alignment for simple use. So if someone is planing to integrate it to knossos as a external tool or in code directly, thats the way to go.

I also tested these 2118 pofs on 3.8.1, it seems to be no issues caused by increasing the version and or the unknown SLC2 chunk.
« Last Edit: December 14, 2019, 09:23:56 am by ShivanSpS »

 

Offline Goober5000

  • HLP Loremaster
  • Administrator
  • 214
    • Goober5000 Productions
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
Er, this VP writer isn't modifying VP files in-place, is it?

 

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
Er, this VP writer isn't modifying VP files in-place, is it?
No, it creates a new vp, you need to specify both the input name and the output name.

 

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
Its done. Ive added BSP_data alignment to 3.7.2 FSO for pof versions 2117 or lower. Ive already merged it into main branch.
https://github.com/Shivansps/fs2open.github.com

The other chunks FUEL, GLOW, SPCL, TXTR, DOCK, PATH, SLDC, OBJ2, SOBJ, due to the way FSO parses those pof chunks, there is no need to align them and there is no way to do it either at model model whiout re-writting the entire process. This is because the chunk is not being loaded into memory and then used, it is being read from file and copied intro memory just like one would do with memcpys but with file reads.
Thats not the case for BSP_DATA or SLDC that are read and stored into memory as it is, and then used it and that was the problems.

These changes allows for 3.7.2 to load and use unmodified pof files whiout any silly workarounds or disabled SLDC, and 2118 files whiout any extra work done on model load. So unless some weird issue is found by doing this or with the pof aligner ill consider this as finished.
The scripting segfault on 3.7.2 release is unrelated to this issue, or at least, with models. But since it works on debug build that is good enoght.

The only thing that i dont know is if you guys are going to accept pof version number 2118 (and what it means) and SLC2, im waiting on that to add that information on wiki and create a issue on PCS2 git for future support.
« Last Edit: December 15, 2019, 11:27:23 am by ShivanSpS »

 

Offline Cyborg17

  • 29
  • A-1 Supar
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
Would it be possible to add this to trunk for any arm processors that are in computers that have better graphics cards or better open gl support?

 

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
I think it is a matter of testing, if there are no issues, it may be good enoght to be implemented on main.

Im curious to test if having the shield mesh collision aligned (SLC2) has any effect on fps, that is the worst part of this because for every hit the code has the process the unaligned SLDC tree. There may be some small difference if there are enoght ships hitting each other. Ill have to add it to a 3.8.1 and try.
-A similar issue may happen with collision detection, as unaligned BSP defpoints was breaking that part on ARM, but i belive the data is being copied there-

Also, ive learned that AVX may have problems as ARM has with unaligned access, so AVX builds may have a performance penalty on SLDC, but i dont know if AVX is used for that here. At any rate, another reason to test.




« Last Edit: December 16, 2019, 12:21:36 pm by ShivanSpS »

 

Offline Goober5000

  • HLP Loremaster
  • Administrator
  • 214
    • Goober5000 Productions
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
The only thing that i dont know is if you guys are going to accept pof version number 2118 (and what it means) and SLC2, im waiting on that to add that information on wiki and create a issue on PCS2 git for future support.

I don't see why not.  It's certainly a valid reason to bump the POF version.  Just make sure that the code can load both < and >= 2118.


And by all means, submit a pull request to the main FSO repository with the align-on-load fix.

 

Offline ShivanSpS

  • 210
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
What is happening on Git with the PR is unbelievable, i try to run FSO on a Raspberry PI and i find a 20 year old issue with models, i try to fix it and i encounter what is probably another long term problem with the modelsinc header.

I have a worse luck than those Medusas on the fs2 intro.

  

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: [3.7.2-ARM] Unaligned Memory Access at modeloctant.cpp:28 (title edited)
I've been following the emails from github on the updates, it's like watching a daytime soap lol
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays