On Tue, 5 Jul 2022 at 12:11, Giovanni Mascellani gmascellani@codeweavers.com wrote:
Il 01/07/22 23:24, Francisco Casas ha scritto:
+void hlsl_free_deref(struct hlsl_deref *deref) +{
- hlsl_src_remove(&deref->offset);
+}
Again, mostly a nitpick, but personally when a function is called "free" and receives a pointer, I assume that it will free the pointer itself (after perhaps doing cleanup). Here there is the cleanup, but the pointer is not freed, so I would rename to "hlsl_unlink_deref", for example. Not sure if others agree with my sentiment.
The convention we had been using in wined3d and vkd3d for a while now is <object>_destroy() for functions that free the underlying storage, and <object>_cleanup() for functions that don't. Similarly, we have <object>_create() for functions that allocate storage, and <object>_init() for functions that don't. I'm not sure the HLSL compiler necessarily follows that convention though.