Vulkan-Docs/scripts/htmldiff

82 lines
2.8 KiB
Plaintext
Raw Normal View History

Change log for November 11, 2016 Vulkan 1.0.33 spec update: * Bump API patch number and header version number to 33 for this update. Github Issues: * Added implicit external synchronization parameters to vkBegin/EndCommandBuffer, and fixed missing command pool host synchronization from per-command lists (public issue 398). * Started using git tags including the spec release number, such as 'v1.0.32-core', instead of tags including the date of release, such as 'v1.0-core-20161025' (public issue 405). Internal Issues: * Add validity constraint for slink:VkImportMemoryWin32HandleInfoNV::pname:handle (internal issue #480). * Add scripts to compare two Vulkan HTML specifications, derived from W3 htmldiff service (internal issue 525). * Relax requirement that memoryTypeBits can't depend on format, to allow it to differ only for depth/stencil formats (internal issue 544). * Add a new generator script to create a simple extension loader for Vulkan based on +vk.xml+ (internal issue 558). * Add the overlooked requirement that buffer and image memory alignment requirements must be a power of two in the <<resources-association,Resource Memory Association>> section (internal issue 569). Other Issues: * Add a naming rule to the style guide for members of extension structures defining array lengths which are the same as array lengths of the core structure they are chained from. * Add a new generator to create a simple extension loader in +src/ext_loader/vulkan_ext.[ch]+ from +vk.xml+. This code can be included in your project, and is expected to be packaged in the Vulkan SDK provided by LunarG in the future.
2016-11-12 11:23:34 +00:00
#!/usr/bin/python
#
# Modified from the htmldiff script developed by Dominique HazaC+l-Massieux
# for the http://services.w3.org/htmldiff website. That script did not
# include a copyright statement.
import atexit
import os
import re
import sys
import tempfile
import tidy
from subprocess import Popen, PIPE
def tidyFile(filename):
ifp = open(filename, 'r')
# option for tidy
options = dict(tidy_mark=0,show_warnings=0,quiet=1,char_encoding='utf8')
html5 = re.search(r"<!doctype\s+html\s*>", ifp.read(4096),
re.IGNORECASE)
ifp.seek(0)
html5_options = {'add_xml_space': 'no',
'output_xhtml': 'no',
'tidy_mark': 'no',
'new_blocklevel_tags': 'article,aside,canvas,dialog,details,figcaption,figure,footer,header,hgroup,menu,nav,section,main,summary,math,semantics,mrow,mfenced,mtable,mtr,mtd,mi,mn,msub,mo,mfrac,munderover,mtext,svg,g,image,rect,text,desc,line,path,polygon,ellipse,tspan,defs,feoffset,fecolormatrix,filter,fegaussianblur,feblend,marker,circle',
'new_inline_tags': 'video,audio,canvas,ruby,rt,rp,time,meter,progress,track,source,emu-val,emu-nt,emu-t,mark',
'break_before_br': 'no',
'vertical_space': 'no',
'enclose_text': 'no',
'numeric_entities': 'yes',
'wrap': '1000',
'wrap_attributes': 'no',
'drop_empty_paras': 'no'
}
if html5:
options.update(html5_options)
newtidy = tidy.parseString(ifp.read(), **options)
if len(newtidy.errors) > 0:
if not html5:
ifp.seek(0)
options.update(html5_options)
newtidy = tidy.parseString(ifp.read(), **options)
ifp.close()
fp = tempfile.NamedTemporaryFile(
mode='w+', prefix='htmldiff-', suffix='.html')
atexit.register(fp.close)
fp.write(str(newtidy))
fp.flush()
fp.seek(0)
# sys.stderr.write('tidyFile: tempfile name %s\n' % fp.name)
if (newtidy.errors):
sys.stderr.write('tidyFile: tidy.parseString error: %s\n' % str(newtidy.errors))
return fp
if __name__ == '__main__':
if (len(sys.argv) < 3):
sys.stderr.write('tidy: need args file1 file2\n')
sys.exit(1)
refdoc = tidyFile(sys.argv[1])
newdoc = tidyFile(sys.argv[2])
Change log for June 4, 2017 Vulkan 1.0.51 spec update: * Bump API patch number and header version number to 51 for this update. Github Issues: * Add Valid Usage statement to flink:vkCmdResolveImage to require that source and destination image formats match (public issue 492). * Specify that a code:char* parameter must: be a valid null-terminated string in the <<fundamentals-implicit-validity, implicit valid usage>> section (public issue 494). * Removed unnecessary VU for slink:VkPhysicalDeviceFeatures which is covered by ename:VK_ERROR_FEATURE_NOT_PRESENT already (public issue 496). * Clarify valid usage of pname:pQueueFamilyIndices in slink:VkBufferCreateInfo, slink:VkImageCreateInfo, and slink:VkSwapchainCreateInfoKHR (public issue 501). * Document that dependencies of enabled extensions must also be enabled in the <<extended-functionality-extensions-dependencies, Extension Dependencies>> section (public issue 507). Internal Issues: * Change slink:VkMappedMemoryRange valid usage to allow pname:offset + pname:size == size of the allocation. Also, if ename:VK_WHOLE_SIZE is used, require the end of the mapping to be aligned to a multiple of pname:nonCoherentAtomSize (internal issue 611). * Add issue to `VK_KHR_win32_surface` about reusing window objects from a different graphics API or Vulkan ICD (internal issue 639). * Require locations on user in/out in `GL_KHR_vulkan_glsl` (internal issue 783). * Added version info to the json validation output, and updated the schema to match (internal issue 838). * Restructure enumerated type descriptions separately from the command or structure they are used in, allowing better reference page generation (internal issue 841). * Re-sort extension appendices to be in alphabetical order within each author ID section. * Fix enum naming and clarify behavior for `VK_NVX_device_generated_commands` extension. New Extensions:
2017-06-05 03:48:43 +00:00
scriptdir = os.path.abspath(os.path.dirname(sys.argv[0]))
perlscript = os.path.join(scriptdir, 'htmldiff.pl')
p = Popen([perlscript, refdoc.name, newdoc.name],
Change log for November 11, 2016 Vulkan 1.0.33 spec update: * Bump API patch number and header version number to 33 for this update. Github Issues: * Added implicit external synchronization parameters to vkBegin/EndCommandBuffer, and fixed missing command pool host synchronization from per-command lists (public issue 398). * Started using git tags including the spec release number, such as 'v1.0.32-core', instead of tags including the date of release, such as 'v1.0-core-20161025' (public issue 405). Internal Issues: * Add validity constraint for slink:VkImportMemoryWin32HandleInfoNV::pname:handle (internal issue #480). * Add scripts to compare two Vulkan HTML specifications, derived from W3 htmldiff service (internal issue 525). * Relax requirement that memoryTypeBits can't depend on format, to allow it to differ only for depth/stencil formats (internal issue 544). * Add a new generator script to create a simple extension loader for Vulkan based on +vk.xml+ (internal issue 558). * Add the overlooked requirement that buffer and image memory alignment requirements must be a power of two in the <<resources-association,Resource Memory Association>> section (internal issue 569). Other Issues: * Add a naming rule to the style guide for members of extension structures defining array lengths which are the same as array lengths of the core structure they are chained from. * Add a new generator to create a simple extension loader in +src/ext_loader/vulkan_ext.[ch]+ from +vk.xml+. This code can be included in your project, and is expected to be packaged in the Vulkan SDK provided by LunarG in the future.
2016-11-12 11:23:34 +00:00
stdin=PIPE, stdout=PIPE, stderr=PIPE)
sys.stdout.flush()
sys.stderr.flush()
(out, err) = p.communicate()
p.stdin.close()
if err:
sys.stderr.write('htmldiff: An error occured when running htmldiff.pl on the documents:', str(err))
exit(1)
else:
print(out)