Commit Graph

1982 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
fc37c52d26 Fix typo with array stride error message.
Trivial copy-paste bug.
2019-04-02 19:18:13 +02:00
Hans-Kristian Arntzen
5c239b857b
Merge pull request #921 from KhronosGroup/fix-902
Add an option to override the namespace used for spirv_cross.
2019-03-29 11:29:48 +01:00
Hans-Kristian Arntzen
9b92e68d71 Add an option to override the namespace used for spirv_cross.
This is a pragmatic trick to avoid symbol collision where a project
links against SPIRV-Cross statically, while linking to other projects
which also use SPIRV-Cross statically. We can end up with very awkward
symbol collisions which can resolve themselves silently because
SPIRV-Cross is pulled in as necessary. To fix this, we must use
different symbols and embed two copies of SPIRV-Cross in this scenario,
now with different namespaces, which in turn leads to different symbols.
2019-03-29 10:29:44 +01:00
Hans-Kristian Arntzen
3fa09f5677 HLSL: Fix up int16_t_literal_suffix. 2019-03-29 09:44:32 +01:00
Hans-Kristian Arntzen
9e8fc8caa9 Merge git://github.com/billhollings/SPIRV-Cross 2019-03-29 09:42:00 +01:00
Bill Hollings
c48702d8c2 Fix crash when backend.int16_t_literal_suffix set to null.
The design of backend.int16_t_literal_suffix and backend.uint16_t_literal_suffix
allows them to be set to null, but that was not always tested for.
I have removed the expectation that they can be null and set
backend.int16_t_literal_suffix to "" when no suffix is needed.
That has the same effect, and seemed to be a more usable and defensive approach.
2019-03-28 14:23:32 -04:00
Hans-Kristian Arntzen
18d4f67a87
Merge pull request #919 from KhronosGroup/fix-915
MSL: Declare gl_WorkGroupSize constant with [[maybe_unused]].
2019-03-28 14:00:49 +01:00
Hans-Kristian Arntzen
61cde3c3d0
Merge pull request #918 from KhronosGroup/fix-916
MSL: Fix crash where variable storage buffer pointers are passed down.
2019-03-28 13:54:20 +01:00
Hans-Kristian Arntzen
0909975655 MSL: Declare gl_WorkGroupSize constant with [[maybe_unused]].
Avoids ugly warnings on nearly every compute shader.
We could do analysis to detect whether we need to emit this constant,
but it's a bit tedious to figure out if an OpConstantComponent is
actually used by opcodes, so just make it simple.
2019-03-28 10:54:18 +01:00
Hans-Kristian Arntzen
c37f88fea6 MSL: Fix crash where variable storage buffer pointers are passed down.
Only deal with readonly decoration for actual block types.
2019-03-28 10:16:46 +01:00
Hans-Kristian Arntzen
ef4aa46be7
Merge pull request #914 from KhronosGroup/fix-909
Make build system more modular.
2019-03-27 14:18:12 +01:00
Hans-Kristian Arntzen
6648ccc9e5
Merge pull request #913 from KhronosGroup/fix-908
Properly deal with sign-dependent GLSL opcodes.
2019-03-27 14:18:01 +01:00
Hans-Kristian Arntzen
6b69fe65f8 Make build system more modular.
Allow user to disable individual backends.
Disallow this for CLI builds for now, but should be useful for
library-only builds, and particularly for C API.
2019-03-27 13:21:11 +01:00
Hans-Kristian Arntzen
eeb3f24991 Properly deal with sign-dependent GLSL opcodes.
The GLSLstd450 spec is very lax about input signs, so we need to do the
bitcasting dance to implement it correctly.
2019-03-27 12:20:53 +01:00
Hans-Kristian Arntzen
b64e4564ba
Merge pull request #912 from KhronosGroup/fix-910
Parser: Fix OpCompositeConstruct with OpUndef.
2019-03-27 12:20:41 +01:00
Hans-Kristian Arntzen
df3e21a762 Parser: Fix OpCompositeConstruct with OpUndef.
Just treat any undefined argument as 0. It is risky to use the undefined
variable as it might not lower to a true constant.
2019-03-27 10:51:23 +01:00
Hans-Kristian Arntzen
88ce958a51 Add ray-tracing reflection to main.cpp and C API. 2019-03-27 10:21:30 +01:00
Hans-Kristian Arntzen
689a7deb3e Make ray-tracing files .nocompat. 2019-03-27 10:04:42 +01:00
Hans-Kristian Arntzen
82e23e4221 Merge branch 'SPV_NV_ray_tracing' of git://github.com/pmoursnv/SPIRV-Cross 2019-03-27 09:58:23 +01:00
Patrick Mours
0f72199b8f Add generated reference shaders again 2019-03-26 15:21:12 +01:00
Patrick Mours
b2a667520d Add reflection support for ray tracing acceleration structures 2019-03-26 15:09:42 +01:00
Patrick Mours
524bd43deb Add reflection support for ray tracing exection models 2019-03-26 14:46:51 +01:00
Patrick Mours
9910cdbf0c Remove reference shaders again 2019-03-26 14:27:42 +01:00
Patrick Mours
90c91e4f23 Fix missing check for purity on ray tracing builtins 2019-03-26 14:25:25 +01:00
Patrick Mours
c96bab0659 Replace usage of "require_extension" with "require_extension_internal" and "to_func_call_arg" with "to_expression" 2019-03-26 14:04:39 +01:00
Patrick Mours
dfa2a0abf9 Add generated reference shaders
See commit aa1c72bc51
2019-03-25 15:16:08 +01:00
Patrick Mours
aa1c72bc51 Add ray tracing test shaders
Slightly modified from https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#_sample_code_2
2019-03-25 15:07:51 +01:00
Patrick Mours
c74d7a412c Add "GL_NV_ray_tracing" extension to output when ray tracing execution model is found 2019-03-25 15:06:01 +01:00
Patrick Mours
b2651d01e5 Merge branch master into SPV_NV_ray_tracing 2019-03-25 14:09:15 +01:00
Hans-Kristian Arntzen
736703fe3b
Merge pull request #903 from KhronosGroup/fix-901
Support -1 index in OpVectorShuffle.
2019-03-25 10:50:25 +01:00
Hans-Kristian Arntzen
8eb33c8017 Support -1 index in OpVectorShuffle.
-1 (0xffffffff) literal means the component should be undefined.
Since we cannot express undefined directly, just use a 0 literal in the
appropriate type.
2019-03-25 10:17:05 +01:00
Hans-Kristian Arntzen
9dbb25783f
Merge pull request #900 from KhronosGroup/fix-899
GLSL/HLSL: Implement NMin/NMax/NClamp.
2019-03-21 17:17:28 +01:00
Hans-Kristian Arntzen
2a0365c813 GLSL/HLSL: Implement NMin/NMax/NClamp.
Need to emulate these calls for correctness.
2019-03-21 15:26:46 +01:00
Hans-Kristian Arntzen
5dacfa9dc2
Merge pull request #898 from KhronosGroup/fix-897
GLSL: Fix some complex cases for loading arrays
2019-03-21 13:52:00 +01:00
Hans-Kristian Arntzen
0b20180537 GLSL: Deal with array loads from input in tessellation.
We have an edge case where the array is declared with a concrete size,
but in GLSL we must emit an unsized array, which breaks array copies.
Deal explicitly with this.
2019-03-21 11:50:53 +01:00
Hans-Kristian Arntzen
d2961b30db GLSL: Unroll loads from builtin pos/point arrays.
Odd-ball case for certain geometry shaders coming from HLSL.
2019-03-21 11:25:41 +01:00
Hans-Kristian Arntzen
1b00a6e48a
Merge pull request #896 from KhronosGroup/fix-895
Move check for structured OpSwitch to CompilerGLSL.
2019-03-20 12:12:00 +01:00
Hans-Kristian Arntzen
45baf24a17 Move check for structured OpSwitch to CompilerGLSL.
Can still parse correctly.
2019-03-20 10:42:38 +01:00
Hans-Kristian Arntzen
a94490498d
Merge pull request #894 from KhronosGroup/fix-882
GLSL: Support emitting push constant block as a plain UBO.
2019-03-19 11:56:24 +01:00
Hans-Kristian Arntzen
1389aa34e4 GLSL: Check target version for push constant location = N. 2019-03-19 11:20:53 +01:00
Hans-Kristian Arntzen
0474848d4a GLSL: Support emitting push constant block as a plain UBO. 2019-03-19 10:58:52 +01:00
Hans-Kristian Arntzen
66f32eca72
Merge pull request #893 from KhronosGroup/fix-891
Fix build on Android API < 26.
2019-03-18 10:15:20 +01:00
Hans-Kristian Arntzen
7310274a4f Fix build on Android API < 26. 2019-03-18 10:14:04 +01:00
Hans-Kristian Arntzen
f1d10089fa
Merge pull request #892 from fjhenigman/roll
Update to latest glslang/SPIRV-Tools.
2019-03-18 09:59:21 +01:00
Frank Henigman
b393fa5c85 Update to latest glslang/SPIRV-Tools. 2019-03-17 23:38:34 -04:00
Hans-Kristian Arntzen
62dce70c2e
Merge pull request #890 from KhronosGroup/msl-argument-buffers
MSL: Add support for Metal 2 indirect argument buffers.
2019-03-16 10:31:54 +01:00
Hans-Kristian Arntzen
d8e4d995e5 Remove strange include which got included for some reason. 2019-03-15 21:55:53 +01:00
Hans-Kristian Arntzen
e2aadf8995 Rename "push descriptor set" to "discrete descriptor set".
Check for case where iOS doesn't support writable argument buffer
textures.
2019-03-15 21:53:21 +01:00
Hans-Kristian Arntzen
b3380ec9dd MSL: Support VK_KHR_push_descriptor.
If we have argument buffers, we also need to support using plain
descriptor sets for certain cases where API wants it.
2019-03-15 14:08:47 +01:00
Hans-Kristian Arntzen
a5f072d2ab MSL: Add some comments about how we remap bindings for IAB. 2019-03-15 13:07:59 +01:00