Commit Graph

216 Commits

Author SHA1 Message Date
Bill Hollings
ba865733eb Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-11-05 22:49:08 -05:00
Bill Hollings
1c18078811 Enhancements to MSL compute and entry point naming.
Support Workgroup (threadgroup) variables.
Mark if SPIRConstant is used as an array length, since it cannot be specialized.
Resolve specialized array length constants.
Support passing an array to MSL function.
Support emitting GLSL array assignments in MSL via an array copy function.
Support for memory and control barriers.
Struct packing enhancements, including packing nested structs.
Enhancements to replacing illegal MSL variable and function names.
Add Compiler::get_entry_point_name_map() function to retrieve entry point renamings.
Remove CompilerGLSL::clean_func_name() as obsolete.
Fixes to types in bitcast MSL functions.
Add Variant::get_id() member function.
Add CompilerMSL::Options::msl_version option.
Add numerous MSL compute tests.
2017-11-05 21:34:42 -05:00
Hans-Kristian Arntzen
22e94913d4 Add test for row/col-major matrix read/write for HLSL. 2017-10-26 17:40:45 +02:00
Hans-Kristian Arntzen
2ba7ed1c09 Fix tests after rebase. 2017-10-24 09:56:08 +02:00
Hans-Kristian Arntzen
a95295cb23 Remap swizzle for HLSL and RWBuffer. 2017-10-24 09:55:25 +02:00
Hans-Kristian Arntzen
ae236e7056 Add GroupSync() in HLSL. 2017-10-24 09:55:25 +02:00
Hans-Kristian Arntzen
85eb972259 Add some HLSL tests for atomics and image load store. 2017-10-24 09:55:25 +02:00
James Ross-Gowan
1f16f0d260 Use 'static const' for spec constants in HLSL
If 'const' is used, the shader expects the variable to be backed by a
constant buffer. 'static const' is probably preferred for a value that
is initialized with a constant in the HLSL source code.

