Commit Graph

201 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
719ba63416 Add pack/unpack snorm8/unorm8. 2017-11-27 14:49:47 +01:00
Hans-Kristian Arntzen
6c7c680d01 Implement FP16 unpack/pack on HLSL. 2017-11-27 14:24:30 +01:00
msiglreith
f4bde2b3ef HLSL: Support early fragment tests attribute 2017-11-21 14:51:03 +01:00
Hans-Kristian Arntzen
5352615ce1 Update tests. 2017-11-20 21:10:00 +01:00
Amer Koleci
adebd5ed09 Add samples register space and correct generated string. 2017-11-20 21:06:20 +01:00
Amer Koleci
01c42c739e Support new hlsl 5.1 space for registers. 2017-11-20 21:06:20 +01:00
Hans-Kristian Arntzen
ce18d4ce74 Run format_all.sh. 2017-11-17 13:38:29 +01:00
Bill Hollings
e83e2b2217 CompilerMSL support and tests for OpUndef. 2017-11-15 22:44:42 -05:00
Hans-Kristian Arntzen
4427cb993d Add support for renaming entry points. 2017-11-13 13:50:37 +01:00
Hans-Kristian Arntzen
f486142e36 Run format_all.sh. 2017-11-13 09:52:35 +01:00
Hans-Kristian Arntzen
56716a9752 Remap IO blocks as well. 2017-11-13 09:52:00 +01:00
Hans-Kristian Arntzen
4f88f9750f Cleanups for HLSL vertex attribute remap.
Add CLI support as well.
2017-11-13 09:46:45 +01:00
Amer Koleci
7cf44099c9 Changes after github review.
Remap with binding instead of name.
2017-11-13 09:28:38 +01:00
Amer Koleci
7216d13620 Add overload compile method for hlsl with vertex attribute remap.
This adds remap to semantic and semantic_index as HLSL instead of always binding to TEXCOORD + binding_number.
2017-11-13 09:28:38 +01:00
Bill Hollings
bac657d873 Fixes from review of PR 321. 2017-11-07 15:38:13 -05:00
Amer Koleci
3404ee1690 Fix to_plain_buffer_length cast. 2017-11-06 19:58:20 +01:00
Hans-Kristian Arntzen
ca69b614e5 Fix some warnings on older GCC. 2017-11-06 09:49:52 +01:00
Hans-Kristian Arntzen
4a6d754f27 Run format_all.sh. 2017-10-26 17:43:03 +02: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
afce030bf4 Add support for writing row/col-major matrices to RWByteAddressBuffer. 2017-10-26 17:16:32 +02:00
Hans-Kristian Arntzen
551424ce43 Support loading col/row-major matrices from ByteAddressBuffer. 2017-10-26 16:35:18 +02:00
Hans-Kristian Arntzen
a95295cb23 Remap swizzle for HLSL and RWBuffer. 2017-10-24 09:55:25 +02:00
Hans-Kristian Arntzen
f4f497dc85 Run format_all.sh. 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
Hans-Kristian Arntzen
044d3c8911 Basic image load store and atomics. 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
94ff355812 Fix some naming issues for stripped and flattened structs. 2017-10-10 17:32:26 +02:00
Hans-Kristian Arntzen
7464232f67 Run format_all.sh. 2017-10-10 16:13:03 +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
b9814a09bc Add more robust HLSL packing support. 2017-10-10 15:23:07 +02:00
Hans-Kristian Arntzen
f0200bb18d Use packoffset in HLSL.
Rewrite how cbuffers are emitted.
2017-10-10 13:15:49 +02:00
Hans-Kristian Arntzen
1079e7930b Run format_all.sh. 2017-10-10 10:22:40 +02:00
Hans-Kristian Arntzen
d4727fe696 Stamp out all variants for mod(). 2017-10-06 13:21:42 +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
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
153fed031d Add basic support for StorageClassStorageBuffer.
Needs more testing, but seems to work.
2017-09-28 13:29:57 +02:00
Hans-Kristian Arntzen
86eb874568 Implement specialization constants for work group sizes. 2017-09-28 11:33:30 +02:00
James Ross-Gowan
8805d08b31 Fix HLSL atan2() argument order
HLSL uses atan2(y, x) to represent the arctangent y/x, just like GLSL.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb509575.aspx
2017-09-24 02:45:33 +10: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
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
James Ross-Gowan
fdbf794a67 Use the correct cbuffer binding for HLSL SM 4.0-5.0 2017-09-07 23:58:14 +10:00
Hans-Kristian Arntzen
713bd7c2b5 Run format_all.sh. 2017-08-28 09:01:03 +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
945425eaa8 Add some access chain tests. 2017-08-15 10:23:04 +02:00
Hans-Kristian Arntzen
4375aa3fd2 Refactor out access chain reads.
Prepare for matrix, array and struct loads.
2017-08-15 10:12:08 +02:00
Hans-Kristian Arntzen
e2bb5b8959 Add test for compute shader builtins. 2017-08-15 09:35:23 +02:00
Hans-Kristian Arntzen
247ab1ce24 Declare ByteAddressBuffer/RWByteAddressBuffer. 2017-08-15 09:15:23 +02:00
Hans-Kristian Arntzen
7d7f4b3b50 Emit flattened loads and stores. 2017-08-15 09:15:23 +02:00
Hans-Kristian Arntzen
3cbdbec712 Begin implementing ByteAddressBuffer flattening for HLSL. 2017-08-15 09:15:23 +02: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
Hans-Kristian Arntzen
bdfa97a1cf Unify vertex clip-coord fixups.
The different options were scattered around in different backends and
didn't really work right with CLI at all.
2017-08-03 13:02:59 +02:00
Hans-Kristian Arntzen
2abdc135c3 Declare undefined values up front.
They might potentially be used as part of OpStore in the SPIRV-Tools
inliner in some cases.

