:arrow_up: I changed 4/4 (now 4/6) so that texture resources are indeed sorted in decreasing bind count and added a test on 1/6 to check for that.
Because it was necessary to call hlsl_var_get_bind_count() several times for that, I decided to store the bind count in `hlsl_var.bind_count[]` instead. This also allows for patch 5/6.
I also added 6/6, which uses the bind count instead of the allocation size in d3dbc.c. This should have no effect since both should be the same in SM1, but still, for consistency.