3296 Commits

Author SHA1 Message Date
otakuto
dae0b0a59e Add shebang 2018-08-07 03:25:35 +09:00
otakuto
d03da06ac1 Remove execute permissions 2018-08-07 03:16:20 +09:00
John Kessenich
e0bc65b2c1
Merge pull request #1460 from KhronosGroup/postprocess
Non-Functional: Add postprocess as more robust way to add capabilities
2018-08-06 00:46:27 -07:00
John Kessenich
f04c51b3bd Non-Functional: Add postprocess as more robust way to add capabilities
When capabilities are needed for specific SPIR-V instructions, it is
fragile to do so based on GLSL/AST usage; it should be based on actual
instructions they got translated to.
2018-08-03 15:56:12 -06:00
John Kessenich
29619b2312
Merge pull request #1459 from dgkoch/dgkoch_build_fixes4
Fix various build warnings/errors
2018-08-01 14:28:57 -07:00
Daniel Koch
883607d5fc Fix build warnings/errors:
1) On some old versions of MSVC:

	glslang\MachineIndependent\Constant.cpp(187): warning C4056: overflow in floating-point constant arithmetic

On this platform the definition of INFINITY is as follows:

	#ifndef _HUGE_ENUF
	   #define _HUGE_ENUF  1e+300  // _HUGE_ENUF*_HUGE_ENUF must overflow
	#endif
	#define INFINITY   ((float)(_HUGE_ENUF * _HUGE_ENUF))

Moving the negation outside the cast seems to resolve that issue.

2) Some Linux compilers were unhappy with lines 226/227

	glslang/MachineIndependent/Constant.cpp: In member function 'virtual glslang::TIntermTyped* glslang::TIntermConstantUnion::fold(glslang::TOperator, const glslang::TIntermTyped*) const':
	glslang/MachineIndependent/Constant.cpp:226:99: error: integer overflow in expression [-Werror=overflow]
			 else if (rightUnionArray[i].getIConst() == -1 && leftUnionArray[i].getIConst() == -(int)0x80000000)
													   ^~~~~~~~~~~~~~~~
	glslang/MachineIndependent/Constant.cpp:227:48: error: integer overflow in expression [-Werror=overflow]
			     newConstArray[i].setIConst(-(int)0x80000000);
	                                                ^~~~~~~~~~~~~~~~

Moving the negation to the right side of the cast made those happy, but then some Windows compilers were unhappy:

	glslang\MachineIndependent\Constant.cpp(226): warning C4146: unary minus operator applied to unsigned type, result still unsigned
	glslang\MachineIndependent\Constant.cpp(227): warning C4146: unary minus operator applied to unsigned type, result still unsigned

which required adding on the "ll" suffix.

3) Android builds where unhappy with line 242:

	glslang/MachineIndependent/Constant.cpp:242:100: error: comparison of integers of different signs: 'long long' and 'unsigned long long' [-Werror,-Wsign-compare]
        	        else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == -0x8000000000000000ll)
                	                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~
	1 error generated.

Adding an explicit (long long) cast resolved this.
And the negation needs to be on the right side of the cast otherwise linux
builds are unhappy as in (2).

4) Android builds are unhappy with out of order initializers:

	glslang/MachineIndependent/reflection.h:60:84: error: field 'type' will be initialized after field 'stages' [-Werror,-Wreorder]
		glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), type(pType.clone()), stages(EShLanguageMask(0)) { }
											   ^
	1 error generated.


