Граф коммитов

178 Коммитов

Автор SHA1 Сообщение Дата
Hans-Kristian Arntzen ce18d4ce74 Run format_all.sh. 2017-11-17 13:38:29 +01:00
Bill Hollings e83e2b2217 CompilerMSL support and tests for OpUndef. 2017-11-15 22:44:42 -05:00
Hans-Kristian Arntzen 4427cb993d Add support for renaming entry points. 2017-11-13 13:50:37 +01:00
Hans-Kristian Arntzen f486142e36 Run format_all.sh. 2017-11-13 09:52:35 +01:00
Hans-Kristian Arntzen 997be5cb23 Build/warning fix on modern GCC. 2017-11-13 09:26:19 +01:00
Bill Hollings 696bf0db0f Fixes from review #2 of PR 321. 2017-11-08 13:54:28 -05:00
Bill Hollings 6ea0dd95ea spriv_msl.hpp add explicit include of <limits>. 2017-11-07 15:53:20 -05:00
Bill Hollings bac657d873 Fixes from review of PR 321. 2017-11-07 15:38:13 -05:00
Bill Hollings 42e718b77d Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-11-06 09:06:46 -05:00
Hans-Kristian Arntzen ca69b614e5 Fix some warnings on older GCC. 2017-11-06 09:49:52 +01:00
Bill Hollings ba865733eb Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-11-05 22:49:08 -05:00
Bill Hollings 1c18078811 Enhancements to MSL compute and entry point naming.
Support Workgroup (threadgroup) variables.
Mark if SPIRConstant is used as an array length, since it cannot be specialized.
Resolve specialized array length constants.
Support passing an array to MSL function.
Support emitting GLSL array assignments in MSL via an array copy function.
Support for memory and control barriers.
Struct packing enhancements, including packing nested structs.
Enhancements to replacing illegal MSL variable and function names.
Add Compiler::get_entry_point_name_map() function to retrieve entry point renamings.
Remove CompilerGLSL::clean_func_name() as obsolete.
Fixes to types in bitcast MSL functions.
Add Variant::get_id() member function.
Add CompilerMSL::Options::msl_version option.
Add numerous MSL compute tests.
2017-11-05 21:34:42 -05:00
Hans-Kristian Arntzen 1079e7930b Run format_all.sh. 2017-10-10 10:22:40 +02:00
Bill Hollings 39c865ed0d Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-10-03 10:03:16 -04:00
Hans-Kristian Arntzen aab3107a3f Add WorkGroupID/NumWorkGroups to MSL. Fix block name alias. 2017-09-29 12:16:53 +02:00
Hans-Kristian Arntzen 98b91e52f4 Run format_all.sh. 2017-09-29 10:52:04 +02:00
Hans-Kristian Arntzen 84f8c9935b Declare work group size constants in HLSL and MSL.
Technically not needed, but it does make compute code easier to read
compared to magical constants being used for work group size.
2017-09-29 10:15:33 +02:00
Hans-Kristian Arntzen 153fed031d Add basic support for StorageClassStorageBuffer.
Needs more testing, but seems to work.
2017-09-28 13:29:57 +02:00
Bill Hollings 86a9a40e69 CompilerMSL fix detection of input struct assignments. 2017-09-03 22:55:54 -04:00
Bill Hollings 1e84a379ff Fix issue #245: assignment of flattened input struct.
Emit input struct assignment by assigning member by member from stage_in struct.
Map qualified member name from pointer type, not base type.
Add Comiler::expression_type_id() function, similar to expression_type().
2017-08-12 00:21:13 -04:00
Bill Hollings 77f5812c55 Fix issue #239: compilation of shaders-msl/frag/texture-proj-shadow.frag.
Remove unsupported sampler1DShadow from shaders-msl/frag/texture-proj-shadow.frag.
Improve error message response from unsupported depth texture formats.
Fix several integer cast warnings in unrelated code.
Run ./format_all.sh on unrelated files.
2017-08-11 14:54:58 -04:00
Hans-Kristian Arntzen 6cda7f120b Merge pull request #246 from KhronosGroup/fix-241
Unify vertex clip-coord fixups.
2017-08-11 12:42:10 +02:00
Bill Hollings 730257cf67 Merge upstream 2017-08-10 17:27:01 -04:00
Hans-Kristian Arntzen bdfa97a1cf Unify vertex clip-coord fixups.
The different options were scattered around in different backends and
didn't really work right with CLI at all.
2017-08-03 13:02:59 +02:00
Hans-Kristian Arntzen 2abdc135c3 Declare undefined values up front.
They might potentially be used as part of OpStore in the SPIRV-Tools
inliner in some cases.

Implement these as declared variables but without any initializer.
2017-08-02 10:33:03 +02:00
Hans-Kristian Arntzen c8d60914c4 Add support for SampleId/SampleMask/SamplePosition builtins. 2017-07-24 10:07:31 +02:00
Bill Hollings f591bc0d4a CompilerMSL enhancements.
Support BuiltInFragDepth.
Emit interface block for StorageClassUniformConstant.
Throw exception when output or fragment input structs contain matrix or array.
Dynamically created interface structs sorted by location number instead of alphabetically.
Add Compiler::is_array() function.
2017-06-30 19:10:46 -04:00
Hans-Kristian Arntzen a1f5453519 Assign block locations to members in MSL. 2017-06-21 09:55:46 +02:00
Hans-Kristian Arntzen 3c404c456a Fix fallthrough warning. 2017-06-17 09:38:07 +02:00
Bill Hollings 1f83856366 CompilerMSL add support for MSL specialization function constants.
CompilerMSL add emit_custom_functions() function.
CompilerMSL restrict use of as_type<> cast to necessary conditions.
CompilerMSL refactor get_declared_struct_member_size() and
get_declared_struct_member_alignment() functions, and remove
unnecessary get_declared_type_size() functions.
Add test shaders-msl/vulkan/frag/spec-constant.vk.frag.
2017-06-15 15:24:22 -04:00
Bill Hollings 6f3381a5d3 Fixes from review of PR #190. 2017-06-01 16:29:39 -04:00
Bill Hollings b41e1482c8 Support emitting SPIR-V type declarations tuned for specified SPIR-V objects.
CompilerGLSL type_to_glsl() and image_type_glsl() functions support optional object ID.
Add SPIRType::Image::access member to support SPIR-V OpTypeImage access qualifier.
Remove SPIRType::Image::is_read and ::is_written members.
Use DecorationNonReadable and DecorationNonWritable to mark read/write access for image variables.
CompilerMSL emit access qualifiers per image variable, instead of per image type.
CompilerGLSL and CompilerHLSL behaviour is unchanged.
2017-05-29 20:45:05 -04:00
Bill Hollings 192bdc9516 CompilerMSL elide unused builtins from entry function input and output structs.
Add Compiler::has_active_builtin() function.
Update test reference shaders that included unused builtins.
2017-05-24 09:31:38 -04:00
Bill Hollings d77de7ab80 CompilerMSL add support for MSL qualifiers on gl_ClipDistance and other array-based builtins. 2017-05-23 13:24:41 -04:00
Bill Hollings 0f97ffd8be Fix merge conflicts with upstream master, plus fixes from review of PR #186. 2017-05-23 10:44:10 -04:00
Hans-Kristian Arntzen 8d43908e66 Fix ternary statement. 2017-05-23 10:15:22 +02:00
Hans-Kristian Arntzen 91379fb0d0 Implement more sophisticated check for point_size. 2017-05-23 10:15:22 +02:00
Bill Hollings a71c547b30 CompilerMSL remove pad_and_pack_uniform_structs option from both API and CLI tool. 2017-05-22 16:38:38 -04:00
Bill Hollings 542e8c37ad Edits resulting from review of PR #186. 2017-05-22 13:38:23 -04:00
Bill Hollings d677e63860 Merge with upstream 2017-05-19 19:36:24 -04:00
Bill Hollings 8f6df770ce CompilerMSL map many GLSL functions to MSL functions.
Add bool members is_read and is_written to SPIRType::Image.
Output correct texture read/write access by marking whether textures
are read from and written to by the shader.
Override bitcast_glsl_op() to use Metal as_type<type> functions.
Add implementations of SPIR-V functions inverse(), degrees() & radians().
Map inverseSqrt() to rsqrt().
Map roundEven() to rint().
GLSL functions imageSize() and textureSize() map to equivalent
expression using MSL get_width() & get_height() functions.
Map several SPIR-V integer bitfield functions to MSL equivalents.
Map SPIR-V atomic functions to MSL equivalents.
Map texture packing and unpacking functions to MSL equivalents.
Refactor existing, and add new, image query functions.
Reorganize header lines into includes and pragmas.
Simplify type_to_glsl() logic.
Add MSL test case vert/functions.vert for added function implementations.
Add MSL test case comp/atomic.comp for added function implementations.
test_shaders.py use macOS compilation for MSL shader compilation validations.
2017-05-19 18:14:08 -04:00
Hans-Kristian Arntzen f081fe1125 Fix separate sampler images in MSL. 2017-05-07 12:36:14 +02:00
Bill Hollings 561dc036f2 CompilerMSL round floating point tex coords for read() and tex array index. 2017-04-25 16:32:16 -04:00
Bill Hollings 012cb25b7d CompilerMSL remove option to flip fragment coordinates. 2017-04-25 11:25:50 -04:00
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