FXC also emits a warning for 'const' variables with initializers, since
'static const' was probably intended.
2017-10-21 19:19:32 +11:00
Hans-Kristian Arntzen
d48876ac41 Add test for stripped cbuffer members. 2017-10-10 17:40:37 +02:00
Hans-Kristian Arntzen
94ff355812 Fix some naming issues for stripped and flattened structs. 2017-10-10 17:32:26 +02:00
Hans-Kristian Arntzen
c68c72c5be Fix ARB_enhanced_layout test. 2017-10-10 16:25:47 +02:00
Hans-Kristian Arntzen
620d01c5d6 Generate decorations for row_major/column_major in HLSL. 2017-10-10 16:11:25 +02:00
Hans-Kristian Arntzen
6feff98295 Update HLSL cbuffer tests. 2017-10-10 15:37:53 +02:00
Hans-Kristian Arntzen
4d11220aa8 Add a test for enhanced layouts. 2017-10-10 11:30:29 +02:00
Hans-Kristian Arntzen
6a7b95d2d6 Validate that std140 packing can actually be used. 2017-10-10 10:12:27 +02:00
Hans-Kristian Arntzen
c9168cd981 Merge pull request #299 from KhronosGroup/fix-173
Stamp out all variants for mod().
2017-10-06 13:53:06 +02:00
Hans-Kristian Arntzen
d4727fe696 Stamp out all variants for mod(). 2017-10-06 13:21:42 +02:00
Hans-Kristian Arntzen
8538b4c9c0 Handle empty struct declarations with best effort.
This "feature" is a bit icky as we have no useful representation of it,
so never emit code which has anything to do with empty structs.
2017-10-06 13:05:14 +02:00
Hans-Kristian Arntzen
eb58f67727 Only unroll matrices for vertex input.
Bandaid, might have to revisit this later.
2017-10-05 16:31:52 +02:00
Hans-Kristian Arntzen
067f241bf8 Runtime arrays do not work yet in MSL, so don't try to test that yet. 2017-10-02 09:24:16 +02:00
Hans-Kristian Arntzen
ecaea50739 Add SPVASM test from clspv. 2017-09-29 12:20:57 +02:00
Hans-Kristian Arntzen
aab3107a3f Add WorkGroupID/NumWorkGroups to MSL. Fix block name alias. 2017-09-29 12:16:53 +02:00
Hans-Kristian Arntzen
db5d49f04a Add SPVASM testing support for HLSL/MSL. 2017-09-29 11:07:11 +02:00
Hans-Kristian Arntzen
cff0fb57dc Add specialization constant work group size test for MSL. 2017-09-29 10:22:19 +02:00
Hans-Kristian Arntzen
825f07c04a Add test for specialization constant workgroup size on HLSL. 2017-09-29 10:21:02 +02:00
Hans-Kristian Arntzen
84f8c9935b Declare work group size constants in HLSL and MSL.
Technically not needed, but it does make compute code easier to read
compared to magical constants being used for work group size.
2017-09-29 10:15:33 +02:00
Hans-Kristian Arntzen
0e4ed4102b Only declare with specialization constant when in Vulkan semantics. 2017-09-28 12:24:04 +02:00
Hans-Kristian Arntzen
3339fd4e87 Fix case when Phi variable is a loop variable.
Need to flush variable to static expression rather than a variable.
2017-09-25 10:15:17 +02:00
Hans-Kristian Arntzen
9aa42a87af Just emit textureSize variants we actually need. 2017-09-20 10:31:56 +02:00
Hans-Kristian Arntzen
1bc5b70752 Add exhaustive image query to HLSL.
Need to strip this down somehow ...
2017-09-20 10:00:13 +02:00
Hans-Kristian Arntzen
7064c54820 Various fixes to texture/image query in GLSL. 2017-09-19 16:08:25 +02:00
James Ross-Gowan
02e6be7288 Fix texture GatherRed/Green/etc. methods for SM 5.0
Unlike GLSL, the component is selected by calling a specific method.
2017-09-12 07:20:01 +10:00
Hans-Kristian Arntzen
eab66fcd55 Update HLSL references. 2017-09-08 09:14:00 +02:00
Hans-Kristian Arntzen
656a7ba1d3 Remove irrelevant test.
The UDIV test was testing invalid SPIR-V and recent SPIRV-Tools errors
out on it.
2017-09-06 10:56:14 +02:00
Hans-Kristian Arntzen
a2229a0327 Add regression test for RMW optimizations. 2017-09-06 09:20:55 +02:00
Hans-Kristian Arntzen
9091eadb0d Support FrexpStruct/ModfStruct. 2017-09-04 10:27:08 +02:00
Hans-Kristian Arntzen
11dfcb6531 Add restrict qualifier for images. 2017-08-29 15:54:22 +02:00
Hans-Kristian Arntzen
d55898ec74 Fix declaration of coherent images. 2017-08-29 15:52:59 +02:00
Hans-Kristian Arntzen
536d888a92 Add test shader for coherent SSBO. 2017-08-28 09:02:08 +02:00
Hans-Kristian Arntzen
e8d2c8e710 Support samplerBuffer as function parameters in HLSL. 2017-08-21 10:26:44 +02:00
Hans-Kristian Arntzen
e8d5d71cad Add sampler buffer support to HLSL. 2017-08-21 10:01:03 +02:00
Hans-Kristian Arntzen
d7f38ab4bf Add support for SPV_KHR_multiview. 2017-08-15 13:28:16 +02:00
Hans-Kristian Arntzen
945425eaa8 Add some access chain tests. 2017-08-15 10:23:04 +02:00
Hans-Kristian Arntzen
af2b233582 Add test for ByteAddressBuffer vs. RWByteAddressBuffer. 2017-08-15 09:39:45 +02:00
Hans-Kristian Arntzen
e2bb5b8959 Add test for compute shader builtins. 2017-08-15 09:35:23 +02:00
Bill Hollings
1e84a379ff Fix issue #245: assignment of flattened input struct.
Emit input struct assignment by assigning member by member from stage_in struct.
Map qualified member name from pointer type, not base type.
Add Comiler::expression_type_id() function, similar to expression_type().
2017-08-12 00:21:13 -04:00
Bill Hollings
77f5812c55 Fix issue #239: compilation of shaders-msl/frag/texture-proj-shadow.frag.
Remove unsupported sampler1DShadow from shaders-msl/frag/texture-proj-shadow.frag.
Improve error message response from unsupported depth texture formats.
Fix several integer cast warnings in unrelated code.
Run ./format_all.sh on unrelated files.
2017-08-11 14:54:58 -04:00
Bill Hollings
730257cf67 Merge upstream 2017-08-10 17:27:01 -04:00
Hans-Kristian Arntzen
744d0405b0 Preserve arguments with inout unless complete writes are made. 2017-08-09 17:06:41 +02:00
Hans-Kristian Arntzen
48ccde3779 Support OpConstantNull. 2017-08-03 14:32:29 +02:00