2016-02-16 09:53:44 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
#
|
|
|
|
# Copyright (c) 2013-2016 The Khronos Group Inc.
|
|
|
|
#
|
2016-04-21 08:08:38 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
2016-02-16 09:53:44 +00:00
|
|
|
#
|
2016-04-21 08:08:38 +00:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2016-02-16 09:53:44 +00:00
|
|
|
#
|
2016-04-21 08:08:38 +00:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
# Usage: realign [infile] > outfile
|
|
|
|
# Used to realign XML tags in the Vulkan registry after it's operated on by
|
|
|
|
# some other filter, since whitespace inside a tag isn't part of the
|
|
|
|
# internal representation.
|
|
|
|
|
|
|
|
import copy, sys, string, re
|
|
|
|
|
|
|
|
def realignXML(fp):
|
|
|
|
patterns = [
|
|
|
|
[ '(^ *\<type .*)(category=[\'"]bitmask[\'"].*)', 58 ],
|
|
|
|
[ '(^ *\<enum [bv].*)(name=.*)', 28 ],
|
|
|
|
[ '(^ *\<enum [bv].*)(comment=.*)', 85 ]
|
|
|
|
]
|
|
|
|
|
|
|
|
# Assemble compiled expressions to match and alignment columns
|
|
|
|
numpat = len(patterns)
|
|
|
|
regexp = [ re.compile(patterns[i][0]) for i in range(0,numpat)]
|
|
|
|
column = [ patterns[i][1] for i in range(0,numpat)]
|
|
|
|
|
|
|
|
lines = fp.readlines()
|
|
|
|
for line in lines:
|
|
|
|
emitted = False
|
|
|
|
for i in range(0,len(patterns)):
|
|
|
|
match = regexp[i].match(line)
|
|
|
|
if (match):
|
|
|
|
if (not emitted):
|
Change log for November 25, 2016 Vulkan 1.0.35 spec update:
* Bump API patch number and header version number to 35 for this update.
Github Issues:
* Document in the <<memory-device-hostaccess,Host Access>> section that
mapping and unmapping does not invalidate or flush the mapped memory
(public issues 27, 126).
* Redefine the entire <<synchronization>> chapter in terms of consistent
and well defined terminology, that's called out at the start of the
chapter. This terminology is applied equally to all synchronization
types, including subpass dependencies, submissions, and much of the
implicit ordering stuff dotted around the spec. Key terms are laid out
in the <<synchronization-dependencies,Execution and Memory
Dependencies>> section at the top of the rewritten chapter (public
issues 128, 131, 132, 217, 299, 300, 302, 306, 322, 346, 347, 371, 407).
* Specify order of submission for batches in the
<<vkQueueSubmit,vkQueueSubmit>> and
<<vkQueueBindSparse,vkQueueBindSparse>> commands (public issue 371).
* Add valid usage statements to each of the WSI extension sections
indicating that the WSI-specific structure parameters must be valid, and
remove automatically generated valid usage statements now covered by the
manual sections (public issue 383).
* Clarify render pass compatibility for flink:vkCmdExecuteCommands (public
issue 390).
Internal Issues:
* Update +vk.xml+ to make previously explicit valid usage statements for
<<vkDebugReportMessageEXT,vkDebugReportMessageEXT>> implicit instead
(internal issue 553).
* Add valid usage statement for slink:VkCreateImageInfo preventing
creation of 1D sparse images (internal issue 573).
* Fix Python scripts to always read/write files in utf-8 encoding, and a
logic error in reflib.py which could cause a fatal error for
malstructured asciidoc (internal issues 578, 586).
2016-11-26 10:33:44 +00:00
|
|
|
#print('# While processing line: ' + line, end='')
|
2016-02-16 09:53:44 +00:00
|
|
|
emitted = True
|
Change log for November 25, 2016 Vulkan 1.0.35 spec update:
* Bump API patch number and header version number to 35 for this update.
Github Issues:
* Document in the <<memory-device-hostaccess,Host Access>> section that
mapping and unmapping does not invalidate or flush the mapped memory
(public issues 27, 126).
* Redefine the entire <<synchronization>> chapter in terms of consistent
and well defined terminology, that's called out at the start of the
chapter. This terminology is applied equally to all synchronization
types, including subpass dependencies, submissions, and much of the
implicit ordering stuff dotted around the spec. Key terms are laid out
in the <<synchronization-dependencies,Execution and Memory
Dependencies>> section at the top of the rewritten chapter (public
issues 128, 131, 132, 217, 299, 300, 302, 306, 322, 346, 347, 371, 407).
* Specify order of submission for batches in the
<<vkQueueSubmit,vkQueueSubmit>> and
<<vkQueueBindSparse,vkQueueBindSparse>> commands (public issue 371).
* Add valid usage statements to each of the WSI extension sections
indicating that the WSI-specific structure parameters must be valid, and
remove automatically generated valid usage statements now covered by the
manual sections (public issue 383).
* Clarify render pass compatibility for flink:vkCmdExecuteCommands (public
issue 390).
Internal Issues:
* Update +vk.xml+ to make previously explicit valid usage statements for
<<vkDebugReportMessageEXT,vkDebugReportMessageEXT>> implicit instead
(internal issue 553).
* Add valid usage statement for slink:VkCreateImageInfo preventing
creation of 1D sparse images (internal issue 573).
* Fix Python scripts to always read/write files in utf-8 encoding, and a
logic error in reflib.py which could cause a fatal error for
malstructured asciidoc (internal issues 578, 586).
2016-11-26 10:33:44 +00:00
|
|
|
#print('# matched expression: ' + patterns[i][0])
|
|
|
|
#print('# clause 1 = ' + match.group(1))
|
|
|
|
#print('# clause 2 = ' + match.group(2))
|
2016-02-16 09:53:44 +00:00
|
|
|
line = match.group(1).ljust(column[i]) + match.group(2)
|
|
|
|
if (emitted):
|
|
|
|
print(line)
|
|
|
|
else:
|
|
|
|
print(line, end='')
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if (len(sys.argv) > 1):
|
Change log for November 25, 2016 Vulkan 1.0.35 spec update:
* Bump API patch number and header version number to 35 for this update.
Github Issues:
* Document in the <<memory-device-hostaccess,Host Access>> section that
mapping and unmapping does not invalidate or flush the mapped memory
(public issues 27, 126).
* Redefine the entire <<synchronization>> chapter in terms of consistent
and well defined terminology, that's called out at the start of the
chapter. This terminology is applied equally to all synchronization
types, including subpass dependencies, submissions, and much of the
implicit ordering stuff dotted around the spec. Key terms are laid out
in the <<synchronization-dependencies,Execution and Memory
Dependencies>> section at the top of the rewritten chapter (public
issues 128, 131, 132, 217, 299, 300, 302, 306, 322, 346, 347, 371, 407).
* Specify order of submission for batches in the
<<vkQueueSubmit,vkQueueSubmit>> and
<<vkQueueBindSparse,vkQueueBindSparse>> commands (public issue 371).
* Add valid usage statements to each of the WSI extension sections
indicating that the WSI-specific structure parameters must be valid, and
remove automatically generated valid usage statements now covered by the
manual sections (public issue 383).
* Clarify render pass compatibility for flink:vkCmdExecuteCommands (public
issue 390).
Internal Issues:
* Update +vk.xml+ to make previously explicit valid usage statements for
<<vkDebugReportMessageEXT,vkDebugReportMessageEXT>> implicit instead
(internal issue 553).
* Add valid usage statement for slink:VkCreateImageInfo preventing
creation of 1D sparse images (internal issue 573).
* Fix Python scripts to always read/write files in utf-8 encoding, and a
logic error in reflib.py which could cause a fatal error for
malstructured asciidoc (internal issues 578, 586).
2016-11-26 10:33:44 +00:00
|
|
|
realignXML(open(sys.argv[1], 'r', encoding='utf-8'))
|
2016-02-16 09:53:44 +00:00
|
|
|
else:
|
|
|
|
realignXML(sys.stdin)
|