Commit Graph

475 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
c8e2269a78 Merge pull request #87 from brenwill/master
MSL enhancements
2016-12-22 11:22:16 +01:00
Bill Hollings
7d38f1822a CompilerMSL fixes to support pull-request feedback.
Make Compiler::OpcodeHandler and Compiler::traverse_all_reachable_opcodes protected
instead of private, for use by subclasses.
Add CompilerMSL::CustomFunctionHandler and traverse_all_reachable_opcodes() to detect
active opcodes that require the output of a custom function.
CompilerMSL::custom_function_ops use std::set to retain ordering to improve testability.
2016-12-21 16:31:13 -05:00
Bill Hollings
b1b68db835 Resolve conflict with upstream pull. 2016-12-21 11:43:32 -05: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
Bill Hollings
1a5dc0edcd CompilerMSL support emitting custom functions for SPIR-V ops.
CompilerMSL use custom mod() function instead of Metal's fmod() function.
2016-12-18 21:42:10 -05:00
Bill Hollings
32ae2eceed CompilerMSL enhancements to handling of in/out variables.
CompilerMSL sort in/out attributes by attribute number (location). Sort inputs in reverse order.
CompilerMSL propagate incoming vertex attribute offset values.
CompilerMSL elide unused in/out variables.
CompilerMSL replace use of sets with unordered_sets.
2016-12-18 18:48:15 -05:00
Bill Hollings
09c1e10d43 Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2016-12-17 17:15:14 -05:00
Bill Hollings
e73e8e4f48 Add support for the BuiltInClipDistance builtin for MSL.
CompilerGLSL builtin_to_glsl() function outputs gl_ClipDistance for BuiltInClipDistance
builtin, and includes builtin code in output when handling unknown builtin code.
CompilerMSL uses type ID instead of type object where appropriate to support array types,
where type.self is not consistent with actual type ID, plus support array stride calc
even when not explicitly set by SPIR-V code.
For output consistency, CompilerMSL prefers use of standard builtin names over specified
names, and output builtins qualified with output struct while in entry function.
2016-12-17 17:07:53 -05:00
Hans-Kristian Arntzen
2f48065ec1 Merge pull request #86 from KhronosGroup/for-loop-fix
Fix for loops for legacy ESSL.
2016-12-16 14:14:19 +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
45c797d54c Improve debuggability of Travis CI when things go wrong. 2016-12-16 13:48:30 +01:00
Hans-Kristian Arntzen
d11b8aa3ef Optimize += 1, -= 1 to ++, --.
Purely cosmetic, but easier to read.
2016-12-16 13:24:49 +01:00
Hans-Kristian Arntzen
62613df5a5 Optimize for read-modify-writes.
Required for legacy loop increments.
2016-12-16 13:14:22 +01:00
Hans-Kristian Arntzen
a714d424d0 Add directed test for for-loop-init. 2016-12-16 12:43:12 +01:00
Panagiotis Christopoulos Charitos
7f69f9395e Rework after review 2016-12-15 20:46:10 +01:00
Hans-Kristian Arntzen
51d45511a6 Check if we can use multiple initializers.
Need same type and qualifiers in GLSL and friends.
2016-12-15 17:54:49 +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
fcc962057a Merge pull request #84 from brenwill/master
Support row-major matrices in access chain when not natively supporte…
2016-12-15 09:51:46 +01:00
Bill Hollings
1358362075 Fixes to non-native row-major matrix support.
Add support for OpLoad. Throw exception for non-square non-native row-major matrix.
Update variable and function names to clarify purposes.
2016-12-14 02:12:52 -05:00
Bill Hollings
343677e639 Support row-major matrices in access chain when not natively supported by backend (MSL). 2016-12-11 11:01:08 -05:00
Hans-Kristian Arntzen
875c32fd39 Use correct link for Travis CI build status. 2016-12-08 22:33:40 +01:00
Hans-Kristian Arntzen
0a065ff594 Add Travis CI build result to README. 2016-12-08 22:31:27 +01:00
Hans-Kristian Arntzen
b8cdb69220 Merge pull request #83 from zeux/travis-ci
Add Travis build
2016-12-08 21:36:32 +01:00
Arseny Kapoulkine
0f22399821 Travis: Checkout a specific glslang version
This will help avoid test output mismatches due to glslang changes
2016-12-08 02:34:10 -08:00
Arseny Kapoulkine
4a05dcaeca Add Travis build
Builds on both Linux and OSX and tests all shaders for regressions. The
shader set currently does not include any Metal shaders but once it does
we should be able to also validate the resulting MSL using Xcode metal
compiler.
2016-12-08 02:26:36 -08:00
Hans-Kristian Arntzen
14977efc8c Merge pull request #81 from KhronosGroup/defer-parens
Defer parenthesis generation until needed.
2016-12-08 09:05:59 +01:00
Hans-Kristian Arntzen
b8b202f489 Add more dedicated test shader for defer-parens. 2016-12-08 09:05:30 +01:00
Hans-Kristian Arntzen
03a26e593d Fixes for MSL and strip redundant parens in some places. 2016-12-06 23:03:35 +01:00
Hans-Kristian Arntzen
ea781e602c Fix code generated from optimized OpCompositeExtract. 2016-12-06 17:19:34 +01:00
Hans-Kristian Arntzen
e67f6f85a4 Defer parenthesis generation until needed.
Previously, we would generate parentheses proactively when generating
binary ops, however, this leads to uglier code and hits warnings in
compilers when used as a conditional.
2016-12-05 10:56:54 +01:00
Hans-Kristian Arntzen
cc207e32c8 Merge pull request #80 from brenwill/master
MSL sort interface struct members by offset instead of location.
2016-12-05 09:08:55 +01:00
Bill Hollings
72df15061d CompilerMSL do not clear used_by_shader flag of
contextual vertex attributes and resource bindings.
2016-12-04 21:57:29 -05:00
Bill Hollings
aca1b55449 MSL sort interface struct members by offset instead of location.
MSL support OpFMod as fmod() function.
Remove SPIRType::is_packed member.
2016-12-04 12:32:58 -05:00
Hans-Kristian Arntzen
b9600aa8d3 Only dump block size for blocks which have a physical size.
I/O variables can also be blocks, but they have no physical size.
2016-11-29 09:07:51 +01:00
Hans-Kristian Arntzen
740fce8ebd Merge pull request #77 from KhronosGroup/nested-struct-fix
Fix get_declared_struct_size for nested arrays of structs.
2016-11-28 15:39:15 +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
d14a29f893 Merge pull request #76 from brenwill/master
CompilerMSL fix cast error & add minor feature to CompilerGLSL
2016-11-28 14:35:16 +01:00
Bill Hollings
c2e6013f4b CompilerMSL supports promoting unnamed global vars to function args.
CompilerMSL use correct MSL type name for 3D textures.
2016-11-27 15:00:06 -05:00
Bill Hollings
c5c073699e CompilerMSL fix func_call_arg() cast error when not passed SPIRVariable type.
CompilerGLSL allow retrieval of partial source if an error occurs.
2016-11-27 12:34:04 -05:00
Hans-Kristian Arntzen
9075262787 Use -D__STDC_LIMIT_MACROS.
Avoids random #ifndef.
2016-11-25 23:40:28 +01:00
rob
70ea5a6469 Updated Android build 2016-11-25 13:22:11 +09:00
Hans-Kristian Arntzen
43020e2f74 Merge pull request #73 from luboslenco/master
Legacy GL_ARB_shader_texture_lod support.
2016-11-22 08:19:39 +01:00
Lubos Lenco
0028b4f278 Legacy GL_ARB_shader_texture_lod support. 2016-11-21 22:37:20 +01:00
Hans-Kristian Arntzen
7630d3cc9c MSVC maintenance.
Fix compilation and warnings.
2016-11-21 12:18:45 +01:00
Hans-Kristian Arntzen
810fa633d0 Merge pull request #71 from KhronosGroup/cfg-analysis
WIP: Add control flow graph analysis for variable scoping
2016-11-21 09:11:54 +01:00
Hans-Kristian Arntzen
69761cc80f Merge pull request #72 from cdwfs/python3
Fixed python3 detection for spirv-cross-test.
2016-11-19 11:37:23 +01:00
Cort
ffb6613482 Fixed python3 detection for spirv-cross-test.
Windows Python 3.x installations do not include a python3.exe; this
caused the old test to fail and issue a spurious warning.
2016-11-18 14:02:48 -08:00
Hans-Kristian Arntzen
b847c88559 Cleanup, and make cfg analysis optional. 2016-11-18 17:06:49 +01:00
Hans-Kristian Arntzen
5ff11cc689 Handle more corner cases with the CFG traversal. 2016-11-18 16:45:11 +01:00