Commit Graph

592 Commits

Author SHA1 Message Date
Jeremy Hayes
294c8f1d51 Fix GCC sign-compare warnings 2022-01-04 19:55:41 -07:00
Greg Fischer
950c6ddc11
Merge pull request #2849 from jeremy-lunarg/hayes-fix-issue-2848
Fix seg fault
2022-01-03 16:39:45 -07:00
Jeremy Hayes
46466be045 Fix seg fault
Check types before accessing typeName.

Fix #2848.
2021-12-28 17:09:57 -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
69f9dce708
Merge branch 'master' into GL_ARB_fragment_coord_conventions 2021-11-24 11:52:08 -07:00
Greg Fischer
a40e4ac3f7
Merge branch 'master' into textureQueryLOD 2021-11-22 10:39:03 -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
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
Kevin McCullough
cbab732905 Fix issue with separable shader validation in iomapper 2021-11-17 14:28:16 -08: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
10be28ac9b Fix struct type sharing
Fixes #2812
2021-11-12 16:57:11 -07:00
ZhiqianXia
50a6a51625 Support the #extension GL_ARB_fragment_coord_conventions.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-10 10:41:40 +08:00
ZhiqianXia
77b0d72c68 #extension GL_ARB_gpu_shader5 support the implicit conversion ,
So the best function matching algorithm should be actived.


Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-10 09:44:16 +08:00
Greg Fischer
bb5b357550
Merge pull request #2781 from kevin-mccullough/FixLinkTimeValidationForGl_PerVertex
Fix incorrect link time validation for unused gl_PerVertex members
2021-11-09 13:44:32 -07:00
Kevin McCullough
13fd2d6470 Fix incorrect link time validation for unused gl_PerVertex members 2021-11-08 15:23:02 -08:00
ZhiqianXia
46d3a30bd9 Support the #extension GL_ARB_draw_instanced.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-08 13:48:03 +08:00
ZhiqianXia
e76116982a Add the GL_EXT_shader_integer_mix Preamble for glsl.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-11-02 14:39:28 +08:00
Rex Xu
07aec25f82 Make modifications of GL_EXT_spirv_intrinsics
1. spirv_execution_mode_id and spirv_decorate_id could support
   specialization constants. The original implementation always
   assume only normal frontend constants are valid. It is not true.

2. spirv_type donesn't support type_specifier as an option of
   spirv_type_parameter. At present, only constant_expression is the
   valid option.
2021-10-15 20:22:36 +08:00
Nathaniel Cesario
c8ef4f8a9f cmake: Remove "conditions" from endif
See https://cmake.org/cmake/help/latest/command/endif.html and
https://cmake.org/cmake/help/latest/command/if.html.

If the else/endif condition does not match the if condition verbatim,
an error is produced on some versions of cmake. This change removes
these "legacy conditions."
2021-09-30 11:00:09 -06:00
Greg Fischer
c2604615f4
Merge pull request #2685 from kevin-mccullough/FixIsIoResizeArrayTesselationStageHandling
Fix isIoResizeArray() tessellation stage handling
2021-09-21 16:29:30 -06:00
Greg Fischer
a4599ef756
Merge pull request #2718 from ZhiqianXia/AtomicOpsARB
Support the atomic_counter_xxxARB  built-in functons at #extension GL_ARB_shader_atomic_counter_ops.
2021-08-18 12:59:27 -06:00
alelenv
fc60f77aa2 Add support for GL_NV_ray_tracing_motion_blur. 2021-08-10 10:40:28 -07:00
ZhiqianXia
78de10954e Support the textureQueryLOD at #extension GL_ARB_texture_query_lod.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-08-02 16:20:02 +08:00
ZhiqianXia
bf56773517 Support Extension GL_ARB_shader_atomic_counter_ops and relative intrisic functions.
refs:
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_atomic_counter_ops.txt

Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-08-02 10:16:25 +08:00
Greg Fischer
e0f3fdf433
Merge pull request #2716 from greg-lunarg/i2689
Add support for pragma STDGL invariant(all)
2021-08-01 00:13:10 -06:00
Greg Fischer
715f5c6cf1 Add support for pragma STDGL invariant(all)
Fixes #2689
2021-07-31 15:55:25 -06:00
Greg Fischer
9ff6cd0bd6
Merge branch 'master' into BugPoint 2021-07-29 14:48:24 -06:00
Greg Fischer
ba540202cd
Merge pull request #2700 from ZhiqianXia/u2i
Support Uint to Int implicit conversions at #extension GL_ARB_gpu_shader5.
2021-07-29 14:10:40 -06:00
Nathan Reed
fc9897d1ba
Fix OpImageRead result type when compiling HLSL (#2706)
Fix OpImageRead result type when compiling HLSL

- Per the Vulkan spec, OpImageRead must return a 4-component vector always. When compiling HLSL, loads from a RWTexture of a template type with < 4 components would incorrectly generate an OpImageRead with a < 4 component result, resulting in validation errors.
- This was previously fixed for OpImageFetch in commit 4425f24; this commit does the same thing for OpImageRead.
- Added associated tests and expanded existing image fetch tests to check all the different types of textures, in both float and int incarnations, for completeness.
- Update other HLSL tests involving OpImageRead
2021-07-28 09:29:17 -06:00
ZhiqianXia
8cd85272ad Support Uint to Int implicit conversions at #extension GL_ARB_gpu_shader5.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-07-19 17:24:28 +08:00
Shahbaz Youssefi
097215f618 Fix loading bool arrays from interface blocks
SPIR-V disallows bool in interface blocks, which is emulated with uint.
When loading a bool variable (through accessChainLoad()), it's converted
from uint to bool if it came from an interface block.

This was handled for bool and bvecN, but not for bool arrays.  This
change implements the conversion for bool arrays.

Closes #2694
2021-07-15 22:29:48 -04:00
ZhiqianXia
cf52f73a0c Atomic memory function can only be used for shader storage block member or shared variable.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-07-12 16:57:25 +08:00
Kevin McCullough
5597c8d7cf Fix isIoResizeArray() tessellation stage handling 2021-07-09 09:51:16 -07:00
Greg Fischer
263e50f6aa
Revert "Atomic memory function can only be used for shader storage block member or shared variable." 2021-07-08 13:10:58 -06:00
ZhiqianXia
8a5c5e8210
Merge branch 'KhronosGroup:master' into master 2021-07-07 14:12:33 +08:00
Rex Xu
65a7fb7054 Implement the extension GL_EXT_spirv_intrinsics
- Add support of SPIR-V execution mode qualifiers.
- Add support of SPIR-V storage class qualifier.
- Add support of SPIR-V decorate qualifiers.
- Add support of SPIR-V type specifier.
- Add support of SPIR-V intruction qualifiers.
- Add support of spirv_by_reference/spirv_literal parameter qualifier.
- Add shader stage macros introduced by this extension.
2021-06-09 14:18:06 +08:00
John Kessenich
848d3a9447 Implement GL_EXT_subgroup_uniform_control_flow. 2021-06-07 10:21:05 -04:00
Greg Fischer
11c24e9adb Do true SPV type check for function array arg linkage
Previous check was missing type difference between uniform array
actual arg with stride decoration and the formal arg without. Now
does logical or component-wise copy where needed.

Fixes #2637
2021-05-20 10:51:14 -06:00
ZhiqianXia
587261a817 Atomic memory function can only be used for shader storage block member or shared variable.
The glsl spec says:A shader will fail to compile if the value passed to the mem argument of an atomic memory function does not
correspond to a buffer or shared variable.
2021-05-15 00:13:43 +08:00
Greg Fischer
60ce877de0
Merge pull request #2609 from ZhiqianXia/Feature2
TextureOffset not support sampler2DArrayShadow sampler until 430.
2021-04-19 12:03:05 -06:00
Greg Fischer
12f3eb8e3f Fix and enable textureOffset_samper2darrayshadow test 2021-04-19 09:37:45 -06:00
Greg Fischer
e7e4a8eecb
Merge pull request #2522 from dneto0/intlog2
Add IntLog2 and use it
2021-04-14 15:16:04 -06:00
David Neto
fa6e3c2737 Add IntLog2 and use it
Replace uses of floating point log2 when we want an integer result from
an integer operand.  This avoids concerns about accuracy of floating
point library functions.
2021-04-13 14:09:44 -06:00
Greg Fischer
186e66c1a3
Revert "Update minimum SPIR-V requirement for GL_EXT_buffer_reference" 2021-04-07 15:20:16 -06:00
Greg Fischer
5878bcb17e
Merge pull request #2593 from jeremy-lunarg/hayes-update-min-spv-requirement
Update minimum SPIR-V requirement for GL_EXT_buffer_reference
2021-04-01 12:32:57 -06: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
Jeremy Hayes
97dfbe2c4b Update minimum SPIR-V requirement
Require SPIR-V 1.3 when using GL_EXT_buffer_reference.
Migrate tests to SPIR-V 1.3 fixture as necessary.
Fix extension table key.
Fix whitespace.
2021-03-29 15:10:43 -06:00
Ben Clayton
591651da3d Fix warnings about int comparisons of different signness
Warnings in public headers can trigger warnings-as-errors.
2021-03-23 10:47:59 +00:00
greg-lunarg
847a19cd2b
Merge pull request #2581 from mbechard/InconsistentGLPerVertex
Partial fix for inconsistencies re: #2578
2021-03-19 17:38:51 -06:00