Commit Graph

2229 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
4d6a223cbe
Merge pull request #1175 from KhronosGroup/fix-1164
Implement unordered compare on GLSL/HLSL.
2019-10-14 19:01:00 +02:00
Hans-Kristian Arntzen
4acfcb3822
Merge pull request #1174 from KhronosGroup/fix-1170
MSL: Add opt-in support for huge IABs.
2019-10-14 19:00:41 +02:00
Hans-Kristian Arntzen
4bb673a626 MSL: Add opt-in support for huge IABs.
If there are enough members in an IAB, we cannot use the constant
address space as MSL compiler complains about there being too many
members. Support emitting the device address space instead.
2019-10-14 16:20:34 +02:00
Hans-Kristian Arntzen
a9be92569f HLSL: Fix unrolled S/G LE/LT/GE/GT opcodes.
Need to bitcast the unrolled expressions as well.
2019-10-14 16:08:39 +02:00
Hans-Kristian Arntzen
3bf9fa7ed6 GLSL: Deal correctly with bitwidth on integer compares. 2019-10-14 15:23:38 +02:00
Hans-Kristian Arntzen
b960ae3b70 HLSL: Partially implement Unordered compare.
We cannot correctly implement unordered equal/ordered not equal without
a lot of extra instructions which slows normal code down.
2019-10-14 15:15:03 +02:00
Hans-Kristian Arntzen
14a4b087fb GLSL: Support unordered floating point compare.
There is no direct way to express this, so invert boolean results to
force any NaN -> true. glslang emits Ordered compare instructions
everywhere, and the GLSL spec is not clear on this, so assume this is
fine.
2019-10-14 13:48:22 +02:00
Hans-Kristian Arntzen
7cc84020b3
Merge pull request #1173 from KhronosGroup/fix-1172
MSL: Fix regression with OpCompositeConstruct from std140 float[].
2019-10-11 11:58:14 +02:00
Hans-Kristian Arntzen
07e9501ae1 MSL: Fix regression with OpCompositeConstruct from std140 float[].
Simple fix, just need to use to_unpacked_expression rather than to_expression here to
deal with this.
2019-10-11 11:21:43 +02:00
Hans-Kristian Arntzen
e5d3a6655e
Merge pull request #1169 from zoddicus/updateSPV_VERSION
Update SPV_VERSION from 1.4 to 1.5
2019-10-07 19:47:59 +02:00
Ryan Harrison
2d1e20d8f3 Update SPV_VERSION from 1.4 to 1.5
Missed this when I did the update to tests and such for 1.5.
2019-10-07 13:37:45 -04:00
Hans-Kristian Arntzen
43f7618194
Merge pull request #1168 from KhronosGroup/fix-1167
Do not consider aliased struct types if the master is not a block
2019-10-07 13:41:26 +02:00
Hans-Kristian Arntzen
f59688b5d1 Workaround MSVC issue. 2019-10-07 12:40:21 +02:00
Hans-Kristian Arntzen
a0c13e4ee8 Do not consider aliased struct types if the master is not a block.
It is possible for a shader to declare two plain struct types which
simply share the same OpName without there being an implicit
value/buffer alias relationship.

For to_member_name(), make sure to use the type alias master when
resolving member names. The member name may be different in a type alias
master if the SPIR-V is being intentionally difficult.
2019-10-07 10:52:16 +02:00
Hans-Kristian Arntzen
2d20b1ab93 Run format_all.sh. 2019-10-07 10:29:04 +02:00
Hans-Kristian Arntzen
f5e6a5476f
Merge pull request #1166 from KhronosGroup/workgroup-size-spec-constant-reflect
Merge workgroup size support for JSON reflection
2019-10-04 15:51:44 +02:00
Hans-Kristian Arntzen
309e994224 Do not value compare JSON files for regression purposes.
0 was comparing equal to False. We expect text equality.
2019-10-04 11:04:52 +02:00
Hans-Kristian Arntzen
43e89bd269 Reflect: Deal with workgroup size being specialization constants. 2019-10-04 10:50:50 +02:00
Hans-Kristian Arntzen
1a20737af7 Merge branch 'reflect-workgroup_size' of git://github.com/res2k/SPIRV-Cross 2019-10-04 10:24:59 +02:00
Frank Richter
6bb2cf8bb0 reference: Update to include workgroup_size 2019-10-03 17:06:30 +02:00
Frank Richter
227a004b57 reflection: Write workgroup_size to JSON for compute shaders 2019-10-03 16:36:17 +02:00
Hans-Kristian Arntzen
5431e1da2d
Merge pull request #1161 from KhronosGroup/roll-deps-merge
Merge dependency update
2019-09-19 10:41:43 +02:00
Hans-Kristian Arntzen
02c34fe575 Update SPIR-V headers. 2019-09-19 10:26:04 +02:00
Hans-Kristian Arntzen
3c11254ece MSL: Fix 16-bit integer literals.
There is no suffix, so bitcasts failed.
2019-09-19 10:19:51 +02:00
Hans-Kristian Arntzen
470fd76fd4 Merge branch 'rollDEPS' of git://github.com/zoddicus/SPIRV-Cross 2019-09-19 09:52:17 +02:00
Ryan Harrison
cf1bf1c6ae Update external/ to SPIR-V 1.5
Rolled the hashes used for glslang, SPIRV-Tools, and SPIRV-Headers to
HEAD, which includes the update to 1.5.

Added passing '--amb' to glslang, so I didn't have to explicitly set
bindings in a large number of test shaders that currently don't, and
now glslang considers them invalid.