Implement these as declared variables but without any initializer.
2017-08-02 10:33:03 +02:00
Hans-Kristian Arntzen
98c76eed69 Declare specialization constants in HLSL. 2017-07-29 22:13:27 +02:00
Hans-Kristian Arntzen
c8d60914c4 Add support for SampleId/SampleMask/SamplePosition builtins. 2017-07-24 10:07:31 +02:00
Hans-Kristian Arntzen
d89d0e01fc Run format_all.sh. 2017-07-24 09:29:20 +02:00
Hans-Kristian Arntzen
cf09eb3773 Consider different binding space for push constants. 2017-06-30 22:16:24 +02:00
Hans-Kristian Arntzen
ecf56cff2b Add support for SM5.1 ConstantBuffer<T>. 2017-06-30 10:34:21 +02:00
Hans-Kristian Arntzen
de33d89074 Add explicit in/out locations everywhere.
Needed for newer glslang. With Vulkan semantics for SPIR-V, all
locations must be explicitly defined.
2017-06-21 09:39:08 +02:00
Hans-Kristian Arntzen
b0f7deedec Run format_all.sh. 2017-06-17 10:56:24 +02:00
Hans-Kristian Arntzen
978901f9e4 Avoid ugly workaround for separate shadow samplers in GLSL/HLSL. 2017-06-17 10:54:59 +02:00
Hans-Kristian Arntzen
620da7b943 Add basic support for : register() declaration in HLSL. 2017-06-17 10:15:32 +02:00
Bill Hollings
ba245697f1 Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross 2017-06-01 10:20:00 -04:00
Robert Konrad
111a30a7d8 Fix shader model 2/3 texture sampling 2017-05-31 16:53:43 +02:00
Bill Hollings
b41e1482c8 Support emitting SPIR-V type declarations tuned for specified SPIR-V objects.
CompilerGLSL type_to_glsl() and image_type_glsl() functions support optional object ID.
Add SPIRType::Image::access member to support SPIR-V OpTypeImage access qualifier.
Remove SPIRType::Image::is_read and ::is_written members.
Use DecorationNonReadable and DecorationNonWritable to mark read/write access for image variables.
CompilerMSL emit access qualifiers per image variable, instead of per image type.
CompilerGLSL and CompilerHLSL behaviour is unchanged.
2017-05-29 20:45:05 -04:00
Hans-Kristian Arntzen
08b3c674a9 Check size of name before testing for @count. 2017-05-09 09:30:30 +02:00
Hans-Kristian Arntzen
e897d154ac Cleanups. 2017-05-07 13:39:15 +02:00
Hans-Kristian Arntzen
947f7010c7 HLSL: Use emit_sampled_image_op instead. 2017-05-07 13:28:08 +02:00
Hans-Kristian Arntzen
686ac6812b HLSL: Can pass down combined image samplers as arguments. 2017-05-07 13:22:16 +02:00
Hans-Kristian Arntzen
59ad08429b HLSL: Add test for passing down separate image and samplers to functions. 2017-05-07 12:53:51 +02:00
Hans-Kristian Arntzen
36e1c470a2 Fix formatting. 2017-05-06 13:59:00 +02:00
Hans-Kristian Arntzen
f4d7268565 GLSL will also need shadow state analysis.
Refactor stuff out to top-level.

