4076 Commits

Author SHA1 Message Date
Evgeny Proydakov
e3dab6f0d2 Code review. Thx ben-clayton for comments. 2021-02-09 12:14:52 +03:00
Evgeny Proydakov
05798c17fb Fixed issues 2496. Used option 4: parse_version.cmake to avoid python3 usage.
https://github.com/KhronosGroup/glslang/issues/2496
2021-02-09 12:14:52 +03:00
greg-lunarg
386b4fcb28
Merge pull request #2523 from dneto0/remove-stray-semi
Remove useless semicolon
2021-02-03 15:50:43 -07: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
greg-lunarg
6d68720cbb
Merge pull request #2512 from cmarcelo/GL_EXT_shared_memory_block
Add support for GL_EXT_shared_memory_block
2021-02-01 09:29:52 -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
3785ddd59a Update known_good.json to pick up SPV_KHR_workgroup_memory_explicit_layout
Also update the test expectations regarding validation accordingly and
the in-tree spirv.hpp copy.
2021-01-29 11:22:22 -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
greg-lunarg
f7c43377f0
Merge pull request #2513 from jeffbolznv/missingcap
Add missing capability when QueueFamily scope is used
2021-01-28 10:40:45 -07:00
Jeff Bolz
bfd84a39f2 Add missing capability when QueueFamily scope is used
Also, if this capability is added and the memory model is not
otherwise enabled by pragma, enable it as part of postprocessing.
2021-01-27 13:14:34 -06:00
greg-lunarg
36df92e4a0
Merge pull request #2511 from alan-baker/GL_EXT_null_initializer
Implement GL_EXT_null_initializer
2021-01-26 12:05:11 -07: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
greg-lunarg
6abdde3ce5
Merge pull request #2508 from corporateshark/master
Fix missing enum values in the C-interface #2507
2021-01-21 10:58:14 -07:00
Sergey Kosarevsky
a720028cdd Fix missing enum values in the C-interface #2507 2021-01-21 02:33:16 +03:00
greg-lunarg
9b4e82efb4
Merge pull request #2505 from ben-clayton/update-licnese-checker-cfg
license-checker.cfg: Update rules
2021-01-19 11:05:02 -07:00
greg-lunarg
5b7d68ca6b
Merge pull request #2504 from cdotstout/fuchsia-cmake
Add CMake support for Fuchsia
2021-01-19 10:59:05 -07:00
Ben Clayton
752028582f license-checker.cfg: Update rules
The license classification rules in github.com/google/licensecheck have been updated.
2021-01-18 12:27:00 +00:00
Craig Stout
17a83a9b33 Add CMake support for Fuchsia 2021-01-15 10:30:23 -08:00
greg-lunarg
3de5cfe50e
Merge pull request #2498 from dezinjob/fix-option-replacement-vs
Fix option replacement when flags are empty
2021-01-06 19:29:37 -07:00
greg-lunarg
480f6039e0
Merge pull request #2500 from jeremy-lunarg/hayes-2497
Prevent HLSL input under OpenGL semantics
2021-01-06 10:48:00 -07:00
greg-lunarg
f77085c307
Merge pull request #2499 from greg-lunarg/i2494
Fix debugInfo test to target vulkan1.1 as intended
2021-01-05 18:38:50 -07:00
Jeremy Hayes
b73afa8631 Prevent HLSL input under OpenGL semantics
Fix #2497.
2021-01-05 15:55:58 -07:00
Greg Fischer
e453088a8a Fix debugInfo test to target vulkan1.1 as intended
Fixes #2494
2021-01-05 14:45:11 -07:00
Denis Zalevskiy
78dbd7514a Fix option replacement when flags are empty
For the scenario when cmake is executed from MSVC with empty CXX flags.

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@basemark.com>
2021-01-05 15:07:24 +02:00
greg-lunarg
9325cc013e
Merge pull request #2393 from nihui/patch-3
Fix build with android ndk r16b
2020-12-24 12:53:39 -07: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-lunarg
f426f65229
Merge pull request #2490 from greg-lunarg/i2476
Fix tess factor cut and paste error
2020-12-18 10:19:52 -07:00
Greg Fischer
efe4586fad Fix cut and paste error
Fixes #2476
2020-12-17 22:57:50 -07:00
greg-lunarg
6d5916d4a9
Merge pull request #2451 from rdb/dx9-round-semantics
Don't compile round() to roundEven in DX9 compatibility mode
2020-12-16 13:55:00 -07:00
rdb
589aaff11c Don't use roundEven() to implement round() in DX9 compatibility mode 2020-12-16 18:35:42 +01:00
John Kessenich
a5be11bd8b
Merge pull request #2485 from proydakov/fixed-hlsl-off-compile-warning
Fixed compile warning in reflection.cpp for ENABLE_HLSL = 0 build. [-Wunused-parameter]
2020-12-15 12:16:17 -07:00
John Kessenich
b6fd41df69
Merge pull request #2487 from dneto0/validate-imageread-result
Update SPIRV-Tools known-good: validate OpImageRead result type
2020-12-15 12:15:32 -07:00
David Neto
1ef5e20290 Test updates for ImageRead result type validation
See #2486
2020-12-15 12:19:00 -05:00
David Neto
3805671ce8 Update known_good, pick up ImageRead result validation
Pick up https://github.com/KhronosGroup/SPIRV-Tools/pull/4072
which validates the result type of OpImageRead.

This also requires test expectation updates.

See #2486 tracks the needed upate to Glslang code generation.
2020-12-15 12:09:50 -05: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
c0bcfaf3ba
Fix SPV return type of rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT (#2484)
Issue #2483

According to GLSL spec the prototype is:
        uint rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQueryEXT q, bool committed);

but that was incorrectly getting translated to SPIRV as an `int`, and this was
causing SPIR-V validation errors when used.

Added explicit testing for the return types of all the builtin functions in GL_EXT_ray_query
2020-12-12 10:34:24 -07:00
greg-lunarg
ab66a91d62
Merge pull request #2482 from greg-lunarg/gtfix3
Update README to avoid googletest breakage
2020-12-11 15:08:50 -07:00
Greg Fischer
4f074aed75 Update README to avoid googletest breakage
Additional fix for #2480
2020-12-11 11:27:09 -07:00
greg-lunarg
862ddcb291
Fix Travis to use pre-breakage googletest (#2481) 2020-12-11 10:46:44 -07:00
greg-lunarg
c594de23cd
Update spirv-tools known-good #2 - Pick up ray tracing terminator fix (#2478) 2020-12-07 18:20:27 -07:00
greg-lunarg
dd69df7f3d
Update spirv-tools known-good (#2473) 2020-12-03 13:07:33 -07:00
Daniel Koch
e11a2c8bec
update spirv-headers and fix handling of gl_HitTEXT (#2471)
* update spirv-headers and fix handling of gl_HitTEXT

Update spirv-headers known_good to f027d53ded7e230e008d37c8b47ede7cd308e19d
and update SPIRV/spirv.hpp to copy from that version as well.

In GLSL gl_HitTNV/gl_HitTEXT is defined as an alias of gl_RayTmaxNV/gl_RayTmaxEXT
SPV_NV_ray_tracing has a dedicated HitTNV which gl_HitTNV maps to.
For SPV_KHR_ray_tracing, gl_HitTEXT gets mapped to a RayTmaxKHR decoraged variable
to simplify the SPIRV consumer.
This change fixes the mapping for the GL_EXT_ray_tracing extension, and updates
the test results to match.

* update MissNV shader test to not use ObjectRay builtins

They shouldn't existing in the miss stage because there is no object intersected
2020-11-30 09:57:34 -07:00
Daniel Koch
4d41da3b81
Add ray query capability if acceleration structure or ray query types declared (#2469)
* Add ray query capability if acceleration structure used

Fixes #2430

in non-ray tracing stages and the extension is enabled

* Add ray query capability if ray query declared

* Fix printing of TypeRayQueryKHR

It's no longer spelled with "Provisional"
2020-11-24 21:06:16 -07: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
Malcolm Bechard
beec2e4a7c
tweak local_size comparison a bit (#2456)
no longer causes an incorrect error if the current unit has local_size
set, but the incoming unit does not
2020-11-12 13:55:50 -07:00
David Neto
fb53f83503
Avoid spuriously adding Geometry capability for vert, tesc, tese (#2462)
Use of gl_Layer and gl_ViewportIndex in tessellation and vertex
shaders should not trigger the addition of the Geometry capability.

Fixes #2461

Added tests for use of gl_Layer and gl_ViewportIndex in a tessellation
evaluation shader.

Several tests for NVIDIA features for tessellation, vertex, or mesh
shaders now lose the Geometry or MultiViewport capabilities.
This is ok because the functionality is already covered by
the ShaderViewportIndexLayerNV capability.

The spv.meshShaderPerViewBuiltins.mesh test now fails validation
because the validator does not know that PrimitiveId (and possibly
other) builtins are enabled by the MeshShadingNV capability.
I filed https://github.com/KhronosGroup/SPIRV-Headers/issues/179 to
fix the grammar upstream.
2020-11-12 13:00:16 -07:00