Commit Graph

125 Commits

Author SHA1 Message Date
Robert Konrad
9020c48076 Support and test 1D and 3D textures in HLSL4/5 2017-04-21 14:05:17 +02:00
Robert Konrad
23d993546c Add texture sampling HLSL test 2017-04-21 11:46:10 +02:00
Robert Konrad
be4c919d08 Update HLSL test results 2017-04-18 15:17:55 +02:00
Robert Konrad
3804292c43 Merge branch 'master' of github.com:KhronosGroup/SPIRV-Cross into fix 2017-04-03 11:43:35 +02:00
Robert Konrad
1fb2315a35 Add a test for HLSL matrix unrolling 2017-04-03 11:42:36 +02:00
Hans-Kristian Arntzen
543e380d90 Fix case where samplerBuffer is emitted without combined sampler. 2017-04-02 11:03:07 +02:00
Hans-Kristian Arntzen
b2c2e6483b Analyze parameter preservation for functions.
This is kinda tricky, because if we only conditionally write to a
function parameter variable it is implicitly preserved in SPIR-V, so we must force
an in qualifier on the parameter to get the same behavior in GLSL.
2017-03-25 16:25:30 +01:00
Hans-Kristian Arntzen
24382a8ea2 Use findLSB as well in bitfield test. 2017-03-25 15:46:12 +01:00
Hans-Kristian Arntzen
6801af4dce Fix bitfield functions. 2017-03-25 15:38:20 +01:00
Hans-Kristian Arntzen
f4749df09a Merge pull request #151 from Kode/fix
Transform more functions for HLSL
2017-03-24 16:13:34 +01:00
Robert Konrad
9fadd34afe Add new HLSL tests 2017-03-24 15:41:20 +01:00
Robert Konrad
78ec0fcb22 Update HLSL test output
HLSL requires builtins to be defined after
texcoords in some cases.
2017-03-24 14:40:13 +01:00
Hans-Kristian Arntzen
840a72d47a Workaround empty struct declaration and empty IO variables. 2017-03-24 10:03:11 +01:00
Robert Konrad
eab111ed32 Add tests for legacy lod handling 2017-03-23 15:51:43 +01:00
Hans-Kristian Arntzen
a0a582dd04 Do not emit interpolation qualifiers to static globals. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
b8bda45802 Add test case for interpolation qualifiers in HLSL. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
447545311b Add test for input I/O blocks in fragment. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
e89b789af3 Add some tests for no stage inputs or outputs in HLSL. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
62df60ea3d Update vertex locations test to include I/O blocks. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
784a23b92a Add instancing test to HLSL. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
a4aa89e992 Add test for fragment builtins like gl_FragDepth/gl_FragCoord. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
61c31c6054 Make use of explicit locations in HLSL. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
bdea1a444a Begin rewriting how HLSL deals with inputs and outputs. 2017-03-21 13:48:50 +01:00
Hans-Kristian Arntzen
75391f9a68 Handle vector variants of OpLogicalAnd/Or/Not. 2017-03-20 22:45:40 +01:00
Bill Hollings
5550c87b1f CompilerMSL options access and UBO alignment test case.
CompilerMSL accesses options using same design pattern as CompilerGLSL and CompilerHLSL.
CompilerMSL support setting VA & rez binding specs via either constructor or compile() method overload.
CompilerMSL support single UBO packing and padding in single pass.
spriv_cross app (main.cpp) supports turning off UBO packing and padding via command line option.
Add MSL UBO alignment test shader.
2017-03-12 17:42:51 -04:00
Hans-Kristian Arntzen
fd12124bf7 Add tests for legacy I/O flattening. 2017-03-06 14:04:01 +01:00
Hans-Kristian Arntzen
7f2e17969b Add built-in cull distance. 2017-03-05 12:47:03 +01:00
Hans-Kristian Arntzen
036b9b73f5 Emit storage qualifier in the correct place.
Need to emit qualifiers in a specific order for legacy GLSL.

