Commit Graph

1895 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
6f091e7c8f GLSL: Support GL_EXT_scalar_block_layout. 2019-04-26 15:43:37 +02:00
Hans-Kristian Arntzen
138d0e326d
Merge pull request #956 from KhronosGroup/buffer-reference
GLSL: Implement GL_EXT_buffer_reference.
2019-04-26 15:43:14 +02:00
Hans-Kristian Arntzen
758427e127 Fix GCC 4.x warning. 2019-04-26 13:09:54 +02:00
Hans-Kristian Arntzen
2cc374a0c8 GLSL: Implement GL_EXT_buffer_reference.
Buffer objects can contain arbitrary pointers to blocks.
We can also implement ConvertPtrToU and ConvertUToPtr.
The latter can cast a uint64_t to any type as it pleases,
so we will need to generate fake buffer reference blocks to be able to
cast the type.
2019-04-26 11:43:51 +02:00
Hans-Kristian Arntzen
f940b6c0c5
Merge pull request #955 from KhronosGroup/fix-953
Fix infinite loop when OpAtomic* temporaries are used in other blocks.
2019-04-24 10:20:10 +02:00
Hans-Kristian Arntzen
8b236f24f1 Fix infinite loop when OpAtomic* temporaries are used in other blocks.
We made the mistake of registering a dependency on the atomic variable
even if the atomic result was forced to a temporary. There is no need to
register reads from atomic variables like this as we always force atomic
results to a temporary and argument read/writes do not need to be
tracked.
2019-04-24 09:33:39 +02:00
Hans-Kristian Arntzen
bbfc31339a
Merge pull request #954 from KhronosGroup/fix-951
Work around false positive warning on GCC 8.3.
2019-04-24 08:51:54 +02:00
Hans-Kristian Arntzen
9420b75314 Work around false positive warning on GCC 8.3. 2019-04-24 08:49:53 +02:00
Hans-Kristian Arntzen
43bbeacae2
Merge pull request #952 from KhronosGroup/fix-950
MSL: Add native texture buffer support.
2019-04-23 15:43:29 +02:00
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