Fix some bugs with combined shadow samplers in regular GLSL.
2017-05-06 13:21:35 +02:00
Hans-Kristian Arntzen
100e9d34b8 HLSL: Basic support for separate image/samplers. 2017-05-06 12:39:04 +02:00
Hans-Kristian Arntzen
851acf3712 Avoid boolean mix in HLSL.
Update glslang travis checkout as boolean mix support was broken on that commit.
2017-05-04 10:28:30 +02:00
Hans-Kristian Arntzen
17d88ca928 Add compatibility option for PointSize in HLSL.
If we opt-in to it, PointSize can be ignored to avoid more annoying
workarounds.
2017-05-04 10:12:14 +02:00
Bill Hollings
012cb25b7d CompilerMSL remove option to flip fragment coordinates. 2017-04-25 11:25:50 -04:00
Robert Konrad
bb9dbd4149 Support texelFetch in HLSL 2017-04-24 11:08:55 +02:00
Robert Konrad
434d9b8803 Support array textures in HLSL 2017-04-24 10:02:03 +02:00
Robert Konrad
7d8be83cb3 Support shadow sampling in HLSL 2017-04-21 17:52:04 +02:00
Robert Konrad
8446631171 Support cube maps in HLSL 2017-04-21 14:54:03 +02:00
Robert Konrad
ff12d57765 Support 1D/2D textures in HLSL2/3 2017-04-21 14:35:30 +02:00
Robert Konrad
9020c48076 Support and test 1D and 3D textures in HLSL4/5 2017-04-21 14:05:17 +02:00
Robert Konrad
9aaf6b28dd Throw when sampling non-float textures in HLSL 2017-04-21 11:40:24 +02:00
Robert Konrad
1fe652da68 Improve shader model 2/3 texture sampling 2017-04-21 09:46:58 +02:00
Robert Konrad
612075176c Fix HLSL tex2D calls 2017-04-20 16:15:46 +02:00
Robert Konrad
de41ebf4d7 Simplify texture offset handling in HLSL 2017-04-20 16:04:02 +02:00
Robert Konrad
31afcbb4fe Force a recompile when a function is added to HLSL 2017-04-20 15:21:47 +02:00
Robert Konrad
f7dd57040e Correct and simplify HLSL texture types 2017-04-20 14:51:24 +02:00
Robert Konrad
fd9b589469 Support textureProj in HLSL4/5 2017-04-20 13:37:38 +02:00
Robert Konrad
8b516451f2 Uninformed attempt at mapping tex formats to HLSL 2017-04-20 11:39:38 +02:00
Robert Konrad
be4c919d08 Update HLSL test results 2017-04-18 15:17:55 +02:00
Robert Konrad
ec84e8832a Fix different HLSL sample calls 2017-04-18 14:55:38 +02:00
Robert Konrad
c5953e03ee Support shader model 4/5 type tex sampling 2017-04-18 14:17:05 +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
61b561772c Fix HLSL matrix unrolling 2017-04-03 11:38:15 +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
bf5c07532c Run format_all.sh. 2017-03-25 16:28:44 +01:00