Commit Graph

226 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
4d4e6d7a41 Document variable type remap interface a bit more.
Fix some minor missing pieces from C++.
Type remapping like this doesn't seem to fit MSL backend so well, as it
does a lot of remapping internally on its own.

Type name remapping, really is for fringe extension cases in GLSL which
aren't yet supported in SPIR-V.
2016-09-20 10:55:09 +02:00
Panagiotis Christopoulos Charitos
66e76d903f Add support of variable type remapping 2016-09-20 10:26:07 +02:00
Hans-Kristian Arntzen
394521b287 Workaround compiler crash in VS 2013. 2016-09-19 13:17:04 +02:00
Hans-Kristian Arntzen
378fbe8b92 Consistently use "image" nomenclature for separate images. 2016-09-11 13:48:25 +02:00
Hans-Kristian Arntzen
948930b171 Build new IDs for shadow arguments. 2016-09-11 12:36:12 +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
Bill Hollings
0dfeabc6d2 Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2016-08-01 15:38:57 -04:00
Hans-Kristian Arntzen
042475e88e Add support for multiple entry points.
- Only consider I/O variables if part of OpEntryPoint.
- Keep a safe fallback if #entry-points is 1 to avoid potentially
  breaking previously working shaders.
2016-07-28 13:18:55 +02:00
Hans-Kristian Arntzen
fc2230ffff Add support for int64/uint64 in GLSL. 2016-07-27 11:31:58 +02:00
Hans-Kristian Arntzen
fa0255c43b Add support for FP64 in GLSL. 2016-07-27 11:31:54 +02:00
Bill Hollings
7c255dde4d Merged with upstream 2016-07-24 22:40:20 -07:00
Hans-Kristian Arntzen
36a0b63f28 Fix various corner cases with expression dependencies.
There was a potential problem if variables were invalidated and SPIR-V
read expressions which depended on other expression which in turn depended on the
invalidated variable.

Also fixes issue where variables were considered immutable if they were
forwardable. This allowed some incorrect optimizations to slip through.
2016-07-12 14:50:23 +02:00
Bill Hollings
c45e74f1c0 MSL support global input vars as automatic function args.
Add Decoration qualified_alias element.
Virualize Compiler to_name() function.
MSL use qualified_alias instead of alias when inside entry-point function.
2016-07-08 12:39:22 -04:00
Hans-Kristian Arntzen
078eec5894 Add support for generic remapping of variables. 2016-07-06 11:04:06 +02:00
Hans-Kristian Arntzen
5f629276a7 Use Boolean instead of Bool.
Xlib.h header uses a very ugly define for Bool which conflicts with
SPIRV-Cross.

The hassle free solution is to use Boolean instead.
2016-06-05 20:13:45 +02:00
Hans-Kristian Arntzen
5ea59bd11b Non-functional: Update formatting. 2016-05-23 13:30:02 +02:00
Hans-Kristian Arntzen
6aa2007cba Deal better with OpName and OpMemberName which alias.
OpName is only for debug information, so we must be very careful that
we do not reuse the same name for different variables.

This was previously done for local variables, but this commit extends
this to global variables as well.
2016-05-23 13:19:41 +02:00
Hans-Kristian Arntzen
f05373bdd1 Do not rely on OpName when finding OpTypeStruct aliases.
SPIR-V can stamp out multiple variants of the same types to deal with
different offsets, layouts, array strides and so on in buffer blocks.
2016-05-23 10:57:22 +02:00
Hans-Kristian Arntzen
4b8ed53974 Add Clang format.
Reformats the entire codebase. Better to do it now than later.

Adds .clang-format and a convenience script format_all.sh which formats
everything automatically.
2016-05-05 09:40:58 +02:00
Hans-Kristian Arntzen
926916d745 Add -Wshadow.
Fixes lots of dubious variable shadowing.
2016-05-05 09:15:25 +02:00
Bill Hollings
2b1e6a8706 Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2016-05-04 12:02:45 -04:00
Hans-Kristian Arntzen
12cfbb221f Add support for querying DecorationInputAttachmentIndex.
Was missing from OpDecoration handling.
2016-05-04 13:41:04 +02:00
Bill Hollings
5aafb28cc7 Track sampler ID in Meta for OpSampledImage objects.
Add virtual CompilerGLSL emit_sampled_image_op function for OpSampledImage.
Under MSL, set sampler ID for local OpSampledImage objects and extract it when emitting sampler.
2016-04-23 21:47:41 -04:00
Bill Hollings
6ddd80e3fe Fixes from code review of MSL functionality.
Rename MSLOptions to MSLConfiguration.
Convert tabs to spaces.
Replace Builtin with uint32_t as map key.
2016-04-08 15:12:40 -04:00
Bill Hollings
103aabf5e8 Initial support for Metal Shading Language. 2016-04-06 17:42:27 -04:00
Hans-Kristian Arntzen
147e53aeb2 Rename project to SPIRV-Cross.
Rename to coincide with moving the project to KhronosGroup.
2016-04-04 15:42:30 +02:00