Change-Id: Ic9a05fa7912498284885113d8b051f93f822f62b
2018-07-27 17:20:49 -04:00
John Kessenich
e99a26810f
Merge pull request #1457 from KhronosGroup/parse-floats
Tests: Add more string -> float tests. Related to #1456.
2018-07-27 12:46:35 -07:00
John Kessenich
7cdc24c06c PP: Address #1456: Strip float suffixes before using platform library. 2018-07-27 13:08:05 -06:00
John Kessenich
994d4bf325 Tests: Add more string -> float tests. Related to #1456. 2018-07-27 13:06:54 -06:00
John Kessenich
561a43d272 PP: floating-point parsing: more stable handling of istringstream::fail
Possibly addresses #1456
2018-07-26 14:29:29 -06:00
John Kessenich
13803b185d Bump revision. 2018-07-25 15:34:01 -06:00
John Kessenich
6e382f63b4
Merge pull request #1455 from TiemoJung/nullpointer_crash_fix
Fixes a crash when in/out varying variable had no semantic name and a…
2018-07-25 11:13:05 -07:00
John Kessenich
e161cc11f7 GLSL: No more restrictions on (non)shadow sampler construction.
Match https://github.com/KhronosGroup/GLSL/pull/22
2018-07-25 12:11:04 -06:00
t.jung
9f8cb850e4 Fixes a crash when in/out varying variable had no semantic name and an error was reported in ioremapper phase when the variable was rejected 2018-07-25 13:43:14 +02:00
John Kessenich
62faea79d7
Merge pull request #1451 from KhronosGroup/shadow-forces-depth
GLSL/SPV: If a texture is used with a shadow sampler, force 'shadow'.
2018-07-23 16:41:00 -07:00
John Kessenich
11da9eed5d HLSL: Fix #1445: distance() works on scalars. 2018-07-23 16:55:01 -06:00
John Kessenich
56b33196a9
Merge pull request #1453 from greg-lunarg/kg22
Update spirv-tools known good
2018-07-23 15:03:31 -07:00
John Kessenich
7d4c9a07b5 GLSL: Construct shadow texture from non-shadow sampler.
Tracks https://github.com/KhronosGroup/GLSL/pull/22.
2018-07-23 15:59:09 -06:00
John Kessenich
0339af3c1f GLSL/SPV: If a texture is used with a shadow sampler, force 'shadow'.
Fixes #854. But, only good if we are not trying to use the same
texture for both shadow and non-shadow constructors.

Force the type of the texture to have 'shadow' set when it is
constructed with a samplerShadow.
2018-07-23 15:58:32 -06:00
GregF
3f05beddc8 Update spirv-tools known good
Includes the following:

Add Vulkan 1.1 capability sets
Don't merge types of resources
Remove stores of undef.
Make sure the constant folder get the correct type.
2018-07-23 11:57:16 -06:00
John Kessenich
fa4952c31c Merge branch 'zeux-master' 2018-07-20 17:13:19 -06:00
John Kessenich
5a7321eb03 Merge branch 'master' of https://github.com/zeux/glslang into zeux-master 2018-07-20 17:11:44 -06:00
John Kessenich
81793ad2a3
Merge pull request #1450 from KhronosGroup/link-merge-all
Link: Merge all downstream consumed intermediate modes.
2018-07-20 12:40:32 -07:00
John Kessenich
b617e14acb Link: Merge all the settings in TIntermediate.
Fixes #1309.
2018-07-20 12:34:59 -06:00
John Kessenich
5d6b567950
Merge pull request #1436 from karl-lunarg/karl-ccache
build: Add ccache option to CMake config
2018-07-18 20:39:31 -07:00
John Kessenich
8103cb9580
Merge pull request #1446 from KhronosGroup/spv-link
Link/SPV: Correct symbol IDs on merging ASTs to a single coherent space
2018-07-18 17:29:17 -07:00
John Kessenich
ebd989dd58
Merge pull request #1437 from mattparks/patch-2
CMake options for postfix and SPVRemapper.
2018-07-18 17:15:32 -07:00
John Kessenich
34e56891b0 Merge branch 'jeffbolznv-missing_descriptor_indexing_extension' 2018-07-18 18:11:16 -06:00
John Kessenich
4137241a04 Merge branch 'missing_descriptor_indexing_extension' of https://github.com/jeffbolznv/glslang into jeffbolznv-missing_descriptor_indexing_extension 2018-07-18 18:10:45 -06:00
John Kessenich
41436ad204 Link/SPV: Correct symbol IDs on merging ASTs to a single coherent space
This is one step in providing full linker functionality for creating
correct SPIR-V from multiple compilation units for the same stage.
(This was the only remaining "hard" part. The rest should be simple.)
2018-07-18 18:07:41 -06:00
John Kessenich
806af25f74
Merge pull request #1442 from dneto0/use-forked-android-ndk-repo
NDK build: Use NDK r17b and its own CMake toolchain file
2018-07-12 15:07:51 -07:00
Jeff Bolz
c140b96892 Add missing OpExtension SPV_EXT_descriptor_indexing for dynamic indexing capabilities 2018-07-12 16:51:18 -05:00
John Kessenich
e7f9caeac4 Errors and Build: Fix build warnings, which also improved error messages. 2018-07-12 15:11:07 -06:00
David Neto
4aeca2df33 NDK build: Use NDK r17b and its own CMake toolchain file
More recent NDK releases have their own CMake toolchain file.
Use it.

