Commit Graph

76 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
ac81a0ce68 Use declared binding in SPIR-V as a fallback for explicit MSL binds. 2018-04-04 12:25:11 +02:00
Hans-Kristian Arntzen
e7bf8d2f48 Refactor out noopt shaders to their own folders.
Makes maintenance easier with less clutter.
2018-03-13 10:39:49 +01:00
Hans-Kristian Arntzen
9fbd8b789e Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
Hans-Kristian Arntzen
e3b8e9455c Add test shader where a phi variable invalidates a temporary.
The temporary in question is used to flush a phi variable.
2018-03-09 14:42:26 +01:00
Hans-Kristian Arntzen
e0efa737ca Expand the implementation of inherit_expression_dependencies. 2018-03-09 13:21:38 +01:00
Hans-Kristian Arntzen
5fe79eb59c Update tests.
Adds an earlier reported shader packing failure into regression suite.
2018-03-05 16:34:42 +01:00
Hans-Kristian Arntzen
a04bdcc7f7 Handle overloaded functions which share the same OpName.
Awkward, but legal SPIR-V.
2018-02-23 14:15:51 +01:00
Hans-Kristian Arntzen
8a3bef2bd6 Add OpFRem tests. 2018-02-15 13:36:59 +01:00
Hans-Kristian Arntzen
c9db3e5521 Overload on constant storage. 2018-02-08 17:58:46 +01:00
Hans-Kristian Arntzen
b2c9487b0f Attempt to deduce constant/thread storage. 2018-02-08 17:07:50 +01:00
Hans-Kristian Arntzen
1a9c960058 MSL cannot declare inline arrays except in certain cases. 2018-02-08 13:06:29 +01:00
Arseny Kapoulkine
5cbed7a69f Update test files 2018-01-29 06:40:45 -08: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
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
168bcc7b3b Add unreachable tests for MSL/HLSL. 2018-01-15 09:39:15 +01: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
Bill Hollings
c93d44ba3c For MSL, use {} instead of constructors to init OpUndef values. 2017-11-30 15:03:27 -05:00
Hans-Kristian Arntzen
3440263d60 Update MSL tests. 2017-11-23 09:50:11 +01:00
Bill Hollings
e83e2b2217 CompilerMSL support and tests for OpUndef. 2017-11-15 22:44:42 -05:00
Bill Hollings
ba865733eb Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-11-05 22:49:08 -05:00
Bill Hollings
1c18078811 Enhancements to MSL compute and entry point naming.
Support Workgroup (threadgroup) variables.
Mark if SPIRConstant is used as an array length, since it cannot be specialized.
Resolve specialized array length constants.
Support passing an array to MSL function.
Support emitting GLSL array assignments in MSL via an array copy function.
Support for memory and control barriers.
Struct packing enhancements, including packing nested structs.
Enhancements to replacing illegal MSL variable and function names.
Add Compiler::get_entry_point_name_map() function to retrieve entry point renamings.
Remove CompilerGLSL::clean_func_name() as obsolete.
Fixes to types in bitcast MSL functions.
Add Variant::get_id() member function.
Add CompilerMSL::Options::msl_version option.
Add numerous MSL compute tests.
2017-11-05 21:34:42 -05:00
Hans-Kristian Arntzen
8538b4c9c0 Handle empty struct declarations with best effort.
This "feature" is a bit icky as we have no useful representation of it,
so never emit code which has anything to do with empty structs.
2017-10-06 13:05:14 +02:00
Hans-Kristian Arntzen
067f241bf8 Runtime arrays do not work yet in MSL, so don't try to test that yet. 2017-10-02 09:24:16 +02:00
Hans-Kristian Arntzen
ecaea50739 Add SPVASM test from clspv. 2017-09-29 12:20:57 +02:00
Hans-Kristian Arntzen
db5d49f04a Add SPVASM testing support for HLSL/MSL. 2017-09-29 11:07:11 +02:00