3 ms·
Isn't it very inefficient to pass structs like Model by value to functions? I guess it doesn't matter for the matrix operations since they will be probably inl
by tralarpa 3y ago
Isn't it very inefficient to pass structs like Model by value to functions?
I guess it doesn't matter for the matrix operations since they will be probably inlined, but what about the bigger functions?
- qbasic_forever 3y agoDepends what's inside model, if it's just a bunch of pointers to meshes, materials, etc. that are allocated and owned elsewhere then it's really not a big deal or concern.
- tralarpa 3y agoWhat is "a bunch of" nowadays? My knowledge about efficient programming is still at the level of 20 years ago :) Looking at the DrawModel function, it looks like it's passing around 400 bytes of data structures for a model with one mesh (assuming that matrix operations are inlined).