4411 Commits

Author SHA1 Message Date
Hai Nguyen
6a3aeb73cd Added initial tests for --glsl-version
- Added compilation tests for shader stages using a different
  version at each stage.
2022-01-10 09:43:44 -05:00
Hai Nguyen
1f10dddac4 Revisions to GLSL version override
- Reverted public function interface changes for C++.
- Added override member variable to TShader.
- Added accessor TShader::setOverrideVersion.
- Reverted changes to tests.
2022-01-01 19:02:14 -05:00
Hai Nguyen
356928a96b Updated gtests preprocess()and parse() calls with arg for new parameter 2022-01-01 05:00:05 -05:00
Hai Nguyen
9a98d32366 Added GLSL version override interface and CLI
This change list allows a user to override the GLSL version from the
command line or through the C and C++ interfaces. This will override the
override happens in ProcessDeferred() before DeduceVersionProfile() so
the process should still error out if the version is insufficient for
the shader code.

- Added --glsl-version <version> to CLI.
- Added parameter to route glslVersion as override version to
  preprocessor and parse functions to C++ interface.
- Updated C interface with function to override GLSL version.
2022-01-01 04:31:44 -05:00
Greg Fischer
9b20b25138
Merge pull request #2845 from greg-lunarg/sup1.6
Add support for spirv1.6
2021-12-16 15:32:54 -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
ed37354f11
Merge pull request #2844 from greg-lunarg/hdr1.6
Pickup header for SPIR-V 1.6
2021-12-16 14:48:18 -07:00
Greg Fischer
a0f98ad401 Pickup header for SPIR-V 1.6 2021-12-16 13:44:54 -07:00
Greg Fischer
ca13951205
Merge pull request #2840 from alelenv/no_location2
Do not output location decoration for certain variables in ray tracing storage classes.
2021-12-09 11:45:32 -07:00
Greg Fischer
542ee69d83
Merge pull request #2836 from chaoticbob/vulkan_rules_relaxed
Vulkan rules relaxed for glslang C interface
2021-12-07 16:12:05 -07:00
Greg Fischer
2dff16cd3c
Merge pull request #2841 from greg-lunarg/i2244a
Fix --hlsl-dx-position-w to work for SV_Position embedded in struct
2021-12-07 16:10:28 -07:00
Greg Fischer
fbb39aa461 Fix --hlsl-dx-position-w to work for SV_Position embedded in struct
Fixes #2244
2021-12-07 15:34:52 -07:00
Ashwin Lele
e306f02927 Do not output location decoration for certain variables in ray tracing storage
classes.
2021-12-06 13:09:03 -08:00
Greg Fischer
ec5ea2d6cb
Merge pull request #2838 from jeremy-lunarg/hayes-remove-badge
Remove unnecessary badge
2021-12-02 09:48:16 -07:00
Jeremy Hayes
2b3309aab6 Remove unnecessary badge
I had copy/pasted this badge without really thinking about it's
usefulness. It is unnecessary.
2021-12-01 11:40:11 -07:00
Hai Nguyen
58fe3a02b8 Fixed copy/paste error 2021-12-01 12:32:02 -05:00
Hai Nguyen
f66fb40149 Changed Vulkan rules relaxed to use shader options
- Removed vulkan_rules_relaxed from glslang_input_s
- Added GLSLANG_SHADER_VULKAN_RULES_RELAXED to glslang_shader_options_t
- Modified glslang_shader_set_options to handle new enum value
- Corrected enum value for GLSLANG_SHADER_AUTO_MAP_LOCATIONS
2021-12-01 03:55:59 -05:00
Greg Fischer
0e1396862c
Merge pull request #2830 from jeremy-lunarg/hayes-migrate-travis-to-github-actions
Migrate travis to github actions
2021-11-30 14:10:58 -07:00
Hai Nguyen
b8dfe1348a Vulkan rules relaxed for glslang C interface
- Added vulkan_rules_relaxed flag to glslang_input_t to turn on Vulkan
  rules relaxed during shader creation.
