public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Simone Caronni <negativo17@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/vkroots] rawhide: Fix for new Vulkan 1.4.341+ XML format; add parsing for both old and new format.
Date: Thu, 25 Jun 2026 13:33:38 GMT	[thread overview]
Message-ID: <178239441884.1.17021982142064574525.rpms-vkroots-b3ca603d6748@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/vkroots
Branch : rawhide
Commit : b3ca603d6748e2c218e0f433389fa8f7b522a4de
Author : Simone Caronni <negativo17@gmail.com>
Date   : 2026-06-25T15:33:09+02:00
Stats  : +98/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/vkroots/c/b3ca603d6748e2c218e0f433389fa8f7b522a4de?branch=rawhide

Log:
Fix for new Vulkan 1.4.341+ XML format; add parsing for both old and new format.

---
diff --git a/vkroots-fix-funcpointer-xml-format.patch b/vkroots-fix-funcpointer-xml-format.patch
new file mode 100644
index 0000000..98a8bf8
--- /dev/null
+++ b/vkroots-fix-funcpointer-xml-format.patch
@@ -0,0 +1,96 @@
+--- a/gen/vulkan_helpers.py	2026-05-07 22:00:10.000000000 +0200
++++ b/gen/vulkan_helpers.py	2026-06-25 15:23:53.756076567 +0200
+@@ -462,38 +462,51 @@
+             return None
+ 
+         members = []
+-        begin = None
++        proto = funcpointer.find("proto")
+ 
+-        for t in funcpointer.findall("type"):
+-            # General form:
+-            # <type>void</type>*       pUserData,
+-            # Parsing of the tail (anything past </type>) is tricky since there
+-            # can be other data on the next line like: const <type>int</type>..
+-
+-            const = True if begin and "const" in begin else False
+-            _type = t.text
+-            lines = t.tail.split(",\n")
+-            if lines[0][0] == "*":
+-                pointer = "*"
+-                name = lines[0][1:].strip()
+-            else:
+-                pointer = None
+-                name = lines[0].strip()
++        if proto is not None:
++            # New XML format (vulkan-headers 1.4.341+):
++            # <proto><type>void</type> <name>PFN_foo</name></proto>
++            # <param><type>typeA</type>* <name>parmA</name></param>
++            proto_type_elem = proto.find("type")
++            ret_type = proto_type_elem.text
++            ret_ptr = "*" if proto_type_elem.tail and "*" in proto_type_elem.tail else ""
++            _type = "typedef {}{} (VKAPI_PTR *".format(ret_type, ret_ptr)
++            name = proto.find("name").text
++
++            for param in funcpointer.findall("param"):
++                member = VkMember.from_xml(param, False, None)
++                if member:
++                    members.append(member)
++        else:
++            # Old XML format:
++            # typedef void (VKAPI_PTR *<name>PFN_foo</name>)(
++            #     <type>typeA</type>* parmA,
++            begin = None
++            for t in funcpointer.findall("type"):
++                const = True if begin and "const" in begin else False
++                param_type = t.text
++                lines = t.tail.split(",\n")
++                if lines[0][0] == "*":
++                    pointer = "*"
++                    param_name = lines[0][1:].strip()
++                else:
++                    pointer = None
++                    param_name = lines[0].strip()
+ 
+-            # Filter out ); if it is contained.
+-            name = name.partition(");")[0]
++                # Filter out ); if it is contained.
++                param_name = param_name.partition(");")[0]
++
++                try:
++                    begin = lines[1].strip()
++                except IndexError:
++                    begin = None
+ 
+-            # If tail encompasses multiple lines, assign the second line to begin
+-            # for the next line.
+-            try:
+-                begin = lines[1].strip()
+-            except IndexError:
+-                begin = None
++                members.append(VkMember(const=const, _type=param_type, pointer=pointer, name=param_name))
+ 
+-            members.append(VkMember(const=const, _type=_type, pointer=pointer, name=name))
++            _type = funcpointer.text
++            name = funcpointer.find("name").text
+ 
+-        _type = funcpointer.text
+-        name = funcpointer.find("name").text
+         if "requires" in funcpointer.attrib:
+             forward_decls = funcpointer.attrib.get("requires").split(",")
+         else:
+@@ -2069,10 +2082,13 @@
+                     continue
+ 
+             # Name is in general within a name tag else it is an optional
+-            # attribute on the type tag.
++            # attribute on the type tag. For the new funcpointer format,
++            # the name is nested inside <proto><name>...</name></proto>.
+             name_elem = t.find("name")
+             if name_elem is not None:
+                 type_info["name"] = name_elem.text
++            elif t.find("proto/name") is not None:
++                type_info["name"] = t.find("proto/name").text
+             else:
+                 type_info["name"] = t.attrib.get("name", None)
+ 

diff --git a/vkroots.spec b/vkroots.spec
index 2db1f0c..861a097 100644
--- a/vkroots.spec
+++ b/vkroots.spec
@@ -12,7 +12,8 @@ URL:            https://github.com/Joshua-Ashton/vkroots
 BuildArch:      noarch
 
 Source:         %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
-Patch:          https://patch-diff.githubusercontent.com/raw/misyltoad/vkroots/pull/12.patch
+Patch0:         https://patch-diff.githubusercontent.com/raw/misyltoad/vkroots/pull/12.patch
+Patch1:         vkroots-fix-funcpointer-xml-format.patch
 
 BuildRequires:  meson >= 0.58.0
 BuildRequires:  gcc

                 reply	other threads:[~2026-06-25 13:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178239441884.1.17021982142064574525.rpms-vkroots-b3ca603d6748@fedoraproject.org \
    --to=negativo17@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox