2242 Commits

Author SHA1 Message Date
Nicholas Barlow
cb2287751f Add setter for TInterimSelection.condition 2021-04-08 09:56:07 -07: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
02132406bc Do not propagate packing qualifiers to scalars or vectors
Packing qualifiers have no practical effect on scalars or vectors
so this is unnecessary and its confusing tools downstream that
consume the AST.
2021-04-06 15:40:22 -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
Pankaj Mistry
18cfc3f106 For bug #2580: sparseTextureGatherOffsetsARB should only take constant offsets. 2021-03-29 14:27:17 -07: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
Malcolm Bechard
8bbd41f274 Don't check precision qualifiers on cross-stage checks
Fixes #2586
2021-03-22 15:06:44 -04: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
Malcolm Bechard
9b962f611c Partial fix for inconsistencies re: #2578
gl_SecondaryPositionNV and gl_PositionPerViewNV are inconsistently
declared inside and outside of gl_PerVertex. This breaks interface block
matching. For now ignore these errors since it should be fixed with how
they are declared.
2021-03-19 16:18:42 -04:00
greg-lunarg
979319b9b1
Merge pull request #2579 from mbechard/master
Fix issue with remapping global uniform blocks
2021-03-18 17:22:13 -06:00
greg-lunarg
d18bcd64fa
Merge pull request #2574 from feifei14119/master
fix typo for u64vec2/3/4 type define value
2021-03-17 18:21:16 -06:00
Malcolm Bechard
5340752190 Fix issue with remapping global uniform blocks
Avoid adding global uniform blocks to stages that don't already have it.
Otherwise multiple stages point to the same block object, and a
remapping that occurs later on will change the mapping on multiple
stages.
2021-03-17 19:30:22 -04:00
Malcolm Bechard
48f08c60e2 fix variable capitilization. Don't initialize it in the struct's constructor 2021-03-16 19:00:52 -04: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
feifei14119
e3235cb2e4 1. fix macro definition value for unsinged-int64-vector, according to kronos spec at https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gpu_shader_int64.txt; 2. fix typo in reflection 2021-03-15 16:54:31 +08: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
Greg Fischer
740def238e Allow grad texture ops in all shaders
Fixes #2551
2021-03-01 12:34:53 -07:00
Greg Fischer
051fbbb69c Fix off-by-1 bug in gl_MaxCombinedTextureImageUnits check
The problem was only with arrays of samplers.

Fixed #2552
2021-02-26 17:07:52 -07:00
Greg Fischer
c176085909 Fix precision propagation around shifts
Fixes #2541
2021-02-26 14:25:38 -07:00
greg-lunarg
51d672b8a8
Merge pull request #2544 from ZhiqianXia/master
Replace log2 and exp2 math func.
2021-02-25 10:38:39 -07:00
ZhiqianXia
47a21828bd fix a typo 2021-02-25 15:37:40 +08:00
Jeremy Hayes
1c62806468 Require fixed workgroup size declaration
Fix 2479.
2021-02-24 14:49:31 -07:00
ZhiqianXia
53e0e6a56e Replace the old version math func with C++11 to
prevent some presicion issue.

reference link:
https://www.cplusplus.com/reference/cmath/

Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-02-23 10:00:25 +08:00
greg-lunarg
6f7a8ebf76
Merge pull request #2525 from ZhiqianXia/master
Cannot specify atomic counter with location.
2021-02-22 17:36:30 -07:00
Daniel Koch
d9b931e2e8 Fix warning in build
glslang/MachineIndependent/SymbolTable.h:892:41: error: comparison of integers of
different signs: 'int' and 'const uint32_t' (aka 'const unsigned int') [-Werror,-Wsign-compare]
            uint64_t level = currentLevel() > MaxLevelInUniqueID ? MaxLevelInUniqueID : currentLevel();
                             ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
1 error generated.
2021-02-19 16:48:50 -05:00
greg-lunarg
51b86c1a2b
Merge pull request #2532 from juliusikkala/master
Pass environment through PreprocessDeferred
2021-02-15 13:41:48 -07:00
greg-lunarg
b0f8a0c3ab
Merge pull request #2458 from ShchchowAMD/unique_id-fix
Fix issue for new unique id system.
2021-02-15 13:22:14 -07:00
Chow
93b400f267 Fix issue for new unique id system. Add level bits to help verifying symbols and split symbol tables.
For intermediates rebuilding, now need manually amending level bits for redeclaring built-ins.
2021-02-15 20:35:20 +08:00
Julius Ikkala
6274ec5c20 Pass environment through PreprocessDeferred 2021-02-14 14:24:17 +02:00
ZhiqianXia
5100efdfa9 Cannot specify atomic counter with location.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-02-09 09:42:48 +08:00
ZhiqianXia
29b2a08133 Cannot specify atomic counter with location.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-02-09 09:39:40 +08:00
ZhiqianXia
c8db4f437a Cannot specify atomic counter with location.
Signed-off-by: ZhiqianXia <xzq0528@outlook.com>
2021-02-07 17:20:14 +08:00
David Neto
57e6a38f2a Remove useless semicolon
The extra semicolon causes a build failure if warnings are turned up high, and
warnings-as-errors is on. (-Werror=extra-semi)
2021-02-03 14:14:11 -05:00
greg-lunarg
5c4f421121
Merge pull request #2517 from glebm/fix-ubsan-localintermediate
callGraph.push_front -> emplace_front to fix UBSAN
2021-02-01 10:53:37 -07:00
Gleb Mazovetskiy
546f626c58 callGraph.push_front -> emplace_front to fix UBSAN
UBSAN rightly complains on `push_front` here:

    glslang/MachineIndependent/localintermediate.h💯8: runtime error: load of value 160, which is not a valid value for type 'bool'
    #0 in glslang::TCall::TCall(glslang::TCall&&) glslang/MachineIndependent/localintermediate.h:100
    #1 in void __gnu_cxx::new_allocator<std::_List_node<glslang::TCall> >::construct<glslang::TCall, glslang::TCall>(glslang::TCall*, glslang::TCall&&) /usr/include/c++/10/ext/new_allocator.h:150
    #2 in void std::allocator_traits<std::allocator<std::_List_node<glslang::TCall> > >::construct<glslang::TCall, glslang::TCall>(std::allocator<std::_List_node<glslang::TCall> >&, glslang::TCall*, glslang::TCall&&) /usr/include/c++/10/bits/alloc_traits.h:512
    #3 in std::_List_node<glslang::TCall>* std::__cxx11::list<glslang::TCall, std::allocator<glslang::TCall> >::_M_create_node<glslang::TCall>(glslang::TCall&&) (...)
    #4 in void std::__cxx11::list<glslang::TCall, std::allocator<glslang::TCall> >::_M_insert<glslang::TCall>(std::_List_iterator<glslang::TCall>, glslang::TCall&&) /usr/include/c++/10/bits/stl_list.h:1911
    #5 in std::__cxx11::list<glslang::TCall, std::allocator<glslang::TCall> >::push_front(glslang::TCall&&) /usr/include/c++/10/bits/stl_list.h:1167
    #6 in glslang::TIntermediate::addToCallGraph(TInfoSink&, std::__cxx11::basic_string<char, std::char_traits<char>, glslang::pool_allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, glslang::pool_allocator<char> > const&) glslang/MachineIndependent/Intermediate.cpp:2860

What happens here:

1. TCall's bool fields are not initialized on construction.
2. `push_front` move the `TCall` passed into it.
3. The move constructor copies unitialized bool, which may have an
   out-of-range value.

What this fix does:

Calls `emplace_back` to ensure no copy/move constructor is called.

Fixes #2222
Refs #2112
2021-01-30 16:06:08 +00: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
John Kessenich
c739e03748 Implement GL_EXT_null_initializer
Adds null initializer syntax (empty braces)
Allows null initialization of shared variables
2021-01-25 15:54:52 -05:00
Sergey Kosarevsky
a720028cdd Fix missing enum values in the C-interface #2507 2021-01-21 02:33:16 +03:00
Craig Stout
17a83a9b33 Add CMake support for Fuchsia 2021-01-15 10:30:23 -08:00
nihuini
08e4874a56 Merge remote-tracking branch 'upstream/master' into patch-3 2020-12-24 10:33:22 +08:00
nihui
5c202faffb
Update ParseHelper.cpp 2020-12-23 21:56:23 +08:00
Greg Fischer
efe4586fad Fix cut and paste error
Fixes #2476
2020-12-17 22:57:50 -07:00
rdb
589aaff11c Don't use roundEven() to implement round() in DX9 compatibility mode 2020-12-16 18:35:42 +01:00
Evgeny Proydakov
dc8b1d0264 Fixed compile warning in reflection.cpp for ENABLE_HLSL = 0 build. [-Wunused-parameter] 2020-12-15 18:05:32 +03:00
Daniel Koch
ffccefddfd
Updates for final Vulkan ray tracing extensions (#2466)
* Fix traceRay/executeCallable to have id instead of constant.

Update to final (non-provisional) SPIR-V capabilities
(includes review feedback)
- Change visibilty of findLinkerObjects.

See merge request GLSL/glslang!78

* Add support for OpConvertUToAccelerationStructureKHR.

GLSL : https://gitlab.khronos.org/GLSL/GLSL/-/merge_requests/60

SPV : https://gitlab.khronos.org/spirv/spirv-extensions/-/merge_requests/182

See merge request GLSL/glslang!77

* Add volatile qualifier to certain builtins for ray tracing.

See merge request GLSL/glslang!81

* make gl_RayTmaxEXT volatile in intersection shader

Vulkan Issue #2268

* Add testing for layouts on SBT

vulkan/vulkan#2230

- no layout specified should be same as std430
- explicitly test std140, std430, scalar layouts

See merge request GLSL/glslang!86

* Support for new opcodes OpIgnoreIntersectionKHR and OpTerminateRayKHR

vulkan/vulkan#2374

Add support for ignoreIntersectionEXT and terminateRayEXT as block
terminator statements.

See merge request GLSL/glslang!87

* Fix code-generation issues with global ray query variables

See merge request GLSL/glslang!88

* update dependencies for spirv-headers and tools

And update mesh shader results

* Fix indeterminate argument ordering

Authored-by: David Neto <dneto@google.com>

Co-authored-by: Ashwin Lele (NVIDIA Corporation) <alele@nvidia.com>
Co-authored-by: Neslisah <Neslisah.Torosdagli@amd.com>
2020-11-23 13:41:27 -07:00
Shahbaz Youssefi
7f6559d280
Compile out code for GL_EXT_shader_image_int64 for ANGLE (#2463)
Fixes a crash in ANGLE.

Closes: #2452
2020-11-16 10:22:34 -07:00