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

util: Fixup and add Layer Dispatch Table headers #69

Merged

Conversation

charles-lunarg
Copy link
Collaborator

Fixes the vk_layer_dispatch_table.h and vk_dispatch_table_helper.h header files so that they can be used in other projects.

The vk_layer_dispatch_table.h header contains the VkLayerDispatchTable struct containing device function pointers and the VkLayerInstanceDispatchTable struct containing instance function pointers. These structs simplify the storage of Vulkan function pointers.

The vk_dispatch_table_helper.h header contains functions which fill out the structs defined in vk_layer_dispatch_table.h with function pointers. These functions automate acquiring the function pointers to the next layer in the chain.

include/CMakeLists.txt Outdated Show resolved Hide resolved
tests/CMakeLists.txt Outdated Show resolved Hide resolved
tests/layer_dispatch_table/test_c_interface.c Outdated Show resolved Hide resolved
scripts/generators/dispatch_table_helper_generator.py Outdated Show resolved Hide resolved
include/CMakeLists.txt Outdated Show resolved Hide resolved
scripts/generators/dispatch_table_helper_generator.py Outdated Show resolved Hide resolved
include/CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
include/CMakeLists.txt Outdated Show resolved Hide resolved
@charles-lunarg charles-lunarg force-pushed the add_layer_dispatch_tables branch 3 times, most recently from ee2ad3f to 39fb8f7 Compare August 23, 2023 19:29
include/CMakeLists.txt Outdated Show resolved Hide resolved
include/vulkan/layer/vk_layer_dispatch_table.h Outdated Show resolved Hide resolved
include/vulkan/layer/vk_layer_dispatch_table.h Outdated Show resolved Hide resolved
scripts/generate_source.py Outdated Show resolved Hide resolved
scripts/generators/layer_dispatch_table_generator.py Outdated Show resolved Hide resolved
scripts/generators/layer_dispatch_table_generator.py Outdated Show resolved Hide resolved
scripts/generators/layer_dispatch_table_generator.py Outdated Show resolved Hide resolved
@charles-lunarg charles-lunarg force-pushed the add_layer_dispatch_tables branch 2 times, most recently from b15c42c to 1f6389a Compare August 23, 2023 20:46
Copy link
Contributor

@juan-lunarg juan-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from function naming convention nitpick

Fixes the vk_layer_dispatch_table.h header file so that they can be used
in other projects. The contents of this header and
 vk_dispatch_table_helper.h have been moved into a new header
 vul_dispatch_table.h.

The structs VulDeviceDispatchTable and VulInstanceDispatchTable
struct contain function pointers for the device and instance, respectively.

The functions vul_init_device_dispatch_table and
vul_init_instance_dispatch_table fill out the aforementioned structs,
making the task of setting up the disptach table in a layer much simpler.
(Code generation does **not** happen automatically at build time.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(Code generation does **not** happen automatically at build time.)
Code generation does **not** happen automatically at build time. To make the library more consumable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think theres been enough force pushes for one PR 😛

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a FFTI no worries

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the library more consumable.

Also thats a sentence fragment. what is making the library more consumable? Should just drop the period.

typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName);

// Instance function pointer dispatch table
typedef struct VulInstanceDispatchTable_ {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VulInstanceDispatchTable_ ? why the underscore

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats how C types are defined - notice the VulInstanceDispatchTable after the }.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am error

@juan-lunarg juan-lunarg merged commit 2bd0e0d into KhronosGroup:main Aug 23, 2023
10 checks passed
@charles-lunarg charles-lunarg deleted the add_layer_dispatch_tables branch August 23, 2023 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants