gboisse / gfx

A minimalist and easy to use graphics API.
MIT License
502 stars 36 forks source link

Fix CodeQL errors/warnings. #136

Open maoliver-amd opened 5 months ago

maoliver-amd commented 5 months ago

Mostly trivial fixes such as passing structs by reference instead of by value

gboisse commented 1 month ago

This PR has gotten quite out of sync. with master by now, should we merge with latest or simply close it? I'm personally ok with closing it but please let me know if you have another opinion.

maoliver-amd commented 1 month ago

There were a couple of actual bug fixes so atleast we should cherry pick those out. The pass by reference when benchmarked provided a minor performance increase, mainly for debug builds where the pass by value copy wasnt optimised away and the program wasnt already GPU limited. Technically pass by constant reference can accept more input types than by value (for instance it can accept r-values whereas pass by value will compiler error) so it s an API change but one that shouldnt be noticed by any users. But as to whether we add that is up to you. I can update this PR with whatever changes are agreed upon