Commit Graph

521 Commits

Author SHA1 Message Date
Chow
a315b5633b Add GL_EXT_fragment_shading_rate 2020-10-20 13:46:13 +01:00
Rémi Verschelde
69d0c1acc2
Remove executable bits from code/data files (#2420) 2020-10-12 10:08:47 -06:00
David Neto
2067d1a93e
Add test case for read-only storage texture passed to helper function (#2414)
This is based on spv.paramMemory.frag.out which exercises the
writeonly storage image case.

This appears to need desktop GLSL.

The generated SPIR-V fails validation because the image_write function
takes a parameter which is pointer to an OpTypeImage with Unknown format.
But the parameters passed in are pointer to OpTypeImage with formats Rgba32f
and Rgba16f. The validator rejects this, saying the parameter types must
match.
2020-10-07 16:10:27 -06:00
John Kessenich
2b77059502 Revert "Add new SpirvToolsDisassemble API interface + Improve Doc on existing API interface (#2408)"
See issue #2413.

This reverts commit d1929f359a.
2020-10-05 16:58:31 -06:00
pheonix
d1929f359a
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.
2020-10-05 09:59:27 -06:00
John Kessenich
f05c076e26 Revert "Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output. (#2406)"
This reverts commit 2eed8236d0.
2020-09-27 18:15:41 -06:00
pheonix
2eed8236d0
Add more flexible SpirvToolsDisassemble interface to allow specifying spv_target_env for disassembly output. (#2406)
Improve documentation on existing SpirvToolsDisassemble interface.
Fix cmake build scripts to account for `spirv-tools` external when -DENABLE_OPT=ON
2020-09-27 17:53:18 -06:00
Tobias Hector
395bce6c85 Added missing copyright amendment 2020-09-08 11:10:27 +01:00
Tobias Hector
ed7a097d19 Error when initializing rayQuery with assignment 2020-09-03 15:16:25 +01:00
johnkslang
23f3bdfea1 Build/Test: Dropping 2013 allows using the latest googletests.
These have a new spelling: INSTANTIATE_TEST_CASE_P -> INSTANTIATE_TEST_SUITE_P
2020-08-05 11:07:07 -06:00
Shahbaz Youssefi
1ef2e250fc
Use GLSLANG_ANGLE to strip features to what ANGLE requires
This change strips a few features similar to GLSLANG_WEB but doesn't
remove every detail like the latter.  It also hardcodes profile/version
to core/450.

In particular, TBuiltIns::initialize is specialized to remove most of
what is not supported or won't be supported by ANGLE.  The result of
this function is parsed with TParseContext::parseShaderStrings which is
a performance bottleneck.

This change shaves about 300KB off of ANGLE's binary size and reduces
the cost of SetupBuiltinSymbolTable to nearly a sixth.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
2020-07-31 12:44:49 -04:00
Vikram Kushwaha
79b93923d2 Add changes for SPV_EXT_shader_atomic_float_add 2020-07-22 05:52:22 -07:00
John Kessenich
f80ef74c80 Fix recently found non-determinism with gl_WorldToObject3x4EXT. 2020-07-14 01:44:35 -06:00
John Kessenich
fe24a54808 Non-determinism: Remove test file that seems to trigger non-determinism.
This problem needs to be fixed, but in parallel, we need to see master
and any other changes to it passing all tests.

The removed test is ray-tracing centric, and may indicate non-determinism
in recent code added for that functionality.
2020-07-14 00:32:25 -06:00
John Kessenich
4f32f93d7e Revert "Merge pull request #2330 from ShabbyX/optimize_for_angle"
This reverts commit 1ee5d1c0bb, reversing
changes made to 906d48a7e8.
2020-07-13 03:39:08 -06:00
John Kessenich
4e13c90944 Fix #2329: don't use invalid initializers. 2020-07-13 00:35:58 -06:00
John Kessenich
1ee5d1c0bb
Merge pull request #2330 from ShabbyX/optimize_for_angle
Optimize for angle
2020-07-12 00:32:52 +07:00
Shahbaz Youssefi
8c49d15fbf
Use GLSLANG_ANGLE to strip features to what ANGLE requires
This change strips a few features similar to GLSLANG_WEB but doesn't
remove every detail like the latter.  It also hardcodes profile/version
to core/450.

In particular, TBuiltIns::initialize is specialized to remove most of
what is not supported or won't be supported by ANGLE.  The result of
this function is parsed with TParseContext::parseShaderStrings which is
a performance bottleneck.

This change shaves about 300KB off of ANGLE's binary size and reduces
the cost of SetupBuiltinSymbolTable to nearly a sixth.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
2020-07-08 15:33:20 -04:00
Ben Clayton
31cad22758 Use CMake's builtin functionality for PCHs
`glslang_pch()` did manual mangling of the compiler flags to enable pre-compiled headers.
I couldn't get this approach to work with the `MachineIndependent` subdirectory, but fortunately CMake has added first-class support for precompiled headers in 3.16, which does work with subdirectories.

Moved `glslang_pch()` to the other global function declarations.

`glslang_pch()` is a no-op when using CMake earlier than `3.16`.

CMake's PCH implementation does not need the `pch.cpp` files, so just remove them.
2020-07-07 16:44:19 +01:00
Ben Clayton
cb261e3c21 License headers: s/Google/The Khronos Group
This was a copy-paste screwup, where the first line of the copyright had the company name was updated, but the company name mid way though was not.
2020-07-03 12:21:01 +01:00
Ben Clayton
1d21270ebf Add missing copyright headers
Add copyright headers to build files and scripts.
Simplifies automated scanning for bad license headers.
2020-07-02 16:03:48 +01:00
John Kessenich
a70f7dea77
Merge pull request #2268 from lriki/hlsl-pack_matrix
HLSL: Fix #pragma pack_matrix(row_major) not work on global uniforms
2020-07-02 05:21:45 -06:00
John Kessenich
f6facfa189 Tests: More broadly use automapping binding/location.
This adds or changes binding/location decorations in 100s of shaders.
It also allows more output (spv.register.autoassign.rangetest.frag)
due to allowing ioMap() to fail.
2020-07-01 06:40:13 -06:00
John Kessenich
12c155f303 SPV: RelaxedPrecision: use the result precision for texture sampling.
Fix #2298.

The AST has two precisions, an operation precision and a result precision.
Actual use of GLSL with mediump samplers wants the result precision, so
pick that up instead of the operation precision.
2020-06-30 07:52:05 -06:00
John Kessenich
4df10335e6 SPV: Partially address #2293: correct "const in" precision matching.
Track whether formal parameters declare reduced precision and match
that with arguments, and if they differ, make a copy to promote the
precision.
2020-06-26 08:37:06 -06:00
lriki
1ee750aed5 Add pack_matrix test 2020-06-25 17:54:16 +09:00
John Kessenich
c30d335377 Fix #2264: OpEntryPoint incorrectly including function parameters. 2020-06-10 07:17:11 -06:00
Roy.li
08328fea5a
Fix xfb stride limit issue (#2088)
* Fix xfb_stride limit issue

Unsized array can't apply to transform trace. layout qualifier "offset" require GL_ARB_enhanced_layouts enable or glsl core version > 440.

* Add negative test for xfb limit

* update case result

* Fix compile information issue

Fix compile information issue and test comment issue.

* remove es profile condition, use profileRequires to limit.

* Fix xfb_stride limit issue

Unsized array can't apply to transform trace. layout qualifier "offset" require GL_ARB_enhanced_layouts enable or glsl core version > 440.
Add negative test for xfb limit

* Move es profile check out of version number check

* Adjust error information and related cases

remove the new version check, refine original version check.

* Revert condition for vulkan, and remove redundant test code.
2020-06-09 02:30:14 -06:00
Alejandro Piñeiro
ff6dcca575
spirv: Support initializers on uniforms (#1588)
If a uniform has an initializer it will now be given as the optional
initializer operand to the OpVariable instruction.

Fixes: https://github.com/KhronosGroup/glslang/issues/1259

Signed-off-by: Neil Roberts <nroberts@igalia.com> (the code)
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com> (the tests)
Signed-off-by: Arcady Goldmints-Orlov <agoldmints@igalia.com>

Co-authored-by: Neil Roberts <nroberts@igalia.com>
2020-06-04 01:39:31 -06:00
Ricardo Garcia
232ba0d848
Add SPIR-V capabilities needed for spec constants (#2199)
Fixes #2198.
2020-06-03 07:52:55 -06:00
rdb
78a3c915a1
HLSL: Add better diagnostic when using in/out qualifiers in global scope (#2258) 2020-06-02 00:32:35 -06:00
alelenv
d39b8afc47
EXT_ray_tracing requires spv1.4 (#2237)
* EXT_ray_tracing requires spv1.4

* Fix typo.

* Add extension data table.

* Updated feedback #2.
2020-05-28 09:18:07 -06:00
greg-lunarg
e00d27c6d6
Fix missing patch decoration for TessFactor PCF arg (#2249)
Fixes #1553
2020-05-27 22:12:42 -06:00
alelenv
59216d5cd8
Add support for primitive culling layout qualifier. (#2220)
* Add support for primitive culling layout qualifier.

* Add error checks for primitive flags and negative test.
2020-05-21 05:38:41 -06:00
Malcolm Bechard
6f723ebbe3
fix incorrect error when multiple compilation units don't declare layouts (#2238)
when using multiple compilation units, input/output layouts don't need
to be declared in every unit.
2020-05-21 00:10:33 -06:00
John Kessenich
4657244018 Fix #2178: Allow specialization constants for texel offsets. 2020-04-12 22:57:07 -06:00
Malcolm Bechard
0b66fa3b62
Shader interface matching rework to fix #2136 (#2156)
* rework how shader interface block naming rules are handled

* Fixes 2136

According to the spec, shader interfaces (uniform blocks, buffer
blocks, input blocks, output blocks) all should be matched up via
their block names across all compilation units, not instance names.
Also, all block names can be re-used between all 4 interface types
without conflict. This change makes it so all of these blocks are
matched and remapped using block name and not by instance name.
Additional the rule that matched uniform and buffer blocks must
either be anonymous or named (but not nessearily the same name) is
now imposed.

* add warning if instance names differ between matched shader interfaces

* Add test cases from #2137 which is now fixed as well.

* replace some tab characters with spaces

* buffer blocks and uniform blocks now share the same block namespace
2020-04-02 02:03:53 -06:00
alelenv
f986436a90 Error assigns to objects of rayQueryEXT type. 2020-03-30 10:24:30 -07:00
Neslisah Torosdagli
054b5e35eb pass by reference updates 2020-03-26 12:24:31 -04:00
Neslisah Torosdagli
65c81bf236 compute and fragment shader test_cases added for rayQuery 2020-03-23 21:56:31 -04:00
Neslisah Torosdagli
2fb45def04 rayQuery test cases added 2020-03-23 21:34:09 -04:00
Neslisah Torosdagli
4893bae5e9 test names updated 2020-03-23 19:20:24 -04:00
Neslisah Torosdagli
39a7fc3700 rayQuery test cases disabled 2020-03-23 11:36:06 -04:00
Neslisah Torosdagli
50a722818b GL_EXT_ray_query glslang updates, and test cases added. 2020-03-20 18:23:27 -04:00
Daniel Koch
db32b243ff Add support for GLSL_EXT_ray_tracing
and SPV_KHR_ray_tracing
2020-03-17 20:42:47 -04:00
Jeff Bolz
40007b862d Forbid memoryBarrierAtomicCounter for Vulkan compiles 2020-03-16 23:53:04 -05:00
Malcolm Bechard
4b2483ee88
Fix #2005. Allow multiple compilation units to declare identical push_constant blocks (#2123)
* Fixes #2005

Allow multiple units in a stage to have push_constants as long
as the blocks match.
Requires #2006 to be fixed to be functional.

* tweaks to #2005 fix after some testing

* add unit tests for push constants across multiple compilation units

For #2005

* update reference output for tests that fail validation

* fix uninitialized result.validationResult
2020-03-16 08:51:15 -06:00
Jeff Bolz
ad3f10bbd0 EXT_debug_printf - make escape sequences better match C/C++ 2020-03-10 10:23:07 -05:00
Jeff Bolz
b57af2f5ad Decorate accesschain operand for nonuniform UBO loads
This is conservative and still also decorates the loaded value.
2020-03-09 14:09:41 -05:00
Jeff Bolz
39ffdaf2ab Allow nonuniformEXT() on sampler types.
Also add missing NonUniformEXT decoration on OpImageTexelPointer.
2020-03-09 10:48:12 -05:00