Commit Graph

15 Commits

Author SHA1 Message Date
amhagan
035a3bbc4a GL_EXT_spirv_intrinsics - Port extensions
Add mechanism to use GL_EXT_spirv_intrinsics headers in glslang.
Ported GL_EXT_shader_realtime_clock as an example.
2021-10-15 14:13:08 -04:00
Scott Bennett
50dce096d9 Add cmd_bat action to bazel export_spirv_headers target
Only having `cmd` rather than separate `cmd_bash` and `cmd_bat` (or
`cmd_ps`) requires bash to be installed on Windows. So adding support
for `cmd_bat` makes glslangValidator easier to compile on Windows.
2021-03-19 21:20:46 -04:00
johnkslang
983698bb34 Revert "Merge pull request #2371 from RafaelMarinheiro/master"
This reverts commit f257e0ea6b, reversing
changes made to 8f0c6bd773.
2020-08-23 01:31:49 -06:00
Rafael Marinheiro
89cd45cc6e Use --test-root to pass files to Bazel tests.
The current implementation makes tests fail when it is imported from a
different Bazel workspace. We fix that by using
the --test-root flag to pass the rootpath to the
tests.
2020-08-14 22:00:58 +01:00
Ben Clayton
fbe9a23baf Generate build information from CHANGES.md
This PR significantly reworks the way glslang is versioned.

Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in
`glslang/Public/ShaderLang.h`, and using `make-revision` to generate
`GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version
information is now derived from the new `CHANGES.md` file.

`CHANGES.md` acts as the single source of truth for glslang version
information, along with a convenient place to put all release notes for
each notable change made.

`CHANGES.md` is parsed using the new `build_info.py` python script.
This script can read basic template files to produce new source files,
which it does to read the new `build_info.h.tmpl` to generate (at build
time) a glslang private header at
`<build-dir>/include/glslang/build_info.h`.
I've written generators for each of the CMake, Bazel, gn, and
`Android.mk` build scripts.

The new version code conforms to the Semantic Versioning 2.0 spec.

This new version is also used by the CMake rules to produce versioned
shared objects, including a major-versioned SONAME.

New APIs:
---------

* `glslang::GetVersion()` returns a `Version` struct with the version
  major, minor, patch and flavor.

Breaking API changes:
---------------------

* The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL`
  have been entirely removed.
* `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have
  been deleted.
* Instead, `<build-dir>/include/glslang/build_info.h` is created in
  the build directory, and `<build-dir>/include` is a CMake `PUBLIC`
  (dependee-inherited) include directory for the glslang targets.
* `<build-dir>/include/glslang/build_info.h` contains the following
   new #defines:
   `GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`,
   `GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`,
   `GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`,
   `GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`,
   `GLSLANG_VERSION_LESS_THAN(major, minor, patch)`,
   `GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)`
*  The CMake install output directory contains a copy of
   `build_info.h` at: `include/glslang/build_info.h`
*  Python3 is now always required to build glslang (likely always
   required for transitive dependency builds).
2020-07-09 12:34:02 +01:00
Ben Clayton
31cad22758 Use CMake's builtin functionality for PCHs
`glslang_pch()` did manual mangling of the compiler flags to enable pre-compiled headers.
I couldn't get this approach to work with the `MachineIndependent` subdirectory, but fortunately CMake has added first-class support for precompiled headers in 3.16, which does work with subdirectories.

Moved `glslang_pch()` to the other global function declarations.

`glslang_pch()` is a no-op when using CMake earlier than `3.16`.

CMake's PCH implementation does not need the `pch.cpp` files, so just remove them.
2020-07-07 16:44:19 +01:00
Ben Clayton
cb261e3c21 License headers: s/Google/The Khronos Group
This was a copy-paste screwup, where the first line of the copyright had the company name was updated, but the company name mid way though was not.
2020-07-03 12:21:01 +01:00
Ben Clayton
1d21270ebf Add missing copyright headers
Add copyright headers to build files and scripts.
Simplifies automated scanning for bad license headers.
2020-07-02 16:03:48 +01:00
Ben Clayton
f49820dd6b Move hlsl/ source to glslang/HLSL/
Now that the HLSL source files are part of the `glslang` target (#2271), it makes sense for these to sit in the `glslang` directory.

Changed the case of the directory from `hlsl` to `HLSL` to better match the sibling directories.
2020-06-16 11:55:28 +01:00
Aaron Franke
c8274e941e
Make file formatting comply with POSIX and Unix standards
UTF-8, LF, no BOM, and newlines at the end of files
2020-03-21 03:20:25 -04:00
Jeff Bolz
04d73731de GL_EXT_debug_printf implementation 2020-03-05 13:41:34 -06:00
Ehsan Nasiri
4b9b07a85a Make buildbot licenses consistent with the rest of the code 2019-10-23 15:03:38 -04:00
Ehsan Nasiri
af7991e062 More cleanups for Windows. 2019-10-18 12:21:11 -04:00
Ehsan Nasiri
dccaa59c98 Make it work on Windows. 2019-10-17 15:14:20 -04:00
Ehsan Nasiri
0608b9d682 Add Bazel build configuration files.
In order to avoid potential build failures that could arise from
SPIRV-Tools/Headers, and to avoid reading known_good.json, this build
configuration does not build the SPIRV-Tools dependency and hence cannot
perform HLSL compilation to SPIR-V.
2019-10-17 10:04:43 -04:00