Commit Graph

1294 Commits

Author SHA1 Message Date
Robert Konrad
216a6816cd Add --hlsl command line option 2017-01-25 17:30:52 +01:00
Robert Konrad
98eadc086e Add HLSL to cmake file 2017-01-25 17:20:43 +01:00
Robert Konrad
c53646a670 Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross into hlsl 2017-01-25 17:03:57 +01:00
Arseny Kapoulkine
49baf41990 Print Metal compiler version before running Metal tests
This helps pinpoint the issues due to differences in the Metal compiler
version and also indicates whether we are actually using the compiler to
validate MSL output.
2017-01-25 00:12:09 -08:00
Arseny Kapoulkine
f45075b08b Validate Metal shaders on OSX with Metal compiler
If we run on a system with Xcode installed to a default path, run Xcode
Metal shader compiler to validate the generated MSL shader.

This uncovers an issue in the existing MSL test - MSL backend currently
does not auto-assign attribute locations, which means that translating
GLSL shader without location layout produces an invalid MSL which
generates "error: 'attribute' index '0' is used more than once".
2017-01-25 00:12:09 -08:00
Bill Hollings
e3dac18633 Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-01-24 13:58:22 -08:00
Hans-Kristian Arntzen
7daba19223 Merge pull request #108 from zeux/flatten-row-major-matrix-index
Implement flattening of row major matrix indexing
2017-01-24 18:47:00 +01:00
Arseny Kapoulkine
32a561a6c3 Remove redundant constructor calls for scalar types 2017-01-24 08:09:58 -08:00
Arseny Kapoulkine
ed04c95b08 Implement flattening of row major matrix indexing
To extract a column from row-major matrix, we need to do a strided load one
component at a time. In this case flattened_access_chain_offset still returns
the offset to the first element, but the stride is equal to matrix stride
instead of vector stride.

For this to work, we need to pass matrix stride (and transpose flag) through,
similar to how matrix flattening works.

Additionally slightly clean up recursive flattened_access_chain structure -
specifically, instead of deciding mid-traversal that we need matrix stride
information, we can just pass the matrix stride through - for access chains
that end in matrix/vector this gets us what we need, and for access chains
that end in structs the flattened_access_chain_struct code will recompute
correct stride/transposition data to pass through further.
2017-01-24 07:42:19 -08:00
Hans-Kristian Arntzen
11df227adf Merge pull request #100 from KhronosGroup/metal-testing
Add basic setup for regression testing Metal output.
2017-01-24 14:52:02 +01:00
Hans-Kristian Arntzen
1c28ec6885 Add basic setup for regression testing Metal output. 2017-01-24 14:04:55 +01:00
Robert Konrad
9ec45fae51 Format code 2017-01-24 09:25:38 +01:00
Robert Konrad
c3268c9410 Do not output layouts for uniforms in HLSL 2017-01-24 09:23:22 +01:00
Robert Konrad
99469f0690 Convert uniform buffer blocks to cbuffers 2017-01-24 09:17:43 +01:00
Robert Konrad
bb763f3984 Fix merge 2017-01-23 14:52:02 +01:00
Robert Konrad
40e5d1e7f7 Format code 2017-01-23 14:49:32 +01:00
Robert Konrad
429b8cb25f Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross into hlsl
# Conflicts:
#	spirv_glsl.hpp
2017-01-23 14:44:41 +01:00
Robert Konrad
51835af124 Fix HLSL fragment shaders 2017-01-23 14:41:34 +01:00
Robert Konrad
d3a8ea33b8 Support modern GLSL->HLSL for vertex shaders 2017-01-23 14:41:20 +01:00
Robert Konrad
beebcbd1aa Splat even less in HLSL 2017-01-23 14:40:56 +01:00
Robert Konrad
451bdeeeff Fix HLSL binding numbers 2017-01-23 14:40:25 +01:00
Robert Konrad
7e4242fb0b Use sprintf instead of itoa to fix Mac/Linux 2017-01-23 14:40:13 +01:00
Robert Konrad
ffc590e199 Support matrix attributes in HLSL 2017-01-23 14:39:56 +01:00
Robert Konrad
4a0267e201 Do not intertwine TEXCOORD and POSITION outputs 2017-01-23 14:39:40 +01:00
Robert Konrad
ea24ee8145 Do not splat type contructor arguments in HLSL 2017-01-23 14:39:04 +01:00
Polona Caserman
3289043729 Remove hard-coded case 2017-01-23 13:02:16 +01:00
Polona Caserman
945494d211 Pass main function name in MSLConfiguration 2017-01-23 13:02:01 +01:00
Polona Caserman
91ccd21fc9 Manage variable names in an unordered map 2017-01-23 13:01:44 +01:00
Polona Caserman
1c63357577 Remove old code 2017-01-23 13:01:05 +01:00
Polona Caserman
b631003230 Replace ib_type.self with ib_type_id 2017-01-23 13:00:43 +01:00
Polona Caserman
92c36e75df Fix: check if location mask is set 2017-01-23 12:56:11 +01:00
Hans-Kristian Arntzen
3535f88bc1 Merge pull request #104 from KhronosGroup/flatten-improvements
Legacy UBO flattening improvements
2017-01-23 09:12:20 +01:00
Hans-Kristian Arntzen
d87249a2eb Remove hack for accessing matrix decorations in flattened structs. 2017-01-22 09:25:01 +01:00
Hans-Kristian Arntzen
fe12fff324 Comment type ID a bit better. 2017-01-22 09:06:15 +01:00
Hans-Kristian Arntzen
efba610718 Cleanup emit_buffer_block_flattened. 2017-01-22 08:53:52 +01:00
Hans-Kristian Arntzen
8a80e62fb4 Make get_buffer_block_flags clearer.
Fix empty struct case.
2017-01-22 08:51:24 +01:00
Hans-Kristian Arntzen
a35073ad78 Add test for flattened 3-dimensional arrays. 2017-01-22 08:49:11 +01:00
Hans-Kristian Arntzen
3eb2e52c4e Fix bugs with row-major matrices inside flattened UBOs. 2017-01-21 13:50:01 +01:00
Hans-Kristian Arntzen
d93dc38415 Use correct glslang revision for reference output ... 2017-01-21 12:53:17 +01:00
Hans-Kristian Arntzen
87f3c57945 Formatting. 2017-01-21 12:47:26 +01:00
Hans-Kristian Arntzen
d1dcced1cb Fixups to the flatten tests. 2017-01-21 12:39:16 +01:00
Hans-Kristian Arntzen
69af27d8be Expand array flatten test a little. 2017-01-21 12:35:57 +01:00
Hans-Kristian Arntzen
9540979c55 Support int and uint as flattened UBO types. 2017-01-21 12:29:20 +01:00
Hans-Kristian Arntzen
d3cad99347 Cleanups for flattened access chains. 2017-01-21 11:30:33 +01:00
Hans-Kristian Arntzen
7f787f09dc Add flattening support for push constants. 2017-01-21 10:27:14 +01:00
Hans-Kristian Arntzen
016b1d86e9 Emit readonly, writeonly for SSBOs. 2017-01-21 10:08:27 +01:00
Bill Hollings
ef1f860c01 CompilerMSL support OpImageFetch and Metal read() function.
Don't emit automatic sampler when using texture read().
Convert tex coords to uintN() when using texture read().
Emit face when read()ing cube textures.
2017-01-20 17:30:36 -05:00
Hans-Kristian Arntzen
2c7359d1d3 Merge pull request #103 from brenwill/master
Remove emission of function prototypes in MSL.
2017-01-20 20:39:22 +01:00
Bill Hollings
2d0d328f61 Run style formatter. 2017-01-20 11:33:59 -05:00
Bill Hollings
339881468c Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-01-20 11:27:05 -05:00