4067 Commits

Author SHA1 Message Date
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
greg-lunarg
639f5461e3
New nonuniform analysis (#2457)
This implements a new nonunifom analysis suggested by @jbolz. This change
generates nonUniform decorations that were previously missing and avoids
generation of incorrect decorations. Most notably, it now generates
decorations for nonuniform functions and out params. It avoids generating
decorations for lvalues which themselves are not nonuniform.
2020-11-12 11:10:07 -07:00
Jesse Hall
74e8f05b9f
Implement GL_EXT_terminate_invocation (#2454)
* Implement GL_EXT_terminate_invocation.

* terminateInvocation: declare the SPV extension

* Update test results for spirv-tools and bison version bumps

Co-authored-by: John Kessenich <cepheus@frii.com>
2020-11-09 09:30:01 -07:00
rdb
383eaf3293
Fix token-pasting macros not working in preprocessor directives. (#2453)
Fixes #2443
2020-11-06 10:51:07 -07:00
Chow
3d7984dd1e
Fix warning in iomapper. (#2449)
ATT.
2020-11-05 10:33:45 -07:00
Tobski
8c1a3a06b8
Add GL_EXT_shader_image_int64 support (#2409) 2020-11-04 09:24:23 -07:00
Chow
478b232952
8. io mapping refine & qualifier member check & resolver expand (#2396)
* Code refine and adding missing features

1. Add new level for built in symbols.
2. Fix issues for structure members' qualifiers.
3. Global qualifier fix.
4. IO Mapper refine. Add support for checking with mangle names.

* Additional missing features

* Invariant member. (Only check non-interface).

* Split block nesting level and struct nesting level. To fix issues of checking 'invariant' qualifier.

Current grammar would check block/struct member without its parent class's information.
So we split nesting level, and 'invariant' would only be checked within a struct.

* Format anonymous block names. Refine codes for symbols from all kinds of resouces.

* Fix writeonly check.

* Use LValueBase to find operator.

* Fix random null ptr issue.

* invariant check, stage in io mapping, reference parameter should be used and remove wrong codes introduced with ordering vector.

* Remained: to be fixed with double check link.vk.multiblocksValid

* Fix version error.

invariant

* Revert loc modification.
2020-11-03 13:34:19 -07:00
Courtney Goeltzenleuchter
d550bebee9
Fix build error with Chromium & ANGLE (#2446)
Getting error about undefined symbol (include_dir) at line 320.
Was trying to append to a non-existant variable.

Bug #2445
2020-11-02 21:22:55 -07: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
Sidney Just
56350cadfe
Support for CapabilityShaderViewportIndex and CapabilityShaderLayer (#2432)
* When targeting SPIR-V 1.5, using gl_ViewportIndex will emit OpCapability ShaderViewportIndex and using gl_Layer will emit OpCapability CapabilityShaderLayer. OpCapability ShaderViewportIndexLayerEXT will only get emitted if the target < SPIR-V 1.5

* When using one of the viewport/layer arrays extensions, fallback to OpCapability ShaderViewportIndexLayerEXT, even when targeting SPIR-V 1.5

* Revert "When using one of the viewport/layer arrays extensions, fallback to OpCapability ShaderViewportIndexLayerEXT, even when targeting SPIR-V 1.5"

This reverts commit dccca82f4076ea6e2bc01dd6d1e5d290c59fab20.

* Using gl_Layer and gl_ViewportIndex outside of the geometry shader stage still requires one of the viewport extensions even when targeting SPIR-V 1.5
(Fixes a problem introduced by 670536b663f396815645b2f907f0ee92117b44f0)
2020-11-02 12:27:40 -07:00