Commit Graph

315 Commits

Author SHA1 Message Date
Yun Hsiao Wu
ae4305da91 Fix per-set argument parsing in standalone 2021-07-26 16:21:12 +08:00
Robin Quint
4bf373e9a3 Improved usage hint 2021-04-27 16:06:06 +02:00
Robin Quint
e50b0a857c Added usage hint for --auto-sampled-textures, added test cases 2021-04-22 13:13:38 +02:00
Greg Fischer
7f46558b8c
Merge pull request #2616 from Rob2309/standalone-hlsl-sampled-textures
Exposed #856 as --hlsl-sampled-textures in the StandAlone
2021-04-21 18:17:42 -06:00
Greg Fischer
ebfca6099f Change --hlsl-sampled-textures to --auto-sampled-textures 2021-04-21 16:49:53 -06:00
Georg Lehmann
f050209ce1 Add a --depfile option.
The output is similar to gcc -MMD and can be used by build systems
like meson to automatically recompile shaders if an included header
was changed.
2021-04-20 18:09:56 +02:00
Robin Quint
219b7b9f72 Exposed #856 as --hlsl-sampled-textures in the StandAlone 2021-04-20 07:58:36 +02:00
Krzysztof Pilch
bb9746ae2d Fixed CMake configuration for resource-limits library. 2021-04-09 16:20:01 +02:00
Krzysztof Pilch
3549cd6ec2 Removed condition for glslang-default-resource-limits instalation.
This way the limits are available to clients that links statically.
2021-04-08 16:33:29 +02:00
greg-lunarg
4e064eef46
Revert "Revert "GL_ext_vulkan_glsl_relaxed extension support, and cross stage aware IO mapper"" 2021-03-15 11:26:11 -06:00
greg-lunarg
e063363878
Revert "GL_ext_vulkan_glsl_relaxed extension support, and cross stage aware IO mapper" 2021-03-10 11:26:43 -07:00
will brown
ecc9b9149f Implement GL_EXT_vulkan_glsl_relaxed option 2021-03-08 13:31:39 -05:00
Jeremy Hayes
b73afa8631 Prevent HLSL input under OpenGL semantics
Fix #2497.
2021-01-05 15:55:58 -07:00
pheonix
c897c3bc23
Add new SpirvToolsDisassemble API interface + Improve Doc on existing API interface (#2442)
* Add new SpirvToolsDisassemble API interface + Improve Doc on existing API interface (#2408)

* Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output.
Improve documentation on existing SpirvToolsDisassemble interface.

* Update pre-processor check - following existing ENABLE_OPT checks.

* Fix not-found header paths for glslangValidator and glslangtests.

* Add spirv_tools/include path where there is an ENABLE_OPT=1 in the BUILD.gn configuration.
2020-11-02 14:40:50 -07:00
John Kessenich
2b77059502 Revert "Add new SpirvToolsDisassemble API interface + Improve Doc on existing API interface (#2408)"
See issue #2413.

This reverts commit d1929f359a.
2020-10-05 16:58:31 -06:00
pheonix
d1929f359a
Add new SpirvToolsDisassemble API interface + Improve Doc on existing API interface (#2408)
* Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output.
Improve documentation on existing SpirvToolsDisassemble interface.

* Update pre-processor check - following existing ENABLE_OPT checks.

* Fix not-found header paths for glslangValidator and glslangtests.
2020-10-05 09:59:27 -06:00
John Kessenich
f05c076e26 Revert "Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output. (#2406)"
This reverts commit 2eed8236d0.
2020-09-27 18:15:41 -06:00
pheonix
2eed8236d0
Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output. (#2406)
Improve documentation on existing SpirvToolsDisassemble interface.
Fix cmake build scripts to account for `spirv-tools` external when -DENABLE_OPT=ON
2020-09-27 17:53:18 -06:00
johnkslang
2de6d657dd SPV: Standalone; sanity check the client GLSL input semantics option value. 2020-08-04 07:17:39 -06: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
Marcin Ślusarz
245c30c296 Add --quiet option.
Being quiet should have been the default, but I guess it's too late
now to change it.
2020-07-06 10:55:40 +02: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
d64e859987 glslang: Only export public interface for SOs
Default to `-fvisibility=hidden`, and annotate the public glslang interface with `GLSLANG_EXPORT` to change the visibility of these cherry-picked symbols to default.
This is also used by Windows builds for `__declspec(dllexport)`-ing the public DLL interface.

This allows us to classify API changes into those that are publicly backwards compatible, and those that are not.

Note that `libSPIRV` will likely need similar treatment.

Issues: #2283, #1484
2020-06-30 17:06:17 +01:00
Shahbaz Youssefi
d52dce5067
Add -g0 command line argument
Analogous to gcc, -g0 would strip all debug info.  This is done
regardless of whether optimizations are enabled.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
2020-06-18 10:16:40 -04:00
Chow
8111268575
Add Shared/Std140 SSBO process & top-level array elements related (#2231)
* Add Shared/Std140 SSBO process & top-level array elements related
process

1.Add process options for shared/std140 ssbo, following ubo process
2.Add IO Variables reflection option, would keep all input/output
variables in reflection
3.Add Top-level related process, fix top-level array size issues,
following spec
4.Split ssbo/ubo reflection options, merge blowup expanding all into
function blowupActiveAggregate to allow other functions keep same entry
format.

Add options in StandAlone and test symbols.

1. Add options in StandAlone for std140/shared ubo/ssbo and all io variables reflection.
2. Add test for ssbo. When EShReflectionSharedStd140SSBO turns on, generated symbol and output would be different, to remind the difference. Defaultly disabled and nothing would change, nor blocking normal test.

* Add options in runtest script, refresh test results.

Add options in StandAlone:
--reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo

refresh test results.
Now the index, size of unsized array are expected.
2020-06-04 01:47:18 -06:00
rdb
b56e0e441b
HLSL: Recognize POSITION semantic et al in DX9 compatibility mode (#2255) 2020-06-02 00:30:50 -06:00
Pankaj Mistry
e05cc20ec2 Add support for es extension GL_EXT_blend_func_extended
* Introduces builtin variables gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT
* Introduces builtin constant gl_MaxDualSourceDrawBuffersEXT
* enables support for layout qualifier "index" in es profile
2020-04-30 23:21:14 -07:00
Malacath-92
fd593d5f08
Get rid of all warnings with MSVC and clang-cl (#2177) 2020-04-10 02:39:16 -06:00
John Kessenich
344bd0889a
Merge pull request #2162 from ntfshard/small_fix
Humble fix
2020-03-30 00:33:09 -06:00
John Kessenich
83855b97db Fix #2163: improve comments for addProcess() and the preamble. 2020-03-30 00:27:31 -06:00
ntfs.hard
988cd6769c unused var 2020-03-30 01:38:21 +03:00
Daniel Koch
db32b243ff Add support for GLSL_EXT_ray_tracing
and SPV_KHR_ray_tracing
2020-03-17 20:42:47 -04:00
Travis Fort
0b71a071e2 add missing string.h header for resource_limits_c.cpp 2020-03-06 10:31:14 -05:00
Travis Fort
fd37e0c0f1 add c wrapper for standalone ResourceLimits and remove that dependency from glslang_c_interface 2020-03-06 10:06:47 -05:00
John Kessenich
56364b6b60 Copyright update, mostly to trigger bots again. 2020-03-01 04:51:40 -07:00
Jordan Justen
6ad120eaeb
standalone: Fix --help
Fixes: bd97b6f9 ("Command-line: Give better error messages. From #1829.")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2020-01-28 14:08:12 -08:00
John Kessenich
273d3a5093 SPV/Vulkan: Add support for Vulkan 1.2, which defaults to SPIR-V 1.5. 2020-01-15 00:10:41 -07:00
John Kessenich
6f98892dd1 Fix #1829: Add "--" command-line options for macro def/undef.
This allows OpModuleProcessed logging to be consistent with everything taking
"--" options.
2020-01-08 01:28:45 -07:00
John Kessenich
bd97b6f9f2 Command-line: Give better error messages. From #1829. 2019-12-20 10:33:13 -07:00
John Kessenich
e01c847a70 Merge branch 'dj2-install' 2019-11-22 06:24:38 -07:00
Dan Sinclair
04567eb232 Check for ENABLE_SPVREMAPPER flag in CMakeList files.
There is a flag to disable the SPVRemapper during the GLSLang build.
That flag is check in some, but not all spots so if you try to build
with SPVRemapper disabled you get CMake errors and compile errors.

This CL fixs up the build so building with -DENABLE_SPVREMAPPER=0 will
complete correclty.
2019-11-21 10:33:32 -05:00
Arfrever Frehtes Taifersar Arahesis
bd69a4fb12 Respect CMAKE_INSTALL_LIBDIR in installed CMake files
Fixes #1965
2019-11-18 11:11:55 -08:00
David Neto
8c3d5b4b6c SPIR-V: Aggressively prune unreachable merge, continue target
More aggressively prune unreachable code as follows.
When no control flow edges reach a merge block or continue target:
- delete their contents so that:
  - a merge block becomes OpLabel, then OpUnreachable
  - a continue target becomes OpLabel, then an OpBranch back to the
    loop header
- any basic block which is dominated by such a merge block or continue
  target is removed as well.
- decorations targeting the removed instructions are removed.

Enables the SPIR-V builder post-processing step the GLSLANG_WEB case.
2019-10-29 15:33:54 -04:00
David Dubois
f57feff786 Fix the exports of glslang-default-resource-limits (#1942) 2019-10-21 22:31:44 -06:00
John Kessenich
b03e4fc4e0
Merge pull request #1866 from rumblehhh/master
Export glslang targets on installation
2019-10-15 04:25:20 -06:00
John Kessenich
8317e6c683 SPV: Support SPIR-V 1.5; five extensions no longer need OpExtension.
The generalization to addIncorporatedExtension() also fixed a 1.3
corner case with SPV_KHR_16bit_storage.
2019-09-16 07:14:10 -06:00
John Kessenich
deec1933e9 Web: Turn off includes, independent preprocessing path, fine tune all.
Saved about 21K, size down to 380K of MSVC x86 code.
Fixed one bug that needs to be looked at on the master branch:
The test for needing a Vulkan binding has a bug in it, "!layoutAttachment"
which does not mean "no layoutAttachment", because that is non-zero.
This is why some test and test results changed.
2019-08-20 23:21:56 -06:00
John Kessenich
155d351f86 Web: Remove unused stage functionality, SPIR-V logger, and hex_utils
Saves another 20K.
2019-08-20 23:21:56 -06:00
John Kessenich
b6d3ee5aca Web: Turn off bracket-style attributes, reflection, and IO mapping. 2019-08-20 23:21:55 -06:00