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

97 Коммитов

Автор SHA1 Сообщение Дата
Hans-Kristian Arntzen a6e211e00b Support dual-source blending on GLSL and MSL. 2018-04-03 16:04:49 +02:00
Hans-Kristian Arntzen c1947aa447 Update glslang/SPIRV-Tools on Travis. 2018-03-24 04:16:18 +01:00
Hans-Kristian Arntzen 719cf9d42f Run format_all.sh. 2018-03-13 14:05:33 +01:00
Hans-Kristian Arntzen 8e90382675 Properly flatten MRT outputs in MSL. 2018-03-13 14:03:35 +01:00
Hans-Kristian Arntzen 938c7debed Handle control-dependent temporaries.
Derivatives, subgroup and implicit-lod instructions all need to happen
in the block they were created.
2018-03-12 17:34:54 +01:00
Hans-Kristian Arntzen e8e58844d4 Rewrite everything to use Bitset rather than uint64_t. 2018-03-12 13:24:14 +01:00
Hans-Kristian Arntzen 28cccc3dbb Emit complex continue blocks "properly". 2018-03-08 17:59:21 +01:00
Hans-Kristian Arntzen ac0e93f392 Run format_all.sh. 2018-03-07 10:29:20 +01:00
Hans-Kristian Arntzen 47d94ff8d9 Add FP16 to HLSL.
Cannot be used in buffer types, similar to mediump in GLSL.
half is useless, because it's 32-bit in FXC.
2018-03-07 10:21:25 +01:00
Hans-Kristian Arntzen 24dfe496c2 Run format_all.sh. 2018-03-06 17:09:18 +01:00
Hans-Kristian Arntzen 91f85d3412 Begin adding float16_t support to GLSL. 2018-03-06 17:09:18 +01:00
Hans-Kristian Arntzen a04bdcc7f7 Handle overloaded functions which share the same OpName.
Awkward, but legal SPIR-V.
2018-02-23 14:15:51 +01:00
Hans-Kristian Arntzen 047ad7df0f Support special float constants (NaN/Inf). 2018-02-23 13:06:20 +01:00
Hans-Kristian Arntzen 181a5fa492 Fix formatting after merge. 2018-02-05 09:19:16 +01:00
twinaphex e3f4041dd5 Fixes MSVC 2013 compilation 2018-02-05 09:17:44 +01:00
Bill Hollings 1c94715350 Update copyright dates to 2018 in main files. 2018-01-31 17:08:43 -05:00
Vadim Shcherbakov 6c41f9e9da MSL improvements:
- pack/unpack nested constant buffer structs
- support for write-only textures (only global ones for now)
- better rt index support for msl generator
2017-12-06 09:52:07 -08:00
Lou Kramer 6671f52334 Add support for new extensions. 2017-11-22 19:05:38 +01:00
Bill Hollings bac657d873 Fixes from review of PR 321. 2017-11-07 15:38:13 -05: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 551424ce43 Support loading col/row-major matrices from ByteAddressBuffer. 2017-10-26 16:35:18 +02:00
Hans-Kristian Arntzen afc2c0c8e6 Rename nested Image struct type.
Reuses an enum name as a struct type, creates friction for API wrappers.
2017-10-24 10:25:38 +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
Hans-Kristian Arntzen 86eb874568 Implement specialization constants for work group sizes. 2017-09-28 11:33:30 +02:00
Hans-Kristian Arntzen ceefae5584 Support mixed constant composites. 2017-09-27 16:10:29 +02:00
Hans-Kristian Arntzen 5e1d6fb3ce Refactor constant construction. 2017-09-27 15:16:33 +02:00
Hans-Kristian Arntzen d9cbc03c9f Ensure that exceptions are logged. 2017-09-08 09:35:13 +02:00
Hans-Kristian Arntzen 713bd7c2b5 Run format_all.sh. 2017-08-28 09:01:03 +02:00
Hans-Kristian Arntzen 7d7f4b3b50 Emit flattened loads and stores. 2017-08-15 09:15:23 +02:00
Hans-Kristian Arntzen 3cbdbec712 Begin implementing ByteAddressBuffer flattening for HLSL. 2017-08-15 09:15:23 +02:00
Hans-Kristian Arntzen 48ccde3779 Support OpConstantNull. 2017-08-03 14:32:29 +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 0aac31bda1 Remove remnants of old OpCompositeInsert hack. 2017-06-26 22:58:41 +02: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 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
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 ec45c9efb3 Add interface for reflecting "magic" HLSL counter buffers. 2017-05-09 09:21:54 +02:00
Hans-Kristian Arntzen e897d154ac Cleanups. 2017-05-07 13:39:15 +02:00
Hans-Kristian Arntzen f4d7268565 GLSL will also need shadow state analysis.
Refactor stuff out to top-level.

Fix some bugs with combined shadow samplers in regular GLSL.
2017-05-06 13:21:35 +02:00
Hans-Kristian Arntzen 100e9d34b8 HLSL: Basic support for separate image/samplers. 2017-05-06 12:39:04 +02:00
Hans-Kristian Arntzen 173dc9e8c9 Build fix. 2017-04-26 09:25:28 +02:00
Hans-Kristian Arntzen 93fe19c0f7 Add support for querying binary offsets of decorations in SPIR-V.
Facilitates easy SPIR-V patching when needed.
2017-04-26 09:24:24 +02:00
Hans-Kristian Arntzen c609eab443 Fix includes. 2017-03-25 16:43:26 +01:00
Hans-Kristian Arntzen bf5c07532c Run format_all.sh. 2017-03-25 16:28:44 +01:00
Hans-Kristian Arntzen b2c2e6483b Analyze parameter preservation for functions.
This is kinda tricky, because if we only conditionally write to a
function parameter variable it is implicitly preserved in SPIR-V, so we must force
an in qualifier on the parameter to get the same behavior in GLSL.
2017-03-25 16:25:30 +01:00
Hans-Kristian Arntzen 299e19fb61 Do not crash on unknown extensions. 2017-03-21 16:33:54 +01:00