Commit Graph

20 Commits

Author SHA1 Message Date
Dejan Mircevski
8ba7c92a94 Remove revision from SPV_ENV_*.
Revisions proliferate quickly and we don't promise to retain extra
grammar copies for every historical one.
2016-04-11 15:31:00 -04:00
Lei Zhang
6fa3f8aad9 Remove dependency on SPIR-V headers in libspirv.h.
For fulfilling this purpose, the |opcode| field in the
|spv_parsed_instruction_t| struct is changed to of type uint16_t.

Also add functions to query the information of a given SPIR-V
target environment.
2016-04-04 10:34:28 -04:00
Dejan Mircevski
3d27da4bc7 Add a target environment to spvContextCreate().
Run clang-format.
2016-03-31 12:16:51 -04:00
David Neto
e04b935599 Support both -h, --help on spirv-as, spirv-val
The spirv-dis command already supports both.
2016-03-17 16:06:25 -04:00
Lei Zhang
b6ccd0d891 Remove spv_validate_options_t and change tests accrodingly.
Users always want to run all the checks. The spv_validate_options_t
mechanism, which provides little benefits to users, complicates the
internal implementation and also makes the tests exercise different
paths as users do.

Right now the tests are more like integration tests instead of
unit tests, which should be our next refactoring aim.
2016-02-23 16:19:33 -05:00
qining
4e797f8236 Implement --version for spirv-tools
'spirv-as --version', 'spirv-dis --version' and 'spirv-val --version'
will display version information.
2016-02-23 14:14:23 -05:00
David Neto
d1f64c6394 spirv-val help says it's a work in progress. 2016-02-22 16:43:53 -05:00
Lei Zhang
c9783ded75 Avoid closing stdin and stdout. 2016-02-19 10:15:17 -05:00
Lei Zhang
c90a820a10 Fix command line option errors in val.
* There is no -capability.
* -rules is missing.
* -id by default is turned off.
* Add -all.
2016-02-19 09:46:20 -05:00
Lei Zhang
6572ad725f Support using stdin to supply input in the val tool.
This allows getting output from other utilities using pipe.
2016-02-18 13:43:15 -05:00
David Neto
5a70335bf1 Rearrange headers
Now we have public headers arranged as follows:
$SPIRV_TOOLS_ROOT/include/spirv-tools/libspirv.h
$SPIRV_TOOLS_ROOT/include/spirv/spirv.h
$SPIRV_TOOLS_ROOT/include/spirv/GLSL.std.450.h
$SPIRV_TOOLS_ROOT/include/spirv/OpenCL.std.h

A project should use -I$SPIRV_TOOLS_ROOT/include
and then #include "spirv-tools/libspirv.h"

The headers from the SPIR-V Registry can be accessed as "spirv/spirv."
for example.

The install target should also install the headers from the SPIR-V
Registry.  The libspirv.h header is broken otherwise.

The SPIRV-Tools library depends on the headers from the SPIR-V Registry.

The util/bitutils.h and util/hex_float.h are pulled into the internal
source tree.  Those are not part of the public API to SPIRV-Tools.
2016-02-17 14:49:44 -05:00
Dejan Mircevski
b6fe02fc39 Extend copyright to 2016. 2016-01-07 13:44:22 -05:00
Lei Zhang
972788bf23 Use opaque context object to hold SPIR-V info tables.
Previously the opcode table is declared as an global array and we
have spvOpcodeTableInitialize() modifying it. That can result in
race condition. Now spvOpcodeTabelGet() copies the whole underlying
array.
2015-11-12 16:27:51 -05:00
Lei Zhang
923f6c13fc Use quotation for libspirv.h and sort headers. 2015-11-12 09:43:01 -05:00
Lei Zhang
df920ecb71 Remove table parameters from API functions.
Opcode, operand, and external instruction tables are no longer
passed in as parameters to spvTextToBinary(), spvBinaryToText(),
and spvValidate().
2015-11-12 09:42:50 -05:00
Andrew Woloszyn
ec691fba2a Fixed permissions 2015-11-11 12:12:16 -05:00
Andrew Woloszyn
55ecc2e097 Fixed warnings on windows and constness of spv_binary.
Replaced uint64_t with size_t in the places that make sense and
added spv_const_binary{,_t} to allow the interface to accept non
modifiable spirv where appropriate.
2015-11-11 12:12:13 -05:00
Lei Zhang
1a0334edee Run clang-format to enforce Google style globally.
Note that we are more strict than Google style for one aspect:
pointer/reference indicators are adjacent to their types, not
their variables.

find . -name "*.h" -exec clang-format -i {} \;
find . -name "*.cpp" -exec clang-format -i {} \;
2015-11-10 15:56:47 -05:00
Lei Zhang
4005670363 Limit the use of spvCheck and spvCheckReturn to validator.
spvCheck is indeed just an if-statement. Defining such a macro
doesn't help much.
2015-10-26 12:55:33 -04:00
Kenneth Benzie (Benie)
83e5a29b06 Code drop of the Codeplay spirv-tools source.
This commit contains the source for the SPIRV static library, spirv-as,
spirv-dis, and spirv-val tools.
2015-05-22 18:26:19 +01:00