Commit Graph

23 Commits

Author SHA1 Message Date
Rob Fischer
691072894f Reset MSL sequential resource binding EACH pass 2016-09-17 18:30:58 +09:00
Rob Fischer
e2a37b6301 Emit header_lines for MSL also 2016-09-17 12:21:37 +09:00
Rob Fischer
3e45786fbc Correct vector's size begin checked
This caused a null pointer being used when called with p_vtx_attrs = nullptr and p_res_bindings != nullptr
2016-09-16 09:14:22 +09:00
Hans-Kristian Arntzen
f61a5d1e5d Implement dead variable elimination. 2016-08-26 12:58:50 +02: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
d5dc5f3f1c Fix issue with new glslang behavior for samplers as parameters.
Check case where storage class uniform is passed as function parameter.
2016-07-05 13:21:26 +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
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
2436f4cb5c CompilerMSL DimBuffer image type uses 2D MTLTexture. 2016-04-29 15:04:17 +02:00
Bill Hollings
762947e3dd CompilerMSL move Private global variables to entry-point function variables.
CompilerMSL add support for texture read() without sampler for OpImageFetch.
2016-04-27 19:54:33 +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
1dbd18daaf Add pixel type qualifier to MSL image type names.
Add MSL support for half-precision base formats (short, ushort, half).
2016-04-21 20:47:57 -04:00
Bill Hollings
fa46c14a78 Clean up commented uniform code and replace with TODO statement. 2016-04-11 17:34:26 -04:00
Bill Hollings
257b10eef4 Fix MSL reference to instruction stream modified in subclass update. 2016-04-11 14:16:12 -04:00
Bill Hollings
78b6877368 MSL outputs vertex input struct even when vertex attribute configuration input is missing. 2016-04-11 13:28:43 -04:00
Bill Hollings
b2e313ef3e Support 3 compilation loops for MSL. 2016-04-11 12:23:31 -04:00
Bill Hollings
f9e5fb38b8 Fix compiler warnings. 2016-04-11 10:19:20 -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
8f30f07eb5 Clarify CompileMSL config parameters and move to compile() function.
CompileMSL supports marking vertex attributes and resource bindings
as to whether they are used by the shader, and feeding back to caller.
2016-04-07 21:25:51 -04:00
Bill Hollings
103aabf5e8 Initial support for Metal Shading Language. 2016-04-06 17:42:27 -04:00