2016-02-16 09:53:44 +00:00
|
|
|
= Vulkan Specification Build Instructions and Notes =
|
|
|
|
|
|
|
|
* <<intro,Introduction>>
|
|
|
|
* <<building,Building the spec>>
|
|
|
|
* <<macros,Our asciidoc macros>>
|
2016-07-11 01:13:41 +00:00
|
|
|
* <<refpages,Reference Pages>>
|
2016-02-16 09:53:44 +00:00
|
|
|
* <<styles,Our stylesheets>>
|
|
|
|
* <<equations,Imbedding equations>>
|
|
|
|
* <<anchors,Anchors and xrefs>>
|
|
|
|
* <<depends,Software dependencies>> (general and platform-specific)
|
|
|
|
* <<history,Revision history>>
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[intro]]
|
|
|
|
== Introduction ==
|
|
|
|
|
|
|
|
This README describes important stuff for getting the Vulkan API
|
|
|
|
specification and reference pages building properly.
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[building]]
|
|
|
|
== Building The Spec ==
|
|
|
|
|
|
|
|
Assuming you have all the right tools installed (see <<depends,Software
|
|
|
|
Dependencies>> below), you should be able to go to
|
2016-07-11 01:13:41 +00:00
|
|
|
+...path-to-git-repo/vulkan/doc/specs/vulkan+ and:
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
$ make all
|
|
|
|
|
|
|
|
or equivalently:
|
|
|
|
|
|
|
|
$ make xhtml chunked pdf manhtml manpdf manpages manhtmlpages checkinc checklinks
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
This should generate a variety of targets under +$(OUTDIR)+ (by default,
|
|
|
|
+../../../out/1.0+). The checked-in file +$(OUTDIR)/index.html+ links to
|
|
|
|
them all, or they can individually be found as follows:
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
* API spec:
|
2016-07-11 01:13:41 +00:00
|
|
|
** Single-file XHTML (from a2x) - +$(OUTDIR)/xhtml/vkspec.html+
|
|
|
|
** Chunked HTML (from a2x) - +$(OUTDIR)/vkspec.chunked/index.html+
|
|
|
|
** PDF (from a2x) - +$(OUTDIR)/pdf/vkspec.pdf+
|
2016-02-16 09:53:44 +00:00
|
|
|
* Man pages:
|
2016-07-11 01:13:41 +00:00
|
|
|
** Single-file HTML - +$(OUTDIR)/apispec.html+
|
|
|
|
** File-per-entry-point HTML - +$(OUTDIR)/man/html/*+
|
|
|
|
** File-per-entry-point nroff source - +$(OUTDIR)/man/3/*+
|
2016-02-16 09:53:44 +00:00
|
|
|
* Validator output:
|
|
|
|
** List of commands, structs, etc. missing from the API spec -
|
2016-07-11 01:13:41 +00:00
|
|
|
+$(OUTDIR)/checks/notInSpec.txt+
|
|
|
|
** Validator script output for API spec - +$(OUTDIR)/checks/specErrs.txt
|
2016-02-16 09:53:44 +00:00
|
|
|
** Validator script output for reference pages -
|
2016-07-11 01:13:41 +00:00
|
|
|
+$(OUTDIR)/checks/manErrs.txt+
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
We strongly sugges that once you have the basic build working, you use e.g.
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
$ make -j 8
|
2016-02-16 09:53:44 +00:00
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
(or other appropriate number depending on the number of CPU cores you have)
|
|
|
|
to parallelize the reference page builds, since there are so many of them.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
If your asciidoc installation does not put the stylesheets and xsl files in
|
|
|
|
the standard +/etc/asciidoc/dblatex+ directory, set the environment variable
|
|
|
|
+DBLATEXPREFIX+ to the path to that directory (the one containing the
|
|
|
|
+asciidoc-dblatex.xsl+ and +asciidoc-dblatex.sty+ files installed with
|
|
|
|
asciidoc).
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
[[building-test]]
|
|
|
|
=== Alternate and Test Builds ===
|
2016-02-16 09:53:44 +00:00
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
If you are just testing asciidoc formatting, macros, stylesheets, etc.,
|
|
|
|
we suggest editing +vkspec.txt+ to comment out most of the chapter
|
|
|
|
includes.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
In addition to the XHTML and PDF targets, there is also a single-file HTML5
|
2016-07-11 01:13:41 +00:00
|
|
|
target, +html+, which generates output directly from asciidoc without going
|
2016-02-16 09:53:44 +00:00
|
|
|
through Docbook. This is somewhat quicker to generate, but formatting and
|
|
|
|
section numbers aren't consistent with the other builds and it is not for
|
2016-07-11 01:13:41 +00:00
|
|
|
publication - just testing. The +html+ target will generate the file
|
|
|
|
+$(OUTDIR)/html/vkspec.html+ .
|
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
=== Rebuilding The Generated Images ===
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
There are some images in the +images/+ directory which are maintained in one
|
2016-02-16 09:53:44 +00:00
|
|
|
format but need to be converted to another format for corresponding types of
|
|
|
|
output. Most are SVG converted to PDF, some are PPT converted to PDF
|
|
|
|
converted to SVG. SVG and PDF forms are needed for the HTML and PDF output
|
|
|
|
formats, respectively.
|
|
|
|
|
|
|
|
These files are not automatically converted by the Makefile. Instead, all
|
2016-07-11 01:13:41 +00:00
|
|
|
output forms required are checked into +images/+ . On the rare occasions that
|
|
|
|
someone changes a source document and needs to regenerate the other forms:
|
|
|
|
|
|
|
|
cd images
|
|
|
|
make
|
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
[[macros]]
|
|
|
|
== Our Asciidoc Macros ==
|
|
|
|
|
|
|
|
We use a bunch of custom macros in the reference pages and API spec asciidoc
|
|
|
|
sources. The validator scripts rely on these macros as part of their sanity
|
|
|
|
checks, and you should use the macros whenever referring to an API command,
|
|
|
|
struct, token, or enum name, so the documents are semantically tagged and
|
|
|
|
more easily verifiable.
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
The supported macros are defined in +config/vkspec.conf+ (for the API spec)
|
|
|
|
and +config/manpages.conf+ (for the reference pages).
|
|
|
|
|
|
|
|
The tags used are described in the style guide (+styleguide.txt+).
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
We will eventually tool up the spec and ref pages to the point that anywhere
|
2016-07-11 01:13:41 +00:00
|
|
|
there's a type or token referred to, clicking on (or perhaps hovering over)
|
|
|
|
it in the HTML view and be taken to the definition of that type/token. That
|
|
|
|
will take some more plumbing work to tag the stuff in the autogenerated
|
|
|
|
include files, and do something sensible in the spec (e.g. resolve links to
|
|
|
|
internal references).
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
Most of these macros deeply need more intuitive names.
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
|
|
|
[[refpages]]
|
|
|
|
== Reference Pages ==
|
|
|
|
|
|
|
|
Prior to the 1.0.20 update of the API spec, the reference pages in +man/+
|
|
|
|
were handwritten, incomplete, and often way out of date with respect to the
|
|
|
|
spec.
|
|
|
|
|
|
|
|
Our initial effort to address this was to tag the API spec to help identify
|
|
|
|
boundaries of language talking about different commands, structures,
|
|
|
|
enumerants, and other types, then use a set of Python scripts to
|
|
|
|
automatically extract that language into the corresponding ref page. Pages
|
|
|
|
without corresponding content in the API spec are generated automatically,
|
|
|
|
when possible.
|
|
|
|
|
|
|
|
This has generated a semantically complete set of ref pages. Although they
|
|
|
|
are still far from ideal, they now fully document the API, and will stay in
|
|
|
|
sync with it. A significant drawback of this approach is that the only place
|
|
|
|
ref pages for extension interfaces can be generated is inside the
|
|
|
|
corresponding extension branches.
|
|
|
|
|
|
|
|
If for some reason you want to regenerate the ref pages from scratch
|
|
|
|
yourself, you can do so by
|
|
|
|
|
|
|
|
$ rm man/apispec.txt
|
|
|
|
$ make apispec.txt
|
|
|
|
|
|
|
|
The +genRef.py+ script will generate many warnings, but most are just
|
|
|
|
reminders that some pages are automatically generated. If everything is
|
|
|
|
working correctly, all the +man/*.txt+ files will be regenerated, but their
|
|
|
|
contents will not change.
|
|
|
|
|
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[styles]]
|
|
|
|
== Our stylesheets ==
|
|
|
|
|
|
|
|
NOTE: Section mostly TBD.
|
|
|
|
|
|
|
|
This branch introduces a Vulkan-specific XHTML CSS stylesheet
|
2016-07-11 01:13:41 +00:00
|
|
|
in +config/vkspec-xhtml.css+ . Mostly it just clones the default
|
2016-02-16 09:53:44 +00:00
|
|
|
Asciidoc stylesheet, but adds some new features:
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
=== Marking Changes ===
|
|
|
|
|
|
|
|
There is the start of support for marking added, removed, and changed text
|
|
|
|
in the spec body. Currently this is supported *only* in the XHTML targets
|
2016-07-11 01:13:41 +00:00
|
|
|
(+xhtml+ and +chunked+), and *only* for paragraphs and spans of words.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
Added, removed, and changed material is marked with the asciidoc *roles*
|
|
|
|
named _added_, _removed_, and _changed_ respectively. They can be used to
|
|
|
|
mark an entire paragraph, as follows:
|
|
|
|
|
|
|
|
[role="change"]
|
|
|
|
This paragraph shows change markings.
|
|
|
|
|
|
|
|
Or a few words in a sentence, as follows:
|
|
|
|
|
|
|
|
This sentence contains [added]#some added words# and [removed]#some
|
|
|
|
removed words#.
|
|
|
|
|
|
|
|
The formatting of these roles text depends on the stylesheet. Currently it
|
|
|
|
all three roles are red text, and the "removed" role is also strike-through
|
|
|
|
text.
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
=== Marking Normative Language ===
|
|
|
|
|
|
|
|
There is support for marking normative language in the document. Currently
|
2016-07-11 01:13:41 +00:00
|
|
|
this is supported *only* in the XHTML targets (+xhtml+ and +chunked+).
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
Normative language is marked with the asciidoc *role* named _normative_.
|
|
|
|
It can be used to mark entire paragraphs or spans of words, in the
|
|
|
|
same fashion as change markings (described above). In addition, the
|
|
|
|
normative terminology macros, such as must: and may: and cannot:,
|
|
|
|
always use this role.
|
|
|
|
|
|
|
|
The formatting of normative language depends on the stylesheet. Currently it
|
|
|
|
just comes out in purple. There will be some way to turn this on or off at
|
|
|
|
build time shortly.
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[equations]]
|
|
|
|
== Imbedding Equations
|
|
|
|
|
|
|
|
Equations should be written using the latexmath: inline and block macros.
|
|
|
|
The contents of the latexmath: blocks should be LaTeX math notation,
|
|
|
|
surrounded by appropriate delimiters - pass:[$$], +++\[\\]+++, pass:[\(\)],
|
|
|
|
or pass:[\begin{env}/\end{env}] math environments such as pass:[{equation*}]
|
|
|
|
or pass:[{align*}].
|
|
|
|
|
|
|
|
The asciidoc macros and configuration files, as well as the dblatex
|
|
|
|
customization layers, have been modified significantly so that LaTeX math is
|
|
|
|
passed through unmodified to all HTML output forms (using the MathJax engine
|
|
|
|
for real-time rendering of equations) and to dblatex for PDF output.
|
|
|
|
|
|
|
|
The following caveats apply:
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
* The special characters +<+ , +>+ , and +&+ can currently be used only in
|
2016-02-16 09:53:44 +00:00
|
|
|
+++[latexmath]+++ block macros, not in +++latexmath:[]+++ inline macros.
|
2016-07-11 01:13:41 +00:00
|
|
|
Instead use +\lt+ for +<+ and +\gt+ for +>+. +&+ is an alignment construct
|
|
|
|
for multiline equations, and should only appear in block macros anyway.
|
2016-02-16 09:53:44 +00:00
|
|
|
* AMSmath environments (e.g. pass:[\begin{equation*}], pass:[{align*}],
|
|
|
|
etc.) can be used, to the extent MathJax supports them.
|
|
|
|
* When using AMSmath environments, do *not* also surround the equation block
|
|
|
|
with +++\[\\]+++ brackets. That is not legal LaTeX math and will break the
|
|
|
|
PDF build. It is good practice to make sure all spec targets build
|
|
|
|
properly before proposing a merge to master.
|
|
|
|
* Arbitrary LaTeX constructs cannot be used with MathJax. It is an equation
|
|
|
|
renderer, not an full LaTeX engine. So imbedding stuff like \Large or
|
|
|
|
pass:[\hbox{\tt\small VK\_FOO}] does not work in any of the HTML backends
|
|
|
|
and should be avoided.
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[anchors]]
|
|
|
|
== Asciidoc Anchors And Xrefs
|
|
|
|
|
|
|
|
In the API spec, sections can have anchors (labels) applied with the
|
|
|
|
following syntax. In general the anchor should immediately precede the
|
|
|
|
chapter or section title and should use the form
|
|
|
|
'+++[[chapter-section-label]]+++'. For example,
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
For example, in chapter +synchronization.txt+:
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
++++
|
|
|
|
[[synchronization-primitives]]
|
|
|
|
Synchronization Primitives
|
|
|
|
++++
|
|
|
|
|
|
|
|
Cross-references to those anchors can then be generated with, for example,
|
|
|
|
|
|
|
|
++++
|
|
|
|
See the <<synchronization-primitives>> section for discussion
|
|
|
|
of fences, semaphores, and events.
|
|
|
|
++++
|
|
|
|
|
|
|
|
You can also add anchors on arbitrary paragraphs, using a similar naming
|
|
|
|
scheme.
|
|
|
|
|
|
|
|
Anything whose definition comes from one of the autogenerated API include
|
2016-07-11 01:13:41 +00:00
|
|
|
files (+.txt+ files in the directories +basetypes+, +enums+, +flags+,
|
|
|
|
+funcpointers+, +handles+, +protos+, and +structs+) has a corresponding
|
|
|
|
anchor whose name is the name of the function, struct, etc. being defined.
|
|
|
|
Therefore you can say something like:
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
Fences are used with the +++<<vkQueueSubmit>>+++ command...
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[depends]]
|
|
|
|
== Software Dependencies ==
|
|
|
|
|
|
|
|
This section describes the software components used by the Vulkan spec
|
|
|
|
toolchain. under the <<depends-general,General Dependencies>> below, then
|
|
|
|
describes specific considerations for Windows environments using Cygin under
|
|
|
|
<<depends-cygwin,Cygwin Dependencies>>
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[depends-general]]
|
|
|
|
=== General Dependencies ===
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
These are versions of required tools in one of the editors' development
|
|
|
|
environment (Debian 8, shown as Debian package names). Earlier versions
|
|
|
|
*may* work but unless they are verified by someone else, there's no way to
|
|
|
|
know that. Later versions should work.
|
2016-02-16 09:53:44 +00:00
|
|
|
|
|
|
|
- GNU make (make version: 4.0.8-1; older versions probably OK)
|
|
|
|
- Asciidoc / a2x (asciidoc version: 8.6.9-3)
|
|
|
|
- Python 3 (python, version: 3.4.2)
|
|
|
|
- Git command-line client (git, version: 2.1.4)
|
|
|
|
Only needed if regenerating specversion.txt. Any version supporting the
|
2016-07-11 01:13:41 +00:00
|
|
|
operations
|
|
|
|
-- +git symbolic-ref --short HEAD+ and
|
|
|
|
-- +git log -1 --format="%H"+ should work).
|
2016-02-16 09:53:44 +00:00
|
|
|
- Docbook LaTeX toolchain (dblatex, version: 0.3.5-2)
|
|
|
|
- Source code highlighter (source-highlight, version: 3.1.7-1+b1)
|
|
|
|
- LaTeX distribution (texlive, version: 2014.20141024-2)
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[depends-cygin]]
|
|
|
|
=== Cygwin Dependencies ===
|
|
|
|
|
|
|
|
The cygwin installer is at http://www.cygwin.org. Use the 64-bit version,
|
|
|
|
because the 32-bit version does not include the latest version of asciidoc
|
|
|
|
required for this project.
|
|
|
|
|
|
|
|
Required Cygwin packages (current version):
|
|
|
|
|
|
|
|
* Devel/make (4.1-1)
|
|
|
|
* Python/python (2.7.10-1) - Needed for asciidoc toolchain
|
|
|
|
* Python/python3 (3.4.3-1)
|
|
|
|
* Python/python3-lxml (3.4.4-1) - Needed for generating vulkan.h
|
|
|
|
* Text/asciidoc (8.6.8-1)
|
|
|
|
* Text/dblatex (0.3.4-1)
|
|
|
|
* Text/source-highlight (3.1.8-1)
|
|
|
|
|
|
|
|
Optional Cygwin packages (current version):
|
|
|
|
|
|
|
|
* Devel/gcc-core (4.9.3-1) - Needed for validating generated headers
|
|
|
|
* Devel/gcc-g++ (4.9.3-1) - Needed for validating generated headers
|
|
|
|
* Devel/git (2.5.1-1) - Needed for updating specversion.txt
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
|
2016-02-16 09:53:44 +00:00
|
|
|
[[history]]
|
|
|
|
== Revision History
|
|
|
|
|
2016-07-11 01:13:41 +00:00
|
|
|
* 2016/07/10 - Update for current state of spec and ref page generation.
|
2016-02-16 09:53:44 +00:00
|
|
|
* 2015/11/11 - Add new can: etc. macros and DBLATEXPREFIX variable.
|
|
|
|
* 2015/09/21 - Convert document to asciidoc and rename to README.md
|
|
|
|
in the hope the gitlab browser will render it in some fashion.
|
|
|
|
* 2015/09/21 - Add descriptions of LaTeX+MathJax math support for all
|
|
|
|
output formats.
|
|
|
|
* 2015/09/02 - Added Cygwin package info
|
|
|
|
* 2015/09/02 - Initial version documenting macros, required toolchain
|
|
|
|
components and versions, etc.
|
|
|
|
|
|
|
|
|