Skip to content

Decoder args#3007

Open
antonio-lunarg wants to merge 9 commits into
LunarG:devfrom
antonio-lunarg:antonio-decoder-args
Open

Decoder args#3007
antonio-lunarg wants to merge 9 commits into
LunarG:devfrom
antonio-lunarg:antonio-decoder-args

Conversation

@antonio-lunarg

Copy link
Copy Markdown
Contributor

No description provided.

@jzulauf-lunarg jzulauf-lunarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking really interesting. A couple thoughts. Doesn't handle the stack relative reference case patterns, but those only exist in D3D and OpenXR...

Comment thread framework/decode/vulkan_consumer_base.h Outdated
format::HandleId descriptorSet,
format::HandleId descriptorUpdateTemplate,
DescriptorUpdateTemplateDecoder* pData)
virtual void Process_vkUpdateDescriptorSetWithTemplate(const ApiCallInfo& call_info,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here and all following,

  1. The naming is redundant. Process(ApiCallInfo, UpdateDescriptorSetWithTemplateArgs) is unambiguous, though one could argue, less readable.

  2. The *Args seem to be insufficiently scoped in framework::decode, I'd be tempted to put them into a namespace.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How about args::UpdateDescriptorSetWithTemplate?

Comment thread framework/decode/vulkan_consumer_base.h Outdated
StructPointerDecoder<Decoded_VkRayTracingPipelineCreateInfoKHR>* pCreateInfos,
StructPointerDecoder<Decoded_VkAllocationCallbacks>* pAllocator,
HandlePointerDecoder<VkPipeline>* pPipelines)
virtual void Process_vkCreateRayTracingPipelinesKHR(const ApiCallInfo& call_info,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interface design question: Why not include the return value in the arg pack ... it's the expected return, correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My rationale is that a return value is not an argument, but there is no real benefit with keeping it separate, on the contrary it is convenient to include it imo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Included.

UpdateDescriptorSetWithTemplateArgs& args)
{
Generate_vkUpdateDescriptorSetWithTemplate(device, descriptorSet, descriptorUpdateTemplate, pData);
Generate_vkUpdateDescriptorSetWithTemplate(args.device, args.descriptorSet, args.descriptorUpdateTemplate, &args.pData);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Take a look at how the DispatchVistor::DispatchArgs used GetTuple and std::apply to avoid the manual unpacking.

As the *Args are code gen'd adding a tuple accessor(s) would be straight forward.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I opted for passing args directly.

Comment thread framework/decode/vulkan_decoder_args.h Outdated

for param in params:
decoded_type = self.make_decoded_param_type(param)
body += f" {decoded_type} {param.name};\n"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is where the GetTuple -ish generation would go... or even a method to call the appropriate Processes_(consumer, ...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I generated it, but its signature is slightly different than what functions exect.
While GetTuple returns references to the fields of the args structure, most functions expect pointers, rather than references.

@jzulauf-lunarg

Copy link
Copy Markdown
Contributor

@antonio-lunarg I didn't see the updated generate source associated with python you pushed for XR...

@antonio-lunarg

Copy link
Copy Markdown
Contributor Author

@jzulauf-lunarg I didn't see the updated generate source associated with python you pushed for XR...

I am only focusing on Vulkan to limit the scope of this PR.

@antonio-lunarg antonio-lunarg force-pushed the antonio-decoder-args branch 4 times, most recently from f9e7fcb to b5ee615 Compare June 10, 2026 07:00
@antonio-lunarg antonio-lunarg marked this pull request as ready for review June 10, 2026 07:00
@antonio-lunarg antonio-lunarg requested a review from a team as a code owner June 10, 2026 07:00
@antonio-lunarg antonio-lunarg added the approved-to-run-ci Can run CI check on internal LunarG machines label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-to-run-ci Can run CI check on internal LunarG machines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants