Commit Graph

3834 Commits

Author SHA1 Message Date
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
90f1d6ab58
Merge pull request #2296 from ben-clayton/err-unresolved
CMake: Error on unresolved symbols
2020-06-30 05:27:14 -06:00
John Kessenich
dca47063cc
Merge pull request #2295 from ben-clayton/rm-old-kokoro-cfgs
Remove root kokoro/linux-*-cmake configs
2020-06-29 22:07:40 -06:00
John Kessenich
2b6a18bd84
Merge pull request #2292 from proydakov/gcc-unused-parameter
Fixed GCC -Wunused-parameter in hlslParseables.cpp.
2020-06-29 21:54:06 -06:00
Evgeny Proydakov
f6e3446363 Fixed GCC -Wunused-parameter in hlslParseables.cpp.
Warnings before fix:

[3/7] Building CXX object glslang/CMakeFiles/glslang.dir/HLSL/hlslParseables.cpp.o
../glslang/HLSL/hlslParseables.cpp: In function ‘bool {anonymous}::IsValid(const char*, char, char, char, char, int, int)’:
../glslang/HLSL/hlslParseables.cpp:334:45: warning: unused parameter ‘retOrder’ [-Wunused-parameter]
  334 | inline bool IsValid(const char* cname, char retOrder, char retType, char argOrder, char argType, int dim0, int dim1)
      |                                        ~~~~~^~~~~~~~
../glslang/HLSL/hlslParseables.cpp:334:60: warning: unused parameter ‘retType’ [-Wunused-parameter]
  334 | inline bool IsValid(const char* cname, char retOrder, char retType, char argOrder, char argType, int dim0, int dim1)
      |                                                       ~~~~~^~~~~~~
../glslang/HLSL/hlslParseables.cpp:334:89: warning: unused parameter ‘argType’ [-Wunused-parameter]
  334 | inline bool IsValid(const char* cname, char retOrder, char retType, char argOrder, char argType, int dim0, int dim1)
      |                                                                                    ~~~~~^~~~~~~
../glslang/HLSL/hlslParseables.cpp:334:112: warning: unused parameter ‘dim1’ [-Wunused-parameter]
  334 | inline bool IsValid(const char* cname, char retOrder, char retType, char argOrder, char argType, int dim0, int dim1)
      |                                                                                                            ~~~~^~~~
2020-06-29 17:07:34 +03:00
Ben Clayton
1fee6072d0 CMake: Error on unresolved symbols
Issue: #1484
2020-06-29 14:57:12 +01:00
Ben Clayton
08bc7cf5fc Remove root kokoro/linux-*-cmake configs
These have been superseded by the `static` and `shared` variants in the respective subdirectories.

Issue: #2283
2020-06-29 14:52:54 +01:00
John Kessenich
27e915ed4f
Merge pull request #2286 from ben-clayton/kokoro-static-shared
Kokoro: Split linux cmake cfgs into static/shared
2020-06-28 22:44:29 -06:00
John Kessenich
be06c6f282
Merge pull request #2294 from KhronosGroup/fix-arg-precision
Fix #2293: Get correct RelaxedPrecision settings for various ways of passing arguments to formal parameters.
2020-06-28 05:10:54 -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
Ben Clayton
40e1ae11f4 Kokoro: Split linux cmake cfgs into static/shared
Allows for testing of generation of both static libraries and shared objects.

The old configs are staying in place until I'm confident everything is working correctly.

Issues: #1421, #1484, #2283
2020-06-24 14:16:17 +01:00
John Kessenich
fbb9dc2cf1
Merge pull request #2285 from proydakov/msvc-rtti-compilation-warning-fix
Fixed msvc 2019 nmake compiler warnings with RTTI.
2020-06-24 02:53:45 -06:00
Evgeny Proydakov
b90adef928 Fixed msvc 2019 nmake compiler warnings with RTTI.
By default cmake generates cxx_flags with `/GR` parameter.
I updated CMAKE_CXX_FLAGS string and replaced `/GR` -> `/GR-`

How to reproduce:

Visual Studio 2019 x64 command port

mkdir build-msvc2019
cd build-msvc2019
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=install ..
nmake

COMPILATION BEFORE:

Scanning dependencies of target OSDependent
[  1%] Building CXX object glslang/OSDependent/Windows/CMakeFiles/OSDependent.dir/ossource.cpp.obj
cl : Command line warning D9025 : overriding '/GR' with '/GR-'
ossource.cpp
[  3%] Linking CXX static library OSDependent.lib
[  3%] Built target OSDependent
Scanning dependencies of target OGLCompiler
[  4%] Building CXX object OGLCompilersDLL/CMakeFiles/OGLCompiler.dir/InitializeDll.cpp.obj
cl : Command line warning D9025 : overriding '/GR' with '/GR-'
InitializeDll.cpp
[  6%] Linking CXX static library OGLCompiler.lib
[  6%] Built target OGLCompiler
Scanning dependencies of target glslang
[  7%] Building CXX object glslang/CMakeFiles/glslang.dir/MachineIndependent/glslang_tab.cpp.obj
cl : Command line warning D9025 : overriding '/GR' with '/GR-'
glslang_tab.cpp
[  9%] Building CXX object glslang/CMakeFiles/glslang.dir/MachineIndependent/attribute.cpp.obj
cl : Command line warning D9025 : overriding '/GR' with '/GR-'

FLAGS BEFORE:

-- CMAKE_C_FLAGS:   /DWIN32 /D_WINDOWS /W3
-- CMAKE_CXX_FLAGS: /DWIN32 /D_WINDOWS /W3 /GR /EHsc
-- CMAKE_CXX_FLAGS_DEBUG:   /MDd /Zi /Ob0 /Od /RTC1
-- CMAKE_CXX_FLAGS_RELEASE: /MD /O2 /Ob2 /DNDEBUG

COMPILATION AFTER:

[  1%] Building CXX object glslang/OSDependent/Windows/CMakeFiles/OSDependent.dir/ossource.cpp.obj
ossource.cpp
[  3%] Linking CXX static library OSDependent.lib
[  3%] Built target OSDependent
[  4%] Building CXX object OGLCompilersDLL/CMakeFiles/OGLCompiler.dir/InitializeDll.cpp.obj
InitializeDll.cpp
[  6%] Linking CXX static library OGLCompiler.lib
[  6%] Built target OGLCompiler
[  7%] Building CXX object glslang/CMakeFiles/glslang.dir/MachineIndependent/glslang_tab.cpp.obj
glslang_tab.cpp
[  9%] Building CXX object glslang/CMakeFiles/glslang.dir/MachineIndependent/attribute.cpp.obj

FLAGS AFTER:

-- CMAKE_C_FLAGS:   /DWIN32 /D_WINDOWS /W3
-- CMAKE_CXX_FLAGS: /DWIN32 /D_WINDOWS /W3 /GR- /EHsc
-- CMAKE_CXX_FLAGS_DEBUG:   /MDd /Zi /Ob0 /Od /RTC1
-- CMAKE_CXX_FLAGS_RELEASE: /MD /O2 /Ob2 /DNDEBUG
2020-06-23 22:02:34 +03:00
John Kessenich
8397044502
Merge pull request #2260 from gnl21/not-equal
Use OpFUnordNotEqual for floating-point !=
2020-06-22 05:35:20 -06: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
060882fd37 Update SPIR-V generator version
Change to 10 to reflect the change to generating unordered !=
operations.
2020-06-22 11:03:46 +01:00
Graeme Leese
ff4b156e91 Update test results to expect OpFUnordNotEqual 2020-06-22 10:59:34 +01:00
Graeme Leese
65ce566cbc Use OpFUnordNotEqual for floating-point !=
The normal IEEE not equal operation tests whether operands are unordered
or not equal (so comparison with a NaN returns true). This corresponds
to the SPIR-V OpFUnordNotEqual, so change to using that.
2020-06-22 10:59:33 +01:00
John Kessenich
adacba3ee9
Update README.md 2020-06-22 01:44:53 -06:00
John Kessenich
b97d7669bc
Merge pull request #2278 from ShabbyX/master
Add -g0 command line argument
2020-06-22 01:08:52 -06:00
John Kessenich
e20ac35adb
Merge pull request #2281 from ben-clayton/moar-kokoro
Add more Kokoro configurations
2020-06-19 09:43:49 -06:00
Ben Clayton
b2a4399dcc Add kokoro configs for android-ndk and cmake 2020-06-19 15:34:31 +01:00
Ben Clayton
ca17b723fb Switch ndk_test from gnustl_static to c++_static
gnustl_static is no longer supported.
2020-06-19 12:35:57 +01:00
Shahbaz Youssefi
d52dce5067
Add -g0 command line argument
Analogous to gcc, -g0 would strip all debug info.  This is done
regardless of whether optimizations are enabled.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
2020-06-18 10:16:40 -04:00
John Kessenich
051c6fed88 Build: use better MSVC subfolder names for the previous build changes. 2020-06-16 07:47:48 -06:00
John Kessenich
b247cfcd59
Merge pull request #2275 from ben-clayton/mv-hlsl
Move hlsl/ source to glslang/HLSL/
2020-06-16 06:26:17 -06:00
John Kessenich
abd91adf9d Bump version numbers. 2020-06-16 06:22:56 -06:00
Ben Clayton
f49820dd6b Move hlsl/ source to glslang/HLSL/
Now that the HLSL source files are part of the `glslang` target (#2271), it makes sense for these to sit in the `glslang` directory.

Changed the case of the directory from `hlsl` to `HLSL` to better match the sibling directories.
2020-06-16 11:55:28 +01:00
John Kessenich
4928d556e6
Merge pull request #2271 from ben-clayton/fold-hlsl
Untangle build target cyclic dependencies (approach #2)
2020-06-16 04:20:32 -06:00
John Kessenich
bd392c639e Bump version. 2020-06-16 04:18:48 -06:00
Ben Clayton
dcad9ad056 CMake: Fold HLSL source into glslang
... and stub the HLSL target.

Fixes the building of shared libraries.

This breaks the cyclic dependency between the `glslang` and `hlsl` targets (by essentially removing the `hlsl` target).

The `BUILD.gn` and `BUILD.bazel` build rules already pull the `HLSL` source into the `glslang` target.

`Android.mk` is the only remaining build config that has a dedicated `HLSL` target, but this is explicity static and does not suffer the same link-time issues with the cyclic dependency (we may wish to stub this target too).

Related issue: #1484, #2147
Related PR: #2267
2020-06-16 10:46:06 +01:00
dan sinclair
00965b9fa9
Remove unused variable. (#2273)
The `isMat` variable is no longer used in the HLSL parser. Removed.
2020-06-15 12:10:44 -06:00
Ryan Harrison
8496b782fb
Remove unused function, BaseTypeName (#2272) 2020-06-15 10:58:02 -06:00
John Kessenich
a58978ac9a HLSL: Remove support for having GLSL versions of HLSL intrinsics.
Related to PR #2265.
2020-06-15 10:28:09 -06:00
rdb
ebf55a0711
HLSL: Fix incorrect case in name of DX9-style cube sampler type (#2265) 2020-06-15 06:39:43 -06:00
Ben Clayton
1a6c8ecb20 C Interface: Split SPIR-V C interface to own file
This breaks a cyclic dependency between the SPIRV and glslang build targets.
2020-06-15 13:22:19 +01:00
Ben Clayton
b919bc889e
Fix signed / unsigned mismatch warning (#2266) 2020-06-10 21:41:47 -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
Ryan Harrison
68b2e15ee0
Use correct type for var storing returned value (#2263) 2020-06-09 10:01:43 -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
b56e0e441b
HLSL: Recognize POSITION semantic et al in DX9 compatibility mode (#2255) 2020-06-02 00:30:50 -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
John Kessenich
0cc27fb68c Update news for header location change and recommendation. 2020-06-01 23:24:37 -06:00