Skip to content

Conversation

@Keenuts
Copy link
Contributor

@Keenuts Keenuts commented Feb 13, 2023

This commit adds a C++ wrapper above the current spvBinaryParse function. I tried to match it 1:1, except for 2 things:

  • std::function<>& are used. No more function pointers, allowing context capture.
  • spv_result_t replaced with a boolean, to match other C++ apis.

Callbacks still return a spv_result_t because the underlying implem relies on that. The convertion from spv_result_t to boolean is only done at the boundary.

This commit adds a C++ wrapper above the current spvBinaryParse
function. I tried to match it 1:1, except for 2 things:
 - std::function<>& are used. No more function pointers, allowing
   context capture.
 - spv_result_t replaced with a boolean, to match other C++ apis.

Callbacks still return a spv_result_t because the underlying implem
relies on that. The convertion from spv_result_t to boolean is only done
at the boundary.

Signed-off-by: Nathan Gauër <[email protected]>
@Keenuts Keenuts marked this pull request as ready for review February 13, 2023 18:25
@Keenuts Keenuts requested a review from s-perron February 14, 2023 14:31
s-perron
s-perron previously approved these changes Feb 14, 2023
Copy link
Collaborator

@s-perron s-perron left a comment

Choose a reason for hiding this comment

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

This looks great thanks. Just a few minor nits, and then it is good to merge.

@s-perron s-perron merged commit b84c86f into KhronosGroup:main Feb 14, 2023
@Keenuts Keenuts deleted the cxx-parsing branch February 14, 2023 19:11
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