Marked all shaders that no longer pass spirv-val as .invalid.
2019-09-18 16:04:27 -04:00
Hans-Kristian Arntzen
d821a90091
Merge pull request #1159 from KhronosGroup/fix-1157
CMake: Add option to force -fPIC.
2019-09-18 11:41:11 +02:00
Hans-Kristian Arntzen
467d970704 CMake: Add option to force -fPIC.
Used by projects who might embed SPIRV-Cross as part of a shared
library, but not exported.
2019-09-18 10:00:25 +02:00
Hans-Kristian Arntzen
87a3d4cf44
Merge pull request #1156 from KhronosGroup/fix-1155
Disable -Werror by default in CMake, fix -Wshorten-64-to-32 warnings.
2019-09-17 12:39:13 +02:00
Hans-Kristian Arntzen
c3ff67c3f0 Fix -Wshorten-64-to-32 warnings. 2019-09-17 10:18:38 +02:00
Hans-Kristian Arntzen
f20011733a
Merge pull request #1154 from KhronosGroup/fix-1153
CMake: Add option to skip installation targets.
2019-09-16 11:40:17 +02:00
Hans-Kristian Arntzen
9b9ea1fac6 CMake: Add option to skip installation targets. 2019-09-16 10:21:28 +02:00
Hans-Kristian Arntzen
c13e951634
Merge pull request #1152 from KhronosGroup/fix-1151
Consider discard and demote as impure statements.
2019-09-12 15:12:29 +02:00
Hans-Kristian Arntzen
bfa76ee2ab Consider discard and demote as impure statements.
Fixes cases where discard and demote are called in pure functions and
the function result is not consumed.
2019-09-12 14:21:10 +02:00
Hans-Kristian Arntzen
b32a1b4150
Merge pull request #1150 from wadetb/master
MSL: Fix array copies to/from interpolators
2019-09-08 22:31:43 +02:00
Wade Brainerd
f2a1b4320f MSL: Fix array copies to/from interpolators 2019-09-06 18:23:57 -07:00
Hans-Kristian Arntzen
2082e7e801 Run format_all.sh. 2019-09-06 14:23:16 +02:00
Hans-Kristian Arntzen
ee0ac3b313
Merge pull request #1146 from KhronosGroup/strong-types
Introduce stronger types for the SPIR-V ID in C++ API
2019-09-06 14:22:54 +02:00
Hans-Kristian Arntzen
333980ae91 Refactor into stronger types in public API.
Some fallout where internal functions are using stronger types.
Overkill to move everything over to strong types right now, but perhaps
move over to it slowly over time.
2019-09-06 12:29:47 +02:00
Hans-Kristian Arntzen
5af8a04b6c
Merge pull request #1148 from KhronosGroup/dynamic-offsets
Merge dynamic offset support with some bug-fixes.
2019-09-06 12:25:22 +02:00
Hans-Kristian Arntzen
afa5480210 Add dynamic offsets to C API. 2019-09-06 10:17:31 +02:00
Hans-Kristian Arntzen
1935f1a8e3 Fix some issues on certain compilers. 2019-09-06 10:11:18 +02:00
Hans-Kristian Arntzen
f1e0dd9a5c Merge remote-tracking branch 'cdavis5e/msl-argument-buffer-dynamic-offsets' into dynamic-offsets 2019-09-06 09:54:56 +02:00
Chip Davis
cb35934248 MSL: Support dynamic offsets for buffers in argument buffers.
Vulkan has two types of buffer descriptors,
`VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC` and
`VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC`, which allow the client to
offset the buffers by an amount given when the descriptor set is bound
to a pipeline. Metal provides no direct support for this when the buffer
in question is in an argument buffer, so once again we're on our own.
These offsets cannot be stored or associated in any way with the
argument buffer itself, because they are set at bind time.  Different
pipelines may have different offsets set. Therefore, we must use a
separate buffer, not in any argument buffer, to hold these offsets. Then
the shader must manually offset the buffer pointer.

This change fully supports arrays, including arrays of arrays, even
though Vulkan forbids them. It does not, however, support runtime
arrays. Perhaps later.
2019-09-05 23:29:00 -05:00
Hans-Kristian Arntzen
537bee3cfa
Merge pull request #1144 from cdavis5e/msl-arg-buff-storage-image-ios
MSL: Force storage images on iOS to use discrete descriptors.
2019-09-05 21:33:25 +02:00
Chip Davis
103817009c MSL: Force storage images on iOS to use discrete descriptors.
Writable textures cannot use argument buffers on iOS. They must be
passed as arguments directly to the shader function. Since we won't know
if a given storage image will have the `NonWritable` decoration at the
time we encode the argument buffer, we must therefore pass all storage
images as discrete arguments. Previously, we were throwing an error if
we encountered an argument buffer with a writable texture in it on iOS.
2019-09-05 11:01:05 -05:00
Hans-Kristian Arntzen
a00dbe0db0
Merge pull request #1145 from lifpan/master
Fix ParsedIR::mark_used_as_array_length(uint32_t id)
2019-09-05 10:24:45 +02:00
lifpan
89e7d218c8 Fix ParsedIR::mark_used_as_array_length(uint32_t id) 2019-09-05 06:56:05 +08:00
Hans-Kristian Arntzen
f24654db8c
Merge pull request #1143 from KhronosGroup/interlock
Merge SPV_EXT_fragment_shader_interlock with fixes
2019-09-04 14:43:08 +02:00
Hans-Kristian Arntzen
0286442906 Add test case for interlocks in control flow. 2019-09-04 13:10:32 +02:00