Also, download the NDK from github.com:dneto0/android-ndk.
That is a fork of the repo we used to use, but we have more
control over how long it stays stable.
2018-07-12 14:56:29 -04:00
John Kessenich
b75c7065cc Travis CI: Fix comments disabling code. 2018-07-12 11:37:09 -06:00
John Kessenich
e5b27660ba
Merge pull request #1440 from dneto0/later-android
WIP: Travis-CI: Use Android NDK r13b specifically
2018-07-12 10:01:54 -07:00
David Neto
3541d8a5a0 Travis-CI: Use Android NDK r13b specifically
The Travis-CI bot downloads a copy of the Android NDK.  The source
we get it from recently updated to Android NDK r17b.  However,
the android.toolchain.cmake file does not know how to parse the
Android native API level from that version of the NDK.  So check
out the NDK r13b version that we were using until yesterday.

Fixes #1439
2018-07-12 12:02:26 -04:00
John Kessenich
8dafeab47e
Merge pull request #1438 from Think-Silicon/getUniformStages
Reflection exposes the Shader Stages where a Uniform is present
2018-07-11 08:19:21 -07:00
John Kessenich
0ea33a2628 Non-functional: Retrigger bots; the previous failure looks suspicious. 2018-07-11 02:24:36 -06:00
John Kessenich
cf6bd066b9 HLSL: Fix #1432: Globally initialize local static variables. 2018-07-11 01:09:14 -06:00
dmpakas
f556e5da26 Reflection exposes the Shader Stages where a Uniform is present 2018-07-10 18:25:48 +03:00
Matthew Albrecht
f9c2aeb736 Allowed debug postfix to be changed. 2018-07-07 17:00:08 -05:00
Matthew Albrecht
857f25cfd2 Added the cmake option to disable building SPVRemapper. 2018-07-07 16:54:34 -05:00
John Kessenich
64315a8aed
Merge pull request #1434 from antiagainst/fix-spirv-tools-header
Use public SPIRV-Tools header
2018-07-06 13:18:32 -06:00
Karl Schultz
23770b9aae build: Add ccache option to CMake config
This is totally optional, but lets people build this repo with
ccache to improve rebuild speeds.  It also can help a great deal
on ccache-enabled CI systems like Travis-CI.  We build fixed
revisions of glslang a lot on Travis, so this will be a big help
with CI machine loading.
2018-07-06 12:12:09 -06:00
Arseny Kapoulkine
112e2858cf SPIRV: Simplify matrix->matrix constructor
When constructing a matrix from another matrix with smaller dimensions,
there's no need to extract the scalars out of columns and rebuild the
resulting matrix from scalars - instead, we can just construct shorter
vectors with OpShuffle and combine them to the final result.

This keeps the common casts such as mat3(mat4) in vector registers,
which may improve performance for some GPUs, and cleans up output of
translation tools like SPIRV-Cross.

Fixes #1412.
2018-07-05 15:55:12 -07:00
Lei Zhang
a2c39a2947 Use public SPIRV-Tools header 2018-07-04 14:53:45 -04:00
John Kessenich
cd57b4ba0f
Merge pull request #1431 from KhronosGroup/implement-8-16-bit-storage
Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage …
2018-07-03 14:21:07 -06:00
John Kessenich
312dcfb070 Implement GL_EXT_shader_16bit_storage and GL_EXT_shader_8bit_storage extensions.
These introduce limited support for 8/16-bit types such that they can only be accessed in buffer memory and converted to/from 32-bit types.

Contributed from Khronos-internal work.
2018-07-03 13:51:31 -06:00
John Kessenich
eefab240f7 Bump revision. 2018-07-03 09:34:43 -06:00