Commit Graph

84 Commits

Author SHA1 Message Date
Robert Konrad
881725fb36 Remove video code I accidentally put in 2017-01-15 16:48:01 +01:00
Robert Konrad
a778c363e1 Format code 2017-01-15 16:39:03 +01:00
Robert Konrad
fe5de5e03c Merge branch 'original' into metalcat 2017-01-15 16:33:14 +01:00
Polona Caserman
84c3092aba Merge with KhronosGroup/SPIRV-Cross 2017-01-15 16:21:15 +01:00
Polona Caserman
989563ad3f Add uniform structure 2017-01-15 16:05:11 +01:00
Polona Caserman
bafde4e917 Check if the location of the original variable is set 2017-01-15 16:05:11 +01:00
Hans-Kristian Arntzen
ce3fe29557 MSVC maintenance. 2017-01-12 10:57:44 +01:00
Endre Oma
6ad8b307a1 Use the classic locale when converting floats to string 2017-01-11 17:06:06 +01:00
Hans-Kristian Arntzen
c7659507e8 Merge pull request #90 from gwihlidal/master
Improve useability of get_decoration and friends.
2017-01-05 23:07:40 +01:00
Graham Wihlidal
9b1ee8f10a Improve fix for boolean decorations queried in get_decoration, added support to get_member_decoration, and updated comments to reflect the change in behavior. 2017-01-05 21:01:49 +01:00
Graham Wihlidal
acd98ac0d5 Fix typo in comment 2017-01-05 21:00:05 +01:00
Graham Wihlidal
862a71b4d3 Fix Compiler::get_decoration to correctly return > 0 if DecorationNonWritable or DecorationNonReadable are specified. 2017-01-05 20:19:59 +01:00
Graham Wihlidal
fadc1f9e10 Fix for "error C4146: unary minus operator applied to unsigned type, result still unsigned" 2017-01-05 20:14:53 +01:00
Hans-Kristian Arntzen
97f7ab865a Fix handling of NoWrite/NoRead decoration for images.
The old workaround for glslang is no longer needed, so only apply workaround
carefully.
2017-01-05 18:16:33 +01:00
Hans-Kristian Arntzen
9ccd1aea42 Merge pull request #85 from godlikepanos/master
Add the option to build without exceptions
2016-12-19 12:32:04 +01:00
Hans-Kristian Arntzen
44b3216611 Sort loop variables to make sure Travis CI runs are reproducable. 2016-12-16 14:01:09 +01:00
Hans-Kristian Arntzen
a714d424d0 Add directed test for for-loop-init. 2016-12-16 12:43:12 +01:00
Panagiotis Christopoulos Charitos
946f7796c1 Add an option to disable exceptions
Some refactoring in the no-exceptions case

Grooming the no-exceptions patch for pull request
2016-12-15 17:49:01 +01:00
Hans-Kristian Arntzen
4f07a32c29 Begin implementing for loop initializer propagation. 2016-12-15 17:44:47 +01:00
Hans-Kristian Arntzen
2d79d365dc Fix get_declared_struct_size for nested arrays of structs.
The array size was dropped from consideration during recursion.
2016-11-28 15:01:36 +01:00
Hans-Kristian Arntzen
7630d3cc9c MSVC maintenance.
Fix compilation and warnings.
2016-11-21 12:18:45 +01:00
Hans-Kristian Arntzen
5ff11cc689 Handle more corner cases with the CFG traversal. 2016-11-18 16:45:11 +01:00
Hans-Kristian Arntzen
0c9683cd85 Distinguish between cross edges and back edges.
Handle the weird opcodes CopyMemory/CopyObject.
2016-11-18 09:59:54 +01:00
Hans-Kristian Arntzen
edbe867b74 Improve handling of dead blocks.
All tests pass now.
Still need to handle OpFunction, atomics, OpPhi, etc ...
2016-11-17 22:15:07 +01:00
Hans-Kristian Arntzen
dad4a34072 Start adding CFG analysis.
Not complete yet, but partly working ...
2016-11-17 16:58:05 +01:00
Hans-Kristian Arntzen
526d06d0a4 Add more descriptive error message. 2016-11-12 10:04:42 +01:00
Bill Hollings
ac00c6032f Run clang-format. 2016-10-24 09:24:24 -04:00
Bill Hollings
0943d9fece MoltenVK shader converter handle missing names.
Use entry point name if no function name provided.
When flattening in/out structs, qualify member names with struct name.
Fix issue when determining declared size of struct types.
Refactor use of m_ name prefix.
Identify header defines in MSL code.
2016-10-23 21:42:54 -04:00
Nathaniel Brown
9577568d56 Corrects some problems converting to compilable MSL from SPIRV. A better solution is to refactor the glsl compiler base-class so some keywords and actions can be overridden, and then the msl subclass can override them - this is a quick & dirty solution.
- adds some common macros that correct for intrinsic differences
 - adds some inline functions to adapt for GLSL terms
 - injects structure member names when the original SPV has been stripped - there is another way to use the correct temporarily assigned member name, but using m_<id> based on the inside SPV code yields metal code that more correctly maps to the original SPV opcodes/slots.
