Closed shannon-lunarg closed 6 years ago
I'm just curious what the motivation is here. It seems unintuitive to present struct members in a different order than they appear in the spec.
Ah. I should mention this is in reference to LVL issue #2483.
@mikes-lunarg Some of the reordering of the larger structs, e.g., VkPhysicalDeviceLimits, was inspired by the alphanumerical ordering on gpuinfo.com but I could certainly keep it in struct-order if that makes more sense.
The issue states:
Candidates for alphanumeric soft include:
- List of instance extensions
- List of device extensions
Things that need not be sorted alphanumerically include:
- Dump of the values of fields of a struct. Printing them in the order in which they appear in the struct definition is both sensible and deterministic.
- Dump of the bits that are set in a bitfield. Printing them in bit-position order is both sensible and deterministic.
Looks like some of these order changes violate the second part of this statement.
Totally makes sense for the extension lists to be sorted.
I'm still not convinced on struct fields, the issue even specifically calls them out to be printed in struct order. I would argue that there are also places where sorting fields is worse, like splitting up min/max pairs or this:
features.sparseResidency16Samples
features.sparseResidency2Samples
features.sparseResidency4Samples
features.sparseResidency8Samples
@jeremyk-lunarg @mikes-lunarg There was already conflicting ordering (that I introduced many commits ago) so I think I just made an unpopular decision to conform to that. I have since reordered to conform to the struct ordering and pushed changes to my branch.
NOTE: I used three online tools to validate new json output and one online tool to validate html output for good measure.
Pushed to master.
Changes consist of reordering print statements for all paths of output (human_readable, html, and json) and the addition of employing the qsort function (and new comparison functions) to reorder global layers and extension properties in the app instance.
Please let me know if you think I've sorted sections of output that maybe shouldn't be sorted.
Sections left unsorted because the current ordering seems to make the most sense: Presentable Surfaces, VkQueueFamilyProperties, and Format Properties
Change-Id: I075a6897c3070f70d7073c22e7100c49c19073a3