Compare commits
14 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e01a716ec | ||
|
|
8353545e2f | ||
|
|
b3ca603d67 | ||
|
|
7896468712 | ||
|
|
9b949f4e54 | ||
|
|
38c85349c2 | ||
|
|
a854e8972a | ||
|
|
9311385e5c | ||
|
|
3911ae40ac | ||
|
|
be583165e7 | ||
|
|
3660a51cce | ||
|
|
ab2b6dbf7a | ||
|
|
4b0ed3e825 | ||
|
|
616086b21d |
5 changed files with 108 additions and 11 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,2 +1 @@
|
|||
/vkroots-e554d4c.tar.gz
|
||||
/vkroots-2ceb105.tar.gz
|
||||
*.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
* Tue Jul 25 2023 Frantisek Zatloukal <fzatlouk@redhat.com> - 0^20230313gite554d4c-1
|
||||
- Rebase to a later snapshot
|
||||
|
||||
* Fri Mar 03 2023 Onuralp SEZER <thunderbirdtr@fedoraproject.org> - 0^20230103git2675710-1
|
||||
- Initial package vkroots
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (vkroots-2ceb105.tar.gz) = 96de173c9e44b1e367e44b7d49f2dbb2485b97c6426e92028c40bdc617375f0e65e87763baf8339c4cbafdb759044c2cad62a5ad24cab2325a171b47817c27f3
|
||||
SHA512 (vkroots-ee76e62.tar.gz) = 71ee33568d09e69929bcbfc666119dc365ed3f2e072099f4d19148075259611f14c09049f7011eab45fcd1d96867fb4d4d8c798dbbd5c93690962493b7f01bce
|
||||
|
|
|
|||
96
vkroots-fix-funcpointer-xml-format.patch
Normal file
96
vkroots-fix-funcpointer-xml-format.patch
Normal file
|
|
@ -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)
|
||||
|
||||
15
vkroots.spec
15
vkroots.spec
|
|
@ -1,7 +1,7 @@
|
|||
%global debug_package %{nil}
|
||||
%global commit 2ceb105700e23842bec0e56a0a2cbd5885dfcf4b
|
||||
%global commit ee76e620798612c52fb8dcc32a1058a0a3538930
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global git_date 20231119
|
||||
%global git_date 20260507
|
||||
|
||||
Name: vkroots
|
||||
Version: 0^%{git_date}git%{shortcommit}
|
||||
|
|
@ -9,9 +9,12 @@ Release: %autorelease
|
|||
Summary: A stupid simple method of making Vulkan layers, at home
|
||||
License: LGPL-2.1-or-later AND (Apache-2.0 or MIT)
|
||||
URL: https://github.com/Joshua-Ashton/vkroots
|
||||
Source: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: meson
|
||||
Source: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||
Patch0: vkroots-fix-funcpointer-xml-format.patch
|
||||
|
||||
BuildRequires: meson >= 0.58.0
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: vulkan-headers
|
||||
|
|
@ -32,6 +35,10 @@ takes all the complexity/hastle away from you. It's so simple.
|
|||
%prep
|
||||
%autosetup -p1 -n %{name}-%{commit}
|
||||
|
||||
# Autogenerate the header based on the installed Vulkan Headers
|
||||
cd gen
|
||||
./make_vkroots -v -x /usr/share/vulkan/registry/vk.xml
|
||||
|
||||
|
||||
%build
|
||||
%meson
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue