Commit Graph

1689 Commits

Author SHA1 Message Date
John Kessenich
3d2391fb25 GLSL/SPV: Propagaet precision qualifier from function to return value.
When a return value's type has no precision qualification (e.g., the return
expression is formed from a constructor), and the formal function return type
has a precision qualification, back propagate that from the return type to the
type of the return value's expression.
2020-07-15 23:38:47 -06:00
Ben Clayton
f429b72298 runtests: Check error codes, set LD_LIBRARY_PATH
`glslangValidator` will only return [the codes 0..6](b481744aea/StandAlone/StandAlone.cpp (L117-L125)). Fail the test if anything else is returned (like due to the exe crashing).

Also set `LD_LIBRARY_PATH` to contain the `lib` directory before calling glslang.
2020-07-15 11:59:44 +01:00
John Kessenich
f80ef74c80 Fix recently found non-determinism with gl_WorldToObject3x4EXT. 2020-07-14 01:44:35 -06:00
John Kessenich
4e13c90944 Fix #2329: don't use invalid initializers. 2020-07-13 00:35:58 -06: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
863ea235bb SPIRV-Tools and tests: Update to location-validation in SPIRV-Tools.
This introduces five new "Validation failures":
- baseResults/hlsl.semantic.vert: issue with gl_ClipDistance/CullDistance
- baseResults/spv.430.vert: issue gl_ClipDistance
- baseResults/spv.450.tesc: still unknown
- baseResults/spv.dataOut.frag: gl_FragData should not be supported, problem with front end
- baseResults/spv.meshShaderPerViewUserDefined.mesh: seems okay, maybe a problem with SPIRV-Tools
2020-07-01 07:18:57 -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
8d3f3b7dac
Merge pull request #2302 from KhronosGroup/fix-texture-precision
SPV: RelaxedPrecision: use the result precision for texture sampling.
2020-06-30 12:41:15 -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
435dd8028b SPV: RelaxedPrecision: Generalize fix #2293 to cover more operations.
This simplifies and enforces use of precision in many more places,
to help avoid accidental loss of RelaxedPrecision through intermediate
operations. Known fixes are:
- ?:
- function return values with mis-matched precision
- precision of function return values when a copy was needed to fix types
2020-06-30 02:44:52 -06:00
John Kessenich
bf6efd0316 SPV: Fix #2293: keep relaxed precision on arg passed to relaxed param
When arguments are copied to make space for a writable formal parameter,
and the formal parameter is relaxed precision, make the copy also
relaxed precision.
2020-06-26 09:05:31 -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
Graeme Leese
182ab460d9 Update test expected files with new magic number
Updating the SPIR-V generator version number changes the output of all
the SPIR-V tests.
2020-06-22 11:49:38 +01:00
Graeme Leese
ff4b156e91 Update test results to expect OpFUnordNotEqual 2020-06-22 10:59:34 +01:00
rdb
ebf55a0711
HLSL: Fix incorrect case in name of DX9-style cube sampler type (#2265) 2020-06-15 06:39:43 -06:00
John Kessenich
3641ff7378 Bump code gen version, due to removal of OpEntryPoint operands. 2020-06-10 07:40:56 -06: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
Chow
8111268575
Add Shared/Std140 SSBO process & top-level array elements related (#2231)
* Add Shared/Std140 SSBO process & top-level array elements related
process

1.Add process options for shared/std140 ssbo, following ubo process
2.Add IO Variables reflection option, would keep all input/output
variables in reflection
3.Add Top-level related process, fix top-level array size issues,
following spec
4.Split ssbo/ubo reflection options, merge blowup expanding all into
function blowupActiveAggregate to allow other functions keep same entry
format.

Add options in StandAlone and test symbols.

1. Add options in StandAlone for std140/shared ubo/ssbo and all io variables reflection.
2. Add test for ssbo. When EShReflectionSharedStd140SSBO turns on, generated symbol and output would be different, to remind the difference. Defaultly disabled and nothing would change, nor blocking normal test.

* Add options in runtest script, refresh test results.

Add options in StandAlone:
--reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo

refresh test results.
Now the index, size of unsized array are expected.
2020-06-04 01:47:18 -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
rdb
d8edfd8e66
HLSL: fix handling of uniform qualifier in entry point parameters (#2254)
* HLSL: Fix handling of uniforms in entry point parameters

* HLSL: fix handling of "uniform in"

* Tests: Update baseResults of hlsl.function.frag.out for #2254

* HLSL: fix uniforms in function parameters for opaque types
2020-06-02 00:30:07 -06:00
alelenv
999d4fdcdd
Add default descriptorset decoration for acceleration structure (#2257)
variables.
2020-06-02 00:24:41 -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
alan-baker
2b0eafb1de
Update spirv tools (#2246)
* Update known good SPIRV-Tools

* Update test expectations
2020-05-25 10:18: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
Chow
0ab78114a9
Add check for DOUBLE in low versions (#2223)
Add check for DOUBLE in low versions, fix issue #2206
2020-05-18 03:41:52 -06:00
greg-lunarg
7c753a7253
Flatten all interface variables (#2217)
Specifically, add flattening of arrayed io for geometry and
tesselation shaders. Previously some interface structs just had
builtins split out which caused some interfaces to not be exactly
the same as that of flattened adjacent stages, affecting validation
and correctness.

This obviates builtin splitting. That will be removed in a followup
commit. It was left in for this commit to better exhibit the functional
changes that were made.

Fixes #1660.
2020-05-18 02:13:10 -06:00
Roy.li
24dcbd1b1f
Reserve unused std140 uniform block in reflection, and fix uniform block matrix layout (#2041)
According to the spec glsl4.60.7:
4.4.5. Uniform and Shader Storage Block Layout Qualifiers:
"The packed qualifier overrides only std140, std430, and shared; other qualifiers are inherited.
When packed is used, no shareable layout is guaranteed. The compiler and linker can optimize
memory use based on what variables actively get used and on other criteria. Offsets must be
queried, as there is no other way of guaranteeing where (and which) variables reside within the
block"

we should reserve std140 block and shared block in reflection.

According to the spec glsl4.60.7:
4.4.5. Uniform and Shader Storage Block Layout Qualifiers:
"The row_major and column_major qualifiers only affect the layout of matrices, including all
matrices contained in structures and arrays they are applied to, to all depths of nesting. These
qualifiers can be applied to other types, but will have no effect."

We need ensure all matrix block member been effect.

Support EShMsgKeepUncalled in reflection

EShMsgKeepUncalled  is a link message for link program.
We need only one option to control uncalled function optimization.
If we set EShMsgKeepUncalled as false in link time, linker won't be keep the uncall function sequence in AST,  and if we set EShMsgKeepUncalled as true in link time, linker will keep all uncalled function sequence in AST.
So, in reflecte time, we just only travers all function sequence. It make EShMsgKeepUncalled  only work at linker, and can effect reflection.

Recursively layout packing to "block member"

layout packing isn't set recursively, it causes TReflection::getOffsets doesn't work correctly.
2020-05-15 02:26:48 -06:00
Jaebaek Seo
08a05bc2b9
Move to newer version of SPIRV-Tools
* Update tests according to spirv-opt update

We refactored function inlining pass of spirv-opt and it results in
different numbering of result ids in SPIR-V code. This commit updates
test cases to avoid a test failure according to the spirv-opt update.

* Update known good
2020-05-14 11:06:05 -06:00
John Kessenich
b5f003d7a3 Fix #2191: Error check for indexing reference containing unsize array. 2020-05-01 08:19:59 -06:00
John Kessenich
7c4dc1299e
Merge branch 'master' into GL_EXT_blend_func_extended 2020-05-01 02:41:31 -06:00
Pankaj Mistry
e05cc20ec2 Add support for es extension GL_EXT_blend_func_extended
* Introduces builtin variables gl_SecondaryFragColorEXT and gl_SecondaryFragDataEXT
* Introduces builtin constant gl_MaxDualSourceDrawBuffersEXT
* enables support for layout qualifier "index" in es profile
2020-04-30 23:21:14 -07:00
John Kessenich
9fcc078724
Merge branch 'master' into GL_EXT_shader_implicit_conversions 2020-04-30 23:09:13 -06:00
pmistryNV
2c53baedbb
Add support for extension GL_EXT_shader_integer_mix (#2203) 2020-04-30 22:41:33 -06:00
Pankaj Mistry
2a8ead2109 Add support for extension GL_EXT_shader_implicit_conversions
Updated extension management in TIntermediate class.
2020-04-30 08:41:23 -07:00
pmistryNV
39281fb710
Add support for extension GL_ARB_vertex_attrib_64bit (#2193) 2020-04-29 06:58:49 -06:00
pmistryNV
f03cb290ac
Add support for extension GL_ARB_texture_query_lod. (#2194) 2020-04-27 23:46:54 -06:00
pmistryNV
ea50f6d77e
Add support for extension GL_ARB_shading_language_packing (#2192) 2020-04-27 02:46:32 -06:00
pmistryNV
7d65f09b83
Add support for extension GL_ARB_shader_storage_buffer_object (#2184)
Enable below features for GL Core version 420:
* layout qualifier "std430"
* storage qualifier "buffer"
* atomic memory functions
2020-04-22 22:46:52 -06:00
pmistryNV
3f4e5c4563
Add support for extension GL_ARB_shader_image_size (#2185) 2020-04-19 20:47:54 -06:00
pmistryNV
9f46e3dd5e
Add support for extension GL_ARB_shader_bit_encoding (#2183) 2020-04-17 05:24:12 -06:00
Cody Northrop
4d2298bfd7
Support multiple swizzled out operands (#2175)
Swizzled out operands were added in bbbd9a2a. This was sufficient
for most tests, but we ran into problems with umulExtended and
imulExtended, which have two.

This CL converts the tracking values to vectors so multiple operands
can be supported.

Test: KHR-GLES31.core.shader_bitfield_operation.*
Test: ctest
2020-04-13 21:59:49 -06:00
John Kessenich
4657244018 Fix #2178: Allow specialization constants for texel offsets. 2020-04-12 22:57:07 -06:00
alelenv
75de196cec
Add support for EXT_ray_flags_primitive_culling. (#2173)
Fixes issue #2169.
2020-04-08 22:09:20 -06:00
John Kessenich
9c3204a1fd Error message: Finish addressing #2097, better texture error message. 2020-04-07 02:18:23 -06:00