Did the Spinosuarus's back fin serve any purpose?

I was kinda recently obsessing over the dinosaur again, then sorta wondered if the fin served a purpose. Since to my knowledge or insight it didn't

I was kinda recently obsessing over the dinosaur again, then sorta wondered if the fin served a purpose. Since to my knowledge or insight it didn't