Commit Graph

2036 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
c2715c3908 MSL: Cast texture_buffer index to uint. 2019-04-23 12:46:48 +02:00
Hans-Kristian Arntzen
ae3783c725 Add texture_buffer_native option to C API. 2019-04-23 12:25:42 +02:00
Hans-Kristian Arntzen
de1148b8ba Run format_all.sh. 2019-04-23 12:21:53 +02:00
Hans-Kristian Arntzen
fc4f39b11f MSL: Support native texture_buffer type, throw error on atomics.
Atomics are not supported on images or texture_buffers in MSL.
Properly throw an error if OpImageTexelPointer is used (since it can
only be used for atomic operations anyways).
2019-04-23 12:21:43 +02:00
Hans-Kristian Arntzen
942273dc7b
Merge pull request #940 from mbarriault/master
Use constant address space for SPIR-V parameters when generating tessellation control shader.
2019-04-17 23:15:50 +02:00
Michael Barriault
82b4ad8a30 Correct formatting. 2019-04-16 19:13:57 +01:00
Michael Barriault
105bfd368a Only use MSL constant address space for tessellation control shader. 2019-04-16 17:56:02 +01:00
Michael Barriault
16911c5a4d Merge remote-tracking branch 'origin/master'
* origin/master:
  Support running {,update_}test_shader.sh with CMake builds.
  Don't apply vertex attribute remapping other non-vertex or non-input interface blocks
  Force complex loop in certain rare access chain scenarios.
  Fix guard around [[noreturn]].
  Deal with mismatched signs in S/U/F conversion opcodes.
  Workaround lack of lvalue/rvalue operator overload on MSVC 2013.
  Support direct conversions to std::vector from SmallVector.
  Fix some minor copy constructor issues in Variant.
  Make sure ids_for_types are moved correctly in move operator.
  Run format_all.sh.
  Refactor out error handling and containers to new headers.
  Do not use SmallVector as input type in public interfaces.
  Fix various bugs found in testing.
  Explicitly implement move operators for ParsedIR.
  Try another MSVC 2013 workaround.
  Implement edge cases in insert/end and add a simple test case.
  Fix GCC 4.x warnings.
  Workaround lack of alignas on MSVC 2013.
  Reduce pressure on global allocation.
  CLI: Make --iterations more useful.
2019-04-13 18:06:29 +01:00
Hans-Kristian Arntzen
bbc1fc853e
Merge pull request #949 from KhronosGroup/fix-948
Support running {,update_}test_shader.sh with CMake builds.
2019-04-12 16:27:38 +02:00
Hans-Kristian Arntzen
3a7cb0c2a9 Support running {,update_}test_shader.sh with CMake builds.
Make path to spirv-cross configurable so we can be a bit more flexible
with build systems used to update tests.
2019-04-12 14:56:10 +02:00
Hans-Kristian Arntzen
7a87701ebe
Merge pull request #945 from ashleyharris-maptek-com-au/fixHlslAttributeLeak
Don't apply vertex attribute remapping to other interface blocks
2019-04-12 10:40:32 +02:00
Ashley Harris
cc2d290bfe Don't apply vertex attribute remapping other non-vertex or non-input interface blocks 2019-04-12 13:54:58 +09:30
Michael Barriault
42f219efb8 Remove accidentally committed test patch. 2019-04-11 16:04:46 +01:00
Michael Barriault
d6754c5713 Fix tests for device->constant address space change in MSL tessellation control shader generation. 2019-04-10 18:37:04 +01:00
Hans-Kristian Arntzen
ac5a9570a7
Merge pull request #944 from KhronosGroup/fix-941
Force complex loop in certain rare access chain scenarios.
2019-04-10 18:46:00 +02:00
Hans-Kristian Arntzen
477a39dbb1
Merge pull request #942 from fjhenigman/noreturn
Fix guard around [[noreturn]].
2019-04-10 16:50:20 +02:00
Hans-Kristian Arntzen
e23c9ea700 Force complex loop in certain rare access chain scenarios.
If we generate an access chain in a loop body, and it is consumed in the
loop continue block, we have a problem because we cannot emit a
temporary here holding the access chain reference. Force a complex loop
body to workaround this exceptionally rare case.
2019-04-10 16:02:03 +02:00
Frank Henigman
f07a4e16a6 Fix guard around [[noreturn]].
Clang defines _MSC_VER and supports [[noreturn]].
2019-04-10 09:23:55 -04:00
Hans-Kristian Arntzen
5325210953
Merge pull request #943 from KhronosGroup/fix-939
Deal with mismatched signs in S/U/F conversion opcodes.
2019-04-10 14:11:41 +02:00
Hans-Kristian Arntzen
9ae91c2d1e Deal with mismatched signs in S/U/F conversion opcodes. 2019-04-10 14:03:58 +02:00
Hans-Kristian Arntzen
7bb74c99aa
Merge pull request #922 from KhronosGroup/performance-tweaks
Improve performance by reducing global allocations.
2019-04-10 10:16:11 +02:00
Michael Barriault
ca7df787b3 Use constant address space for SPIR-V parameters when generating tessellation control shader. 2019-04-09 19:41:31 +01:00
Hans-Kristian Arntzen
3c3d4d74f7 Workaround lack of lvalue/rvalue operator overload on MSVC 2013. 2019-04-09 16:20:47 +02:00
Hans-Kristian Arntzen
bbac2e8d8d Support direct conversions to std::vector from SmallVector.
Makes it a bit nicer to consume SmallVector.
2019-04-09 15:47:59 +02:00
Hans-Kristian Arntzen
0262f601c3 Fix some minor copy constructor issues in Variant. 2019-04-09 15:25:11 +02:00
Hans-Kristian Arntzen
9f31a94b10 Make sure ids_for_types are moved correctly in move operator. 2019-04-09 15:16:37 +02:00
Hans-Kristian Arntzen
3fa00f9936 Run format_all.sh. 2019-04-09 15:10:02 +02:00
Hans-Kristian Arntzen
03ddea8eb1 Refactor out error handling and containers to new headers.
spirv_common.hpp got very crowded and it made more sense to split out
concerns to different headers.
2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
3fe57d3798 Do not use SmallVector as input type in public interfaces.
This is an API break, which we need to be careful with.
Handing out SmallVectors is easier since the interface is basically the
same.
2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
02bb986839 Fix various bugs found in testing. 2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
dede9beef4 Explicitly implement move operators for ParsedIR.
Workaround for MSVC 2013.
2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
5b603e0166 Try another MSVC 2013 workaround. 2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
3a57286595 Implement edge cases in insert/end and add a simple test case. 2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
6f8982bf3f Fix GCC 4.x warnings. 2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
b5db60297a Workaround lack of alignas on MSVC 2013. 2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
a489ba7fd1 Reduce pressure on global allocation.
- Replace ostringstream with custom implementation.
  ~30% performance uplift on vector-shuffle-oom test.
  Allocations are measurably reduced in Valgrind.

