Commit Graph

134 Commits

Author SHA1 Message Date
Bill Hollings
7703b746f7 CompilerMSL vectorless constructor uses vectorless attribute and resource bindings. 2017-04-04 16:38:17 -04:00
Hans-Kristian Arntzen
9bad477f16 Add vector-less IR construction to subclasses as well. 2017-04-01 16:08:19 +02:00
Robert Konrad
ec39647d92 Check for legal lod id
And avoid passing superfluous has_lod parameter.
2017-03-24 09:26:02 +01:00
Robert Konrad
3f74503aca Prefer plain texture2D in legacy es vertex shaders
WebGL supports lod texture funcs only in fragment
shaders but SPIR-V supports only lod texture funcs
in vertex shaders. This reverts calls which were
forced (infered from using a 0 constant) to use
an lod to plain calls in vertex shaders when
using legacy es.
2017-03-23 10:11:45 +01:00
Hans-Kristian Arntzen
61c31c6054 Make use of explicit locations in HLSL. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
099f307123 Add traversal for active builtin variables.
Refactor some ugly type-copying for access chains.
2017-03-21 13:48:28 +01:00
Bill Hollings
5ad73f33f5 MSL fixes from review of PR 134.
Remove unnecessary use of std:: prefix in spirv_msl.cpp.
Use typedef instead of #define.
spirv-cross deprecate --metal CLI option and replace with --msl option.
2017-03-19 21:06:21 -04:00
Bill Hollings
5550c87b1f CompilerMSL options access and UBO alignment test case.
CompilerMSL accesses options using same design pattern as CompilerGLSL and CompilerHLSL.
CompilerMSL support setting VA & rez binding specs via either constructor or compile() method overload.
CompilerMSL support single UBO packing and padding in single pass.
spriv_cross app (main.cpp) supports turning off UBO packing and padding via command line option.
Add MSL UBO alignment test shader.
2017-03-12 17:42:51 -04:00
Bill Hollings
dc69427402 Updates to MSL functionality to support PR review feedback. 2017-03-11 12:17:22 -05:00
Bill Hollings
a3546ebb54 spirv_msl only add padding structure members if required by member alignment. 2017-03-06 11:00:23 -05:00
Bill Hollings
5cb3ce96a7 spirv_msl pack MSL uniform struct members only when size warrants. 2017-03-02 17:57:26 -08:00
Bill Hollings
b332bae3c3 spirv_msl unpack packed MSL uniform struct members.
spirv_glsl add member_is_packed_type() and unpack_expression_type() functions.
2017-03-01 13:07:40 -05:00
Bill Hollings
484931d8b2 spirv_msl auto-alignment of members of MSL uniform structs.
spirv_msl optionally add padding and packing to allow MSL
struct members to align with SPIR-V struct alignments.
spirv_cross add convenience methods for testing Decorations.
spirv_glsl replace member_decl() function with new emit_stuct_member().
Allow struct member types to be marked as packed via DecorationCPacked decoration.
2017-02-28 21:44:36 -05:00
Bill Hollings
92f12d1d29 CompilerMSL avoid including hidden variables as entry point function arguments. 2017-02-25 23:19:52 -05:00
Hans-Kristian Arntzen
eb5e09fa64 Run format_all.sh. 2017-02-23 19:33:14 +01:00
Hans-Kristian Arntzen
3c58bbbcbe Flatten varying structs outputs in legacy targets. 2017-02-22 20:17:58 +01:00
Bill Hollings
6159a61c95 CompilerMSL add support for texel buffers.
Compiler MSL support DimBuffer as image dimension.
CompilerMSL check texture coordinate result type dimension before adding swizzles.
Update MSL reference shaders affected by this update.
2017-02-09 12:14:30 -05:00
Hans-Kristian Arntzen
5dd7c04195 Merge branch 'master' of git://github.com/brenwill/SPIRV-Cross into pr-109 2017-02-05 10:59:44 +01:00
Hans-Kristian Arntzen
9cb8616c31 Do not use write/read counters for "global" parameters.
Fixes device const & SSBO issues.
2017-02-05 10:50:14 +01:00
Hans-Kristian Arntzen
4ca769b546 Merge branch 'msl_global-invocation-id' of git://github.com/Kangz/SPIRV-Cross into pr-105 2017-02-05 10:14:38 +01:00
Bill Hollings
e4f0dde68f CompilerMSL uses std::set where order matters for consistent regression testing. 2017-01-31 11:02:44 -05:00
Bill Hollings
81757507be CompilerMSL support separate indexed MTLBuffers for stage_in containing matrices.
Add DecorationBinding to Compiler::get_member_decoration()/set_member_decoration().
2017-01-29 13:28:20 -05:00
Bill Hollings
05be822512 Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-01-28 12:54:49 -05:00
Hans-Kristian Arntzen
d0cc4fe3ad Fix Wshadow warning. 2017-01-28 08:58:25 +01:00
Bill Hollings
804d5313fa Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-01-27 16:12:37 -08:00
Corentin Wallez
d8278a8e3b msl: Add support for gl_LocalInvocationID and gl_LocalInvocationIndex 2017-01-26 20:22:31 -05:00
Corentin Wallez
789eb432e5 msl: Handle writable SSBO in function arguments 2017-01-26 19:44:33 -05:00
Corentin Wallez
6d653aa934 spirv_msl: Add support for gl_GlobalInvocationId 2017-01-26 19:43:44 -05:00
Polona Caserman
a9fb150faa Improved loop 2017-01-26 20:05:43 +01:00
Robert Konrad
bbc1e0c0cc Format code 2017-01-26 10:20:42 +01:00
Robert Konrad
4846e081a7 Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross into metalcat
# Conflicts:
#	spirv_msl.cpp
2017-01-26 10:19:26 +01:00
Bill Hollings
948a24a049 Update spirv_msl copyright dates. 2017-01-25 19:33:32 -08:00
Polona Caserman
3289043729 Remove hard-coded case 2017-01-23 13:02:16 +01:00
Polona Caserman
945494d211 Pass main function name in MSLConfiguration 2017-01-23 13:02:01 +01:00
Polona Caserman
91ccd21fc9 Manage variable names in an unordered map 2017-01-23 13:01:44 +01:00
Polona Caserman
1c63357577 Remove old code 2017-01-23 13:01:05 +01:00
Polona Caserman
b631003230 Replace ib_type.self with ib_type_id 2017-01-23 13:00:43 +01:00
Polona Caserman
92c36e75df Fix: check if location mask is set 2017-01-23 12:56:11 +01:00
Bill Hollings
ef1f860c01 CompilerMSL support OpImageFetch and Metal read() function.
Don't emit automatic sampler when using texture read().
Convert tex coords to uintN() when using texture read().
Emit face when read()ing cube textures.
2017-01-20 17:30:36 -05:00
Bill Hollings
2d0d328f61 Run style formatter. 2017-01-20 11:33:59 -05:00
Bill Hollings
339881468c Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-01-20 11:27:05 -05:00
Bill Hollings
4c198bbce9 Remove emission of function prototypes in MSL.
Do not emit function prototypes. If secondary functions are used,
suppress compiler -Wmissing-prototypes warnings.
Refactor Compiler::emit_function_prototype() functions to simplify.
Rename Compiler_msl::CustomFunctionHandler to OpCodePreprocessor, and
Compiler_msl::register_custom_functions() to preprocess_op_codes()
to perform more generic preprocessing.
Add space between dynamic header lines and fixed header lines.
2017-01-20 11:24:44 -05:00
Hans-Kristian Arntzen
7b9036f402 Fix small oversight in last PR. 2017-01-20 12:06:05 +01:00
Corentin Wallez
b61235ae9f spirv_msl: Put writable SSBOs in the 'device' address space 2017-01-19 10:37:15 -05:00
Polona Caserman
b63b8a9996 Dont add a prefix to every function name 2017-01-18 14:52:55 +01:00
Polona Caserman
62ac1c873b Remove struct if it has no members 2017-01-18 14:50:35 +01:00
Polona Caserman
330b366c53 Format code 2017-01-16 17:37:20 +01:00
Polona Caserman
20de679813 Dont iterate over global_variables. Ids are already in global_var_ids 2017-01-16 17:36:31 +01:00
Polona Caserman
f47305c74d Move vector into the class member 2017-01-16 17:35:48 +01:00
Polona Caserman
5d7e126d52 Remove redundant function call 2017-01-16 17:35:14 +01:00