2021-11-30 04:55:25 -05:00
Hai Nguyen
febbeb4f83
Support for automap options and resource binding shift (#2834)
* Support for automap options

- Added glslang_shader_options_t with enums for auto map bindings and
  auto map locations.
- Added options param to glslang_shader_parse.
- Modified glslang_shader_parse to call appropriate auto map function if
  auto map bits are set.

* Refactored auto map for C interface

- Added glslang_shader_set_options to independently set options instead
  of being a param on an existing function.
- Added glslang_program_map_io to call mapIO so auto map location
  actually works.

* Added support for shifting resource bindings

- Added resource binding shift functions to match C++ interface

* Uncommented preprocessor call that was commented out for debugging
2021-11-29 14:23:01 -07:00
Greg Fischer
0bdfc73e9c
Merge pull request #2832 from amdrexu/bugfix
Fix validation failures of test cases regarding GL_EXT_spirv_intrinsics
2021-11-29 14:20:51 -07:00
Rex Xu
6c1db7fd6c Fix validation failures of test cases regarding GL_EXT_spirv_intrinsics
1. The test cases of OpReadClockKHR is invalid. The return type is
   unsigned integer rather than signed integer.
2. When SPIR-V decorate or SPIR-V type is specified, we should avoid
   auto location mapping because the semantics are totally decided by
   SPIR-V tokens.
2021-11-25 16:24:37 +08:00
Greg Fischer
083bdc838a
Merge pull request #2720 from ZhiqianXia/GL_ARB_fragment_coord_conventions
Support the #extension GL_ARB_fragment_coord_conventions.
2021-11-24 14:16:45 -07:00
Greg Fischer
69f9dce708
Merge branch 'master' into GL_ARB_fragment_coord_conventions 2021-11-24 11:52:08 -07:00
Greg Fischer
042aaea516
Merge pull request #2831 from amdrexu/bugfix
Fix an issue of spirv_by_reference
2021-11-23 13:39:57 -07:00
Rex Xu
fe54126c05 Fix an issue of spirv_by_reference
When using this qualifier for a parameter, we make it as a pointer.
However, the function TranslateStorageClass() is therefore called and
the storage class should only be set to Function when it is invoked
to translate parameter types rather than actual argument types.
2021-11-23 16:40:45 +08:00
Jeremy Hayes
509a39212d Migrate travis to github actions 2021-11-22 15:57:03 -07:00
Greg Fischer
7a0b9b212c
Merge pull request #2723 from ZhiqianXia/textureQueryLOD
Support the textureQueryLOD at #extension GL_ARB_texture_query_lod.
2021-11-22 15:21:33 -07:00
Greg Fischer
a40e4ac3f7
Merge branch 'master' into textureQueryLOD 2021-11-22 10:39:03 -07:00
Greg Fischer
7efa90e528
Merge pull request #2829 from amdrexu/bugfix2
Remove the test spv.intrinsicsSpecConst
2021-11-22 10:36:12 -07:00
Rex Xu
3e9e60af86 Remove the test spv.intrinsicsSpecConst
According to current SPIR-V spec, we couldn't write a valid case that
references OpExecutionModeId and OpDecorateId.
2021-11-22 21:33:36 +08:00
Greg Fischer
2c54c20813
Merge pull request #2782 from kevin-mccullough/FixIomapperSeperableShaderValidation
Fix issue with separable shader validation in iomapper
2021-11-19 15:19:27 -07:00
Greg Fischer
dd83c37b98
Merge pull request #2826 from amdrexu/bugfix
Fix an issue of spirv_type used in local variable definitions
2021-11-18 11:20:02 -07:00
Greg Fischer
a0c7b6fe87
Merge pull request #2811 from mbechard/master
remove unneeded extra constructions now that pool allocation is fixed
2021-11-18 10:18:22 -07:00
Rex Xu
bee91eb479 Fix an issue of spirv_type used in local variable definitions
We previously use createOp() in SPV builder to create type declaration.
However, all type declarations should be placed in const-type-variable
declaration section. And duplicated type defintions ought to be avoided.
We now make a method in SPV builder to perform this operation with a
more general solution: makeGenericType().
2021-11-18 20:17:04 +08:00
Malcolm Bechard
eebb48f5fc remove unneeded extra constructions now that pool allocation is fixed 2021-11-17 18:11:10 -05:00
Kevin McCullough
cbab732905 Fix issue with separable shader validation in iomapper 2021-11-17 14:28:16 -08:00
Greg Fischer
0d468a7eee
Merge pull request #2824 from alan-baker/update-tools
Update SPIRV-Tools
2021-11-17 15:26:19 -07:00
Greg Fischer
74b0abb9cd
Merge pull request #2825 from greg-lunarg/i2244
Add --hlsl-dx-position-w option
2021-11-17 09:55:17 -07:00
Greg Fischer
e9564feb55 Add --hlsl-dx-position-w option
This reciprocates the w component of SV_Position in HLSL fragment shaders
to provide DirectX compatibility for HLSL shaders in Vulkan.

Fixes #2244
2021-11-16 18:42:12 -07:00
Alan Baker
1025f4736a Update SPIRV-Tools
* Fix test expectations
2021-11-16 19:03:12 -05:00
Greg Fischer
d51d01ccfb
Merge pull request #2823 from kda/master
Initialize member TSymbol::uniqueId.
2021-11-16 11:20:42 -07:00
Kevin Athey
cd187e201a Initialize member TSymbol::uniqueId. 2021-11-15 16:33:08 -08:00
Greg Fischer
8a7860e4cb
Merge pull request #2821 from greg-lunarg/conv0
[RFC] add more negative float conversions to test constantUnaryConversion.comp and remove the undefined ones
2021-11-15 14:49:53 -07:00
Marius Hillenbrand
d13f81510f remove undefined conversions from test constantUnaryConversion.comp
Remove remaining conversions from negative float64_t to unsigned
integers, which are undefined behavior.

As a result, this test will also succeed on platforms that implement
those conversions differently than x86. That addresses one of the issues
in #2815.
2021-11-15 14:01:15 -07:00
Marius Hillenbrand
0d85595e33 add negative float conversions to test constantUnaryConversion.comp
Add conversions from negative float16_t and float32_t to bool, all
signed integer types (i.e., including those in
GL_EXT_shader_explicit_arithmetic_types), and all float types (from the
same extension) to extend coverage.

Note that converting negative float values to unsigned integers is
undefined behavior. Thus, we exclude them.
2021-11-15 14:00:22 -07:00
Greg Fischer
7141f89a89
Merge pull request #2806 from ZhiqianXia/bestFunctionMatching
#extension GL_ARB_gpu_shader5 support the implicit conversion ,
2021-11-15 13:28:53 -07:00
Greg Fischer
7d27f667a3
Merge pull request #2818 from mhillenbrand/promoteConstantUnion_signed_char
TIntermediate::promoteConstantUnion(): fix conversion to int8
2021-11-15 10:52:12 -07:00
Greg Fischer
f669f13998
Merge pull request #2819 from greg-lunarg/i2812
Fix struct type sharing
2021-11-12 19:16:35 -07:00
Greg Fischer
3074ec94bf
Merge pull request #2814 from mhillenbrand/isinf_isnan2
Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding (updated)
2021-11-12 17:38:11 -07:00