- Replace std::vector with SmallVector.
  Classic malloc optimization, small vectors are backed by inline data.
  ~ 7-8% gain on vector-shuffle-oom on GCC 8 on Linux.

- Use an object pool for IVariant type.
  We generally allocate a lot of SPIR* objects. We can amortize these
  allocations neatly by pooling them.

- ~15% overall uplift on ./test_shaders.py --iterations 10000 shaders/.
2019-04-09 15:09:44 +02:00
Hans-Kristian Arntzen
c60b9a1e96 CLI: Make --iterations more useful.
Add a basic benchmarking mode to test_shaders.py.
We cannot safely just call compile() in a loop. Do the full pipeline for
each iteration.
2019-04-09 15:09:16 +02:00
Hans-Kristian Arntzen
b2c2f724f4
Merge pull request #938 from KhronosGroup/fix-937
MSL: Fix OpLoad of array which is forced to a temporary.
2019-04-09 15:08:53 +02:00
Hans-Kristian Arntzen
23db744e35 Deal with case where we need to emit SpvImplArrayCopy late.
We cannot deduce if OpLoad needs ArrayCopy templates early since it's
heavily context dependent, and we might only know on 3rd iteration of
the compile loop.
2019-04-09 12:28:46 +02:00
Hans-Kristian Arntzen
bf07e5fa7b MSL: Fix OpLoad of array which is forced to a temporary. 2019-04-09 11:50:45 +02:00
Hans-Kristian Arntzen
2aec41dac8
Merge pull request #936 from lifpan/master
Add OpUndef instruction to block's instruction list for completeness.
2019-04-08 14:42:49 +02:00
lifpan
876627df3b Add OpUndef instruction to block's instruction list for completeness. 2019-04-08 19:45:31 +08:00
Hans-Kristian Arntzen
b7aa0d4e08
Merge pull request #935 from KhronosGroup/fix-931
Support fma() in older GLSL targets.
2019-04-08 12:04:46 +02:00
Hans-Kristian Arntzen
3ca8bc5e0d Support fma() in older GLSL targets. 2019-04-08 10:38:32 +02:00
Hans-Kristian Arntzen
133ea8fd82
Merge pull request #932 from billhollings/master
MSL: Fix infinite CAS loop on atomic_compare_exchange_weak_explicit().
2019-04-06 13:20:43 +02:00
Bill Hollings
efbe7ca16f MSL: Fix infinite CAS loop on atomic_compare_exchange_weak_explicit(). 2019-04-05 21:28:57 -04:00
Hans-Kristian Arntzen
4395339586
Merge pull request #930 from KhronosGroup/fix-929
Detect invalid DoWhileLoop early.
2019-04-05 14:03:06 +02:00
Hans-Kristian Arntzen
317144a59c Detect invalid DoWhileLoop early.
We had a bug where error conditions in DoWhileLoop emit path would not
detect that statements were being emitted due to the masking behavior
which happens when force_recompile is true. Fix this.

Also, refactor force_recompile into member functions so we can properly
break on any situation where this is set, without having to rely on
watchpoints in debuggers.
2019-04-05 12:19:32 +02:00
Hans-Kristian Arntzen
8db9ae0e9c
Merge pull request #928 from fjhenigman/roll2
Update to latest glslang/SPIRV-Tools.
2019-04-03 22:44:56 +02:00
Frank Henigman
248e95a42f Update to latest glslang/SPIRV-Tools. 2019-04-03 15:37:38 -04:00