<interpolation> <storage> <precision> <type>.
2017-02-24 09:56:17 +01:00
Hans-Kristian Arntzen
fc80cd8cbf Add support for loading flattened structs. 2017-02-23 19:31:56 +01:00
Hans-Kristian Arntzen
97350d32fd Fix cases for flattened struct write.
Handle writing the entire struct as well as writing the elements
individually.
2017-02-23 19:05:11 +01:00
Bill Hollings
1699e69ccd Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-02-11 10:58:07 -05:00
Hans-Kristian Arntzen
0e7c33ff81 Update glslang to latest on Travis.
Fix a lingering bug with OpSelect and boolean mix().
2017-02-11 10:52:34 +01:00
Bill Hollings
e016de860a Update MSL reference shaders affected by upstream pull. 2017-02-09 13:16:13 -05:00
Bill Hollings
6159a61c95 CompilerMSL add support for texel buffers.
Compiler MSL support DimBuffer as image dimension.
CompilerMSL check texture coordinate result type dimension before adding swizzles.
Update MSL reference shaders affected by this update.
2017-02-09 12:14:30 -05:00
Hans-Kristian Arntzen
5dd7c04195 Merge branch 'master' of git://github.com/brenwill/SPIRV-Cross into pr-109 2017-02-05 10:59:44 +01:00
Hans-Kristian Arntzen
9cb8616c31 Do not use write/read counters for "global" parameters.
Fixes device const & SSBO issues.
2017-02-05 10:50:14 +01:00
Hans-Kristian Arntzen
4ca769b546 Merge branch 'msl_global-invocation-id' of git://github.com/Kangz/SPIRV-Cross into pr-105 2017-02-05 10:14:38 +01:00
Hans-Kristian Arntzen
ab21dfb25b Fix execution order for for-loop emission.
In some cases, the compiler decided to emit continue block first,
which invalidated the expressions used by the condition.
Parameters to functions can be evaluated in any order which caused
"random" behavior.
2017-02-04 10:07:20 +01:00
Bill Hollings
e791c0b9e6 Removed Travis-killing MSL test: frag/for-loop-init.frag. 2017-01-31 12:08:08 -05:00
Bill Hollings
de72b3328e Removed Travis-killing MSL test: flatten/copy.flatten.vert. 2017-01-31 12:01:13 -05:00
Bill Hollings
d1737c65cf Removed Travis-killing MSL test: flatten/dynamic.flatten.vert. 2017-01-31 11:53:20 -05:00
Bill Hollings
be4cb17a14 Enhance MSL testing and add numerous MSL test cases.
Add to suite of MSL tests and references any existing GLSL tests
that successfully convert GLSL->SPIRV->MSL and compile as MSL.
test_shaders_helper() ignores hidden files that start with '.',
to avoid accidentally finding hidden OSX files such as .DS_Store.
Use xcrun to compile MSL shaders instead of hard-coded path to Metal compiler.
Wrap calls to xcrun in exception handling to ignore if Xcode not installed.
For MSL tests, move call to validate_shader_msl() to after call to
regression_check() to allow a converted MSL shader to be saved for
manual review even if it doesn't successfully compile as MSL.
2017-01-30 22:55:21 -05:00
Hans-Kristian Arntzen
1850457b28 Merge pull request #107 from Kode/hlsl
HLSL Support
2017-01-28 08:53:24 +01:00
Robert Konrad
e49cff5055 Update HLSL reference shader 2017-01-27 16:34:52 +01:00
Corentin Wallez
d8278a8e3b msl: Add support for gl_LocalInvocationID and gl_LocalInvocationIndex 2017-01-26 20:22:31 -05:00
Corentin Wallez
3542168f51 Add SSBO and gl_GlobalInvocationID MSL tests 2017-01-26 20:12:00 -05:00
Robert Konrad
82959c86bb Use \n line endings in HLSL reference shaders 2017-01-26 13:22:52 +01:00
Robert Konrad
d6b3efaaaf Add HLSL reference shader outputs 2017-01-26 11:41:22 +01:00
Robert Konrad
7b3d0686ef Adjust metal reference output
Y flipping is now off by default.
2017-01-26 10:32:50 +01: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