-
Notifications
You must be signed in to change notification settings - Fork 123
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
Move vulkan codegen generators #1851
base: dev
Are you sure you want to change the base?
Move vulkan codegen generators #1851
Conversation
CI gfxreconstruct build queued with queue ID 291417. |
CI gfxreconstruct build # 5243 running. |
CI gfxreconstruct build # 5243 passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look good. Probably can squash the "Rename Base..."
@@ -858,6 +859,11 @@ def genType(self, typeinfo, name, alias): | |||
self.genUnion(typeinfo, name, alias) | |||
elif (category == 'handle'): | |||
self.handle_names.add(name) | |||
if ( | |||
type_elem is not None and type_elem.find('type') is not None | |||
and '_DEFINE_HANDLE' == type_elem.find('type').text[2:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this logic come from... not seeing it within this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't come anywhere. We used to hard-code the dispatchable handles in Vulkan. This code automatically determines what handles are dispatchable based on how they are defined in the registry file. That's why it's a separate commit. The title of the commit states this as:
codgen: Automatically determine dispatchable handles
and only adds this detection logic.
@@ -120,7 +120,6 @@ def make_cmd_body(self, return_type, name, values): | |||
else: | |||
arg_names.append(value.name) | |||
|
|||
# Vulkan return is very simple. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some comment that is need to replace this? It's not particularly a good comment originally, just wondering why it was here originally...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was here originally because of the shared DX12 code. That's why it was removed.
framework/generated/khronos_generators/khronos_base_generator.py
Outdated
Show resolved
Hide resolved
framework/generated/khronos_generators/khronos_base_generator.py
Outdated
Show resolved
Hide resolved
...rk/generated/khronos_generators/base_generators/base_struct_handle_mappers_body_generator.py
Outdated
Show resolved
Hide resolved
CI gfxreconstruct build queued with queue ID 300213. |
@locke-lunarg or @davidd-lunarg , can one of you review this because it's codegen? |
CI gfxreconstruct build # 5335 running. |
Move the Vulkan generator scripts under a khronos_generators folder to prepare it for for sharing with other khronos APIs.
DX12 was still relying on one file in the base_generators folder. Make a copy in the DX12 folder, and remove all references to the Vulkan and base_generators folders in the generate_dx12.py script.
Move the reformat_code.py into the base of khronos_generators.
Move common items from the vulkan_generators/base_generator.py to the khronos_generators/khronos_base_generator.py
Move more common type parsing into the khronos_base_generator from the vulkan/base_generator.
base_generator code still has vulkan-specific items in it. This starts the process of pulling those out.
Remove more vulkan-specific items in the base_generator code path.
Modify the handling of 'pNext' extended struct variables in the base_generators to be more Khronos-generic instead of Vulkan-specific.
First phase moving of base_generator files to have a khronos identifier
Since the khronos_base files were referring back to the parent "base_generator" (which in this case was Vulkan) it still resulted in a tight coupling. Move the "write" method into the khronos_base_generator script to solve this.
Consolidate the structure type name generation into one location shared with all future Khronos APIs.
Put variable naming in a common location
Removed local variables for use in decoder body scripts and created a "all_cmd_params" that isn't cleared after every feature update.
Added raising an exception on Python methods that should be implemented by the Khronos API for the functionality to properly work.
CI gfxreconstruct build # 5335 passed. |
1c1c5cd
to
9809efb
Compare
CI gfxreconstruct build queued with queue ID 300271. |
CI gfxreconstruct build # 5336 running. |
CI gfxreconstruct build # 5336 passed. |
These changes moves the current Vulkan and base generators into a better layout that can share code in a more understandable way.
Instead of:
After this change:
Also removed some duplication in the files and created utility functions to remove some additional Vulkan-specific items in the lower levels.
This is a big step towards building the appropriate structure for sharing files with OpenXR.