Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort extension constants in output #3

Closed
bbredesen opened this issue Mar 6, 2023 · 1 comment
Closed

Sort extension constants in output #3

bbredesen opened this issue Mar 6, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@bbredesen
Copy link
Owner

Extension names and spec versions are coming out in an undefined order, which causes them to be listed in that order on pkg.go.dev. Sort the constants after they come out of the map, so that related extension name and spec versions are next to each other in the output. This is already being done for enumerated values, command names, etc.

Current output:

QCOM_IMAGE_PROCESSING_SPEC_VERSION                       = 1
EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION         = 2
EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME               = "VK_EXT_display_surface_counter"
NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION                = 3
KHR_RAY_QUERY_SPEC_VERSION                               = 1
EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME             = "VK_EXT_graphics_pipeline_library"
// ...

Desired output:

EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME               = "VK_EXT_display_surface_counter"
EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION                 = 1
// etc...
@bbredesen bbredesen added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 6, 2023
@bbredesen bbredesen transferred this issue from bbredesen/go-vk Mar 6, 2023
@bbredesen
Copy link
Owner Author

Included in this is an update to typed extension const values too, sorting those by the value.

const (
	STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR             StructureType = 1000114001
	STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR         StructureType = 1000078001
	STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR         StructureType = 1000078000
)

Becomes:

const (
	STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR             StructureType = 1000114001
	STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR         StructureType = 1000078000
	STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR         StructureType = 1000078001
)

bbredesen added a commit that referenced this issue Mar 6, 2023
issue #3, add val sort by name, mod sort by val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant