Commit Graph

116 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
100e9d34b8 HLSL: Basic support for separate image/samplers. 2017-05-06 12:39:04 +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
543e380d90 Fix case where samplerBuffer is emitted without combined sampler. 2017-04-02 11:03:07 +02:00
Yuriy O'Donnell
ae8de51138 Added a Compiler ctor that takes IR as raw array and count
This avoids the need to construct a temporary std::vector on the application side just to create a Compiler instance if application itself doesn't use STL containers.
2017-04-01 14:35:42 +02: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
fd432f8580 Ensure struct members have valid identifiers. 2017-03-23 09:47:43 +01:00
Hans-Kristian Arntzen
299e19fb61 Do not crash on unknown extensions. 2017-03-21 16:33:54 +01:00
Hans-Kristian Arntzen
61c31c6054 Make use of explicit locations in HLSL. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
2ebe1a87a1 Run format_all.sh. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
bdea1a444a Begin rewriting how HLSL deals with inputs and outputs. 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
Hans-Kristian Arntzen
75391f9a68 Handle vector variants of OpLogicalAnd/Or/Not. 2017-03-20 22:45:40 +01:00
Bill Hollings
dc69427402 Updates to MSL functionality to support PR review feedback. 2017-03-11 12:17:22 -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
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
24df8f0019 Run format_all.sh. 2017-02-04 10:26:26 +01:00
Syoyo Fujita
29179f746a Fix build when SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=On. 2017-02-03 13:54:35 +09: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
Hans-Kristian Arntzen
18c37bcdab Update license headers for 2017. 2017-01-28 09:00:40 +01:00
Hans-Kristian Arntzen
1850457b28 Merge pull request #107 from Kode/hlsl
HLSL Support
2017-01-28 08:53:24 +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
Robert Konrad
429b8cb25f Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross into hlsl
# Conflicts:
#	spirv_glsl.hpp
2017-01-23 14:44:41 +01:00
Robert Konrad
451bdeeeff Fix HLSL binding numbers 2017-01-23 14:40:25 +01:00
Hans-Kristian Arntzen
8a80e62fb4 Make get_buffer_block_flags clearer.
Fix empty struct case.
2017-01-22 08:51:24 +01:00
Hans-Kristian Arntzen
9540979c55 Support int and uint as flattened UBO types. 2017-01-21 12:29:20 +01:00
Hans-Kristian Arntzen
d3cad99347 Cleanups for flattened access chains. 2017-01-21 11:30:33 +01:00
Hans-Kristian Arntzen
016b1d86e9 Emit readonly, writeonly for SSBOs. 2017-01-21 10:08:27 +01:00
Arseny Kapoulkine
f63e7c5c98 Fix get_declared_struct_member_size for struct members
When a member of a struct is a struct, get_declared_struct_member_size
instead returned the size of the entire outer struct because it added
the offset of the last field to the size of the last field.

Restructure the function so that it handles all arrays in the same way
(by using array stride) and for the rest reuses get_declared_struct_size
if possible - this simplifies the function and fixes the issue.
2017-01-17 01:52:12 -08:00
Polona Caserman
3e0f52d44c Remove redundant function 2017-01-16 17:35:13 +01:00
Robert Konrad
9802823deb Re-add accidentally removed break 2017-01-15 22:42:22 +01:00
Robert Konrad
881725fb36 Remove video code I accidentally put in 2017-01-15 16:48:01 +01:00
Robert Konrad
a778c363e1 Format code 2017-01-15 16:39:03 +01:00
Robert Konrad
fe5de5e03c Merge branch 'original' into metalcat 2017-01-15 16:33:14 +01:00
Polona Caserman
84c3092aba Merge with KhronosGroup/SPIRV-Cross 2017-01-15 16:21:15 +01:00
Polona Caserman
989563ad3f Add uniform structure 2017-01-15 16:05:11 +01:00
Polona Caserman
bafde4e917 Check if the location of the original variable is set 2017-01-15 16:05:11 +01:00
Hans-Kristian Arntzen
ce3fe29557 MSVC maintenance. 2017-01-12 10:57:44 +01:00
Endre Oma
6ad8b307a1 Use the classic locale when converting floats to string 2017-01-11 17:06:06 +01:00
Hans-Kristian Arntzen
c7659507e8 Merge pull request #90 from gwihlidal/master
Improve useability of get_decoration and friends.
2017-01-05 23:07:40 +01:00
Graham Wihlidal
9b1ee8f10a Improve fix for boolean decorations queried in get_decoration, added support to get_member_decoration, and updated comments to reflect the change in behavior. 2017-01-05 21:01:49 +01:00
Graham Wihlidal
acd98ac0d5 Fix typo in comment 2017-01-05 21:00:05 +01:00
Graham Wihlidal
862a71b4d3 Fix Compiler::get_decoration to correctly return > 0 if DecorationNonWritable or DecorationNonReadable are specified. 2017-01-05 20:19:59 +01:00
Graham Wihlidal
fadc1f9e10 Fix for "error C4146: unary minus operator applied to unsigned type, result still unsigned" 2017-01-05 20:14:53 +01:00
Hans-Kristian Arntzen
97f7ab865a Fix handling of NoWrite/NoRead decoration for images.
The old workaround for glslang is no longer needed, so only apply workaround
carefully.
2017-01-05 18:16:33 +01: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
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
a714d424d0 Add directed test for for-loop-init. 2016-12-16 12:43:12 +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