2016-10-21 13:48:21 -07:00
Bill Hollings
a759e2c872 Merge Brenwill fork with upstream. 2016-10-19 14:09:51 -07:00
Corentin Wallez
ef9ee49276 Fix compilation on some old C++11 standard libraries. 2016-10-05 16:13:51 -04:00
Hans-Kristian Arntzen
5d4bb687bc Support arrays which have spec constant size.
The size of an array can be a specialization constant or a spec constant
op. This complicates things quite a lot.

Reflection becomes very painful in the presence of expressions instead
of literals so add a new array which expresses this.

It is unlikely that we will need to do accurate reflection of interface
types which have specialization constant size.

SSBOs and UBOs will for now throw exception if a dynamic size is used since it
is very difficult to know the real size.
2016-10-03 17:17:11 +02:00
Hans-Kristian Arntzen
7e8afa872b Implement OpSpecConstantOp.
The details here get quite hairy, and it's not complete as not all
functionality is implemented in glslang yet.
2016-10-03 15:54:02 +02:00
Hans-Kristian Arntzen
6bd545bc6b Basic support for specialization constant reflection. 2016-10-03 12:29:46 +02:00
Hans-Kristian Arntzen
378fbe8b92 Consistently use "image" nomenclature for separate images. 2016-09-11 13:48:25 +02:00
Hans-Kristian Arntzen
313cb5f820 Declare shadow arguments. 2016-09-11 12:54:08 +02:00
Hans-Kristian Arntzen
948930b171 Build new IDs for shadow arguments. 2016-09-11 12:36:12 +02:00
Hans-Kristian Arntzen
dfb6597ee4 Begin redirecting separate params to other params. 2016-09-11 12:05:20 +02:00
Hans-Kristian Arntzen
ed98a8ec86 Begin implementing parameter remapping for combined image sampler.
The basic idea here is that all functions will have a list of which
combinations of parameters will be combined inside the function.
The caller will then know which combined samplers must be provided to
the callee in order to satisfy it.
2016-09-11 11:39:20 +02:00
Hans-Kristian Arntzen
901b45e09a Fix remap_parameter.
Need to return after backing variable resolve.
2016-09-10 22:21:57 +02:00
Hans-Kristian Arntzen
dd1513b814 Trace usage of image/sampler variants through calls. 2016-09-10 21:52:22 +02:00
Hans-Kristian Arntzen
14bc1ffed8 Correctly emit variable declarations for combined image samplers.
Only support direct accesses to global variables in this commit.
2016-09-10 18:09:32 +02:00
Hans-Kristian Arntzen
71bacc4469 Basic combined image sampler emulation hooked up. 2016-09-10 17:48:52 +02:00
Hans-Kristian Arntzen
1b5ca8d868 Move combined image hiding logic into is_hidden. 2016-09-10 16:20:19 +02:00
Hans-Kristian Arntzen
bcb5560109 Sketch out interface for combined image samplers. 2016-09-10 13:56:36 +02:00
Hans-Kristian Arntzen
e92020819e Add reflection support for separate textures and samplers. 2016-09-10 13:05:35 +02:00
Bill Hollings
cf476f36d1 Merge MSL with upstream. 2016-08-31 21:00:56 -04:00
Hans-Kristian Arntzen
f61a5d1e5d Implement dead variable elimination. 2016-08-26 12:58:50 +02:00
Hans-Kristian Arntzen
15679c724f Range check Compiler::get_member_decoration. 2016-08-17 11:35:34 +02:00
Robert Konrad
8f7c1af046 Do not try to pump OpLine instructions into a block
When the SPIR-V includes metadata for debugging
(aka OpLine instructions) the CompilerError at
line 1588 was eventually triggered.
2016-08-10 02:43:51 +02:00