Hans-Kristian Arntzen
6714a9fa23
Need to sort declared temporaries to ensure stable output.
2018-01-29 10:24:15 +01:00
Hans-Kristian Arntzen
66a407285e
Merge pull request #411 from billhollings/master
...
Fix for #382
2018-01-25 09:13:43 +01:00
Bill Hollings
e43f244399
Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross
2018-01-24 17:34:50 -05:00
Bill Hollings
fe3683eefa
CompilerMSL declare threadgroup variables accessed in called functions.
2018-01-24 15:38:17 -05:00
Hans-Kristian Arntzen
95de8f0269
Merge pull request #394 from KhronosGroup/fix-374
...
Handle exponential explosion of code-gen during first phase of compile and fix CFG dominator checks.
2018-01-24 21:05:09 +01:00
Hans-Kristian Arntzen
b3f6e3de8e
Fix CFG::update_common_dominator.
...
The algorithm was too conservative causing lots of unnecessary
temporaries to be created.
2018-01-24 20:32:11 +01:00
Hans-Kristian Arntzen
09f550f718
Handle exponential explosion of code-gen during first phase of compile.
...
Certain patterns with OpVectorShuffle (and probably others) will cascade
to so large, that they can cause OOM. After we have observed
force_recompile, don't spend unnecessary memory emitting code which will
never be used.
2018-01-24 18:12:41 +01:00
Hans-Kristian Arntzen
3fc2561734
Merge pull request #408 from KhronosGroup/fix-407
...
Check if a loop variable candidate is actually used.
2018-01-24 15:28:33 +01:00
Hans-Kristian Arntzen
af0a887997
Add test for false loop init.
...
Clean up how for loop variables are declared.
2018-01-23 21:15:09 +01:00
Hans-Kristian Arntzen
4a7a37256e
Check if a loop variable candidate is actually used.
...
Phi nodes used in continue blocks are not always loop variables.
Fix by checking if path from dominator to loop header has some variable
use.
2018-01-23 20:27:43 +01:00
Hans-Kristian Arntzen
56acf9728a
Merge pull request #406 from KhronosGroup/fix-405
...
Fix HLSL regression with struct declaration.
2018-01-23 16:54:13 +01:00
Hans-Kristian Arntzen
0220207e3f
Merge pull request #404 from KhronosGroup/fix-403
...
Do not merge swizzles for anything other than vectors.
2018-01-23 16:53:40 +01:00
Hans-Kristian Arntzen
06041985d0
Fix HLSL regression with struct declaration.
...
It actually worked surprisingly. Fix it properly.
2018-01-23 16:36:20 +01:00
Hans-Kristian Arntzen
d0ce948df4
Do not merge swizzles for anything other than vectors.
2018-01-22 09:52:57 +01:00
Hans-Kristian Arntzen
921c555cf3
Merge pull request #402 from KhronosGroup/fix-400
...
Fix CFG for forwarded temporaries.
2018-01-21 14:04:56 +01:00
Hans-Kristian Arntzen
7d223b8987
Fix CFG for forwarded temporaries.
...
Forwarded temporaries would never declare a temporary.
Figure out all result types ahead of time so we can deal with those
temporaries as well.
2018-01-18 12:11:33 +01:00
Hans-Kristian Arntzen
3c0f539590
Merge pull request #399 from KhronosGroup/cfg-fixes
...
Specialize CFG traversal for some opcodes which use literals.
2018-01-17 10:10:25 +01:00
Hans-Kristian Arntzen
377c6db480
Merge pull request #398 from KhronosGroup/fix-396
...
Do not use inline for-loop initializers with different types.
2018-01-17 10:10:01 +01:00
Hans-Kristian Arntzen
34cbe91d12
Merge pull request #395 from KhronosGroup/cfg-analysis-opt-remove
...
Remove cfg_analysis option.
2018-01-16 13:05:42 +01:00
Hans-Kristian Arntzen
150b18733f
Specialize CFG traversal for some opcodes which use literals.
2018-01-16 10:43:04 +01:00
Hans-Kristian Arntzen
b902d5400c
Do not use inline for-loop initializers with different types.
2018-01-16 10:27:58 +01:00
Hans-Kristian Arntzen
779ad0412f
Merge pull request #393 from KhronosGroup/fix-391
...
Handle OpUnreachable in code-gen.
2018-01-16 09:46:34 +01:00
Hans-Kristian Arntzen
bfe6f50b8e
Remove cfg_analysis option.
...
Not using this is broken, and won't work anymore.
2018-01-15 13:21:01 +01:00
Hans-Kristian Arntzen
168bcc7b3b
Add unreachable tests for MSL/HLSL.
2018-01-15 09:39:15 +01:00
Hans-Kristian Arntzen
0f4adaa09d
Handle OpUnreachable in code-gen.
...
Forgot to add it to emit_block_chain. It should just be a noop.
2018-01-15 09:35:09 +01:00
Hans-Kristian Arntzen
17f9026248
Merge pull request #392 from billhollings/master
...
Use initializer list for composite initializations
2018-01-15 09:12:13 +01:00
Hans-Kristian Arntzen
0360aef2be
Merge pull request #389 from KhronosGroup/fix-384
...
Analyze the CFG for temporaries as well.
2018-01-15 09:11:54 +01:00
Bill Hollings
ba1e415a9c
Use initializer list for composite initializations if backend.use_initializer_list is on.
2018-01-12 17:19:24 -05:00
Hans-Kristian Arntzen
d4e470babd
Analyze the CFG for temporaries as well.
...
Normally, temporary declaration must dominate any use of it,
so we generally did not need to analyze the CFG for these variables,
but there is an edge case where you have an inliner doing:
do {
create_temporary;
break;
} while(0);
use_temporary;
The inside of the loop dominates the outer scope, but we cannot emit
code like this in GLSL, so make sure we hoist these temporaries outside
the "loop".
2018-01-12 10:56:11 +01:00
Hans-Kristian Arntzen
bcaa1f0e3c
Merge pull request #386 from KhronosGroup/fix-383
...
Fix naive barrier handling in GLSL and HLSL and various other fixes
2018-01-09 15:27:21 +01:00
Hans-Kristian Arntzen
39e7ddea94
Disable mem_texture checks on MSL.
...
Doesn't seem to work on Travis even though spec says it should, oh well
:)
2018-01-09 14:09:29 +01:00
Hans-Kristian Arntzen
fbc47395b2
Update Travis glslang version.
2018-01-09 12:59:20 +01:00
Hans-Kristian Arntzen
cfe568f237
Add exhaustive barrier tests for MSL.
...
Seems incorrect, need to be fixed later.
2018-01-09 12:55:46 +01:00
Hans-Kristian Arntzen
44a4eb7562
Formatting.
2018-01-09 12:51:21 +01:00
Hans-Kristian Arntzen
9c3d4e7c60
Rewrite barrier handling in HLSL.
2018-01-09 12:41:13 +01:00
Hans-Kristian Arntzen
27ad8c0922
Add more exhaustive test for barrier handling.
2018-01-09 12:26:46 +01:00
Hans-Kristian Arntzen
166eed8c18
Add test shaders for barriers.
2018-01-09 12:19:31 +01:00
Hans-Kristian Arntzen
7bb8874b43
Optimize away redundant barriers.
2018-01-09 12:17:38 +01:00
Hans-Kristian Arntzen
9c72aa00c9
Overhaul barrier handling in GLSL.
2018-01-09 12:07:07 +01:00
Hans-Kristian Arntzen
23f0abf112
Update tests for struct flattening.
2018-01-09 10:40:34 +01:00
Hans-Kristian Arntzen
18f60ed9a9
Update glslang.
...
Not SPIRV-Tools yet, mis-optimizes many shaders which used to work fine.
2018-01-09 10:37:12 +01:00
Hans-Kristian Arntzen
1a5a755ce5
Flatten structs based on instance name rather than block name.
...
Block name is too brittle, optimizes will merge block types, making
flattening impossible with unique names.
2018-01-09 10:36:04 +01:00
Hans-Kristian Arntzen
f708b497a4
Opt in to gl_in/gl_out handling rather than other way around.
2018-01-09 09:16:33 +01:00
Hans-Kristian Arntzen
c7aac59188
Merge pull request #385 from billhollings/master
...
Revert to not forcing gl_in/gl_out block for MSL.
2018-01-09 09:07:30 +01:00
Bill Hollings
27d4af75a0
Revert to not forcing gl_in/gl_out block for MSL, and add MSL gl_ClipDistance tests.
2018-01-08 16:18:34 -05:00
Hans-Kristian Arntzen
513ba86fc8
Merge pull request #373 from billhollings/master
...
CompilerMSL enhancements PLUS refactoring of MSL tests to avoid optimization crashes
2018-01-08 09:04:03 +01:00
Bill Hollings
6371d9e43a
CompilerMSL emit no-warning pragma when emitting spvConvertFromRowMajorCxR functions.
2018-01-06 00:51:25 -05:00
Bill Hollings
5ee6b46087
Fixes from review of PR #373 .
...
Code fixes from review.
Refactor MSL tests back to using the SPIRV-Tools
and glslang loaded by checkout_glslang_spirv_tools.sh.
2018-01-05 23:22:36 -05:00
Bill Hollings
d8d2da9d8d
CompilerMSL allow swizzle of packed_float3 vectors by unpacking to float3.
...
Pass packed indicator back through OpAccessChain and OpLoad.
Unpack packed vector before applying swizzle.
Add packed swizzle test.
2018-01-05 17:46:56 -05:00
Bill Hollings
3a7e8a1035
CompilerMSL fix bad cast error on result type derivation.
2018-01-04 21:13:38 -05:00