Commit Graph

37 Commits

Author SHA1 Message Date
Sven van Haastregt
4e91335863 Remove extra semicolons
Fix various "extra ';'" compiler warnings.

No functional changes.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-04 11:57:17 -04:00
Malcolm Bechard
4a9f088915 a few more tweaks for #3681
expose TIoMapper::setAutoPushConstantBlock()
add overload for MapToSpirvToolsEnv() that takes TIntermediate instead of SpvVersion.
2024-09-25 11:17:35 -04:00
Malcolm Bechard
8590f62c14 add optimizerAllowExpandedIDBound to SpvOptions
This option increases the max_id_bound in the optimizer to 0x3FFFFFFF, and then runs a
compact-id pass if the final result has a max_id greater than the standard limit of 0x3FFFFF.
2024-07-30 21:49:42 -04:00
Arcady Goldmints-Orlov
7e896697dc Add SPIRV/SpvTools.h back to the public headers
Clean up the includes in SpvTools.h so that it doesn't require any
transitive dependencies and add it back to the headers that get
installed.
2024-07-30 19:07:19 -04:00
David Neto
4fe00178c8 Remove the name of unused formal paramters
This eliminates a compiler warning in some configurations.
2022-12-09 15:51:35 -05:00
Greg Fischer
7f047b986b Add EliminateDeadOutputStores to API.
Also eliminates dead output variables and unused output variable
components. Finally calls aggressive dead code elimination.

AnalyzeDeadOutputStores also supplied to be called on the following
shader to provide input for the Eliminate* function.
2022-11-28 15:09:41 -07:00
Malcolm Bechard
d11c3ff315 only use dead input elimination on vertex shaders
It can't be safely used unilaterally on other stages, since that will
result in output/input mismatches between stages. They arn't
having their output variables eliminated accordingly.
2022-09-28 00:07:01 -04:00
Greg Fischer
abbdf63cbe Add eliminate-dead-input-components to -Os 2022-03-24 13:22:44 -06:00
Greg Fischer
9ebd8ff6c1 Add Vulkan 1.3 support
Also update known goods to Vulkan 1.3 support
Also re-enable SPIR-V 1.6 tests with vulkan1.3 target
Also re-cache SPIRV 1.6 header which somehow regressed back to 1.5
2022-01-26 17:57:31 -07:00
Greg Fischer
7a49192d23 Add support for spirv1.6
Add command line support which enables the following behavior:

- Remap discard

  Map discard to DemoteToHelperInvocation for HLSL shaders. Map to
  OpTerminateInvocation for GLSL shaders.

- Decorate HelperInvocation with Volatile

- Use localSizeId for execution mode

  WorkGroupSize is deprecated in spirv1.6

Also update known goods to SPIRV 1.6
2021-12-16 15:01:42 -07:00
Greg Fischer
7fbaca0d06 Fix SPIR-V for HLSL EvaluateAttribute* of interpolants in structs
Generate load of interpolant for first operand to GLSLstd450
InterpolateAt* SPIR-V ops. This allows the interpolants to
propagate from the input struct in the wrapper around main
into the shader during HLSL legalization. A new pass has been
added to legalization which will remove the load and replace
with the pointer of the load to create valid external
interpolate op.

Fixes #2584
2021-04-01 00:31:31 -06:00
Caio Marcelo de Oliveira Filho
4bfbf62794 Add support for GL_EXT_shared_memory_block
Uses SPV_KHR_workgroup_memory_explicit_layout.  Note that if
GL_EXT_scalar_block_layout is enabled, Workgroup blocks can also use
scalar layout.
2021-01-29 11:23:05 -08:00
Caio Marcelo de Oliveira Filho
a38df83d3e Consider GL_EXT_scalar_block_layout when validating SPIR-V
If GL_EXT_scalar_block_layout is requested by the shader, set the
option to allow scalar blocks in the SPIR-V validator.

Fix the existing tests using scalar layout to not expect "Validation
failed".

Fixes #2400.
2021-01-28 14:11:24 -08: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
Jaebaek Seo
ed8bd0453f
Do not use PropagateLineInfoPass and RedundantLineInfoElimPass (#2440)
* Do not use PropagateLineInfoPass and RedundantLineInfoElimPass

Since spirv-opt will remove PropagateLineInfoPass and
RedundantLineInfoElimPass, glslang should not use it. spirv-opt will
propagate the line instructions and eliminate the redundant lines by
default in IR loading/emission.

* Update known_good.json for spirv-tool
2020-11-02 10:49:31 -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
a1a497ffe7 SPV: Use more correct SPV-Tools environment, partially addressing #2290 2020-08-04 03:00:32 -06: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
John Kessenich
56364b6b60 Copyright update, mostly to trigger bots again. 2020-03-01 04:51:40 -07:00
John Kessenich
9606a5cb99 Fix #1461: set the SPIRV-Tools' optimizer's target environment. 2020-02-28 07:10:59 -07:00
John Kessenich
c3bb5d6914 Update to latest SPIRV-Tools, supporting Vulkan 1.2. 2020-01-15 09:35:48 -07: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
Greg Fischer
b44dac1968 Update spirv-tools known good. 2019-10-24 10:37:01 -06:00
Jeff Bolz
fd556e32b3 Use spvValidatorOptionsSetBeforeHlslLegalization for pre-legalized HLSL 2019-06-07 14:42:08 -05:00
John Kessenich
b64952eddd SPV 1.4: Move to 1.4 validation, removing all 1.4 validation failures. 2019-05-10 00:02:45 -06:00
Panagiotis Christopoulos Charitos
35aeb042a2 Avoid running the validator as part of the optimization pass.
The spvtools::Optimizer::Run method glslang is using constructs a default set
of spvtools::OptimizerOptions. This default set of options instructs the
validator to run. That is not quite correct since glslang will invoke the
validator _explicitly_ after the optimization pass.

Change-Id: I30f458304c6e7f81e89fc4ebd25eabbbd8348063
2019-03-18 11:34:17 +01:00
Greg Fischer
5620a2f95e Add passes to legalization to preserve source line info when generated. 2018-12-16 13:13:46 -07:00
Rémi Verschelde
ebfd91a719 Remove Unix executable permission from text files 2018-12-10 10:49:16 +01:00
Alan Baker
440f95b1e7 Update known good SPIRV tools and headers
* Fixes use of optimizer
* Updated test outputs
 * GeometryStreams and TransformFeedback no longer fail validation
2018-11-26 11:24:22 -05:00
GregF
68fbda9862 Add DeadBranchElim before MergeReturn in legalization.
MergeReturn now requires this or could throw an error.
2018-11-08 10:35:45 -07:00
Dan Sinclair
70f13b2ed5 Fixup unused parameter warnings
This CL removes the current parameters which are unused in order to
fixup the issued clang warnings.
2018-10-24 09:54:48 -04:00
Denis Zdorovtsov
949344f081
Update SpvTools.cpp
Fix build.
2018-08-31 17:36:15 +03:00
John Kessenich
4e11b615db SPV: Turn off the default validation done by the SPIRV-Tools optimizer.
Also use the glslang namespace qualifier consistently and validate after
legalization, not before. (But most tests don't legalize.)
2018-08-30 16:59:13 -06:00
John Kessenich
717c80a9de SPV: Isolate SPIRV-tools glue to its own file. 2018-08-23 15:17:10 -06:00