Commit Graph

1577 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
816c1167ce Handle invariant decoration more robustly.
Avoids certain cases of variance between translation units by forcing
every dependent expression of a store to be temporary.
Should avoid the major failure cases where invariance matters.
2018-11-22 11:55:57 +01:00
Hans-Kristian Arntzen
f247b05ffd
Merge pull request #768 from KhronosGroup/fix-764
Remove old hack for dealing with HLSL counter buffers.
2018-11-22 11:17:13 +01:00
Hans-Kristian Arntzen
9aa623a553 Remove old hack for dealing with HLSL counter buffers.
No longer needed.
2018-11-22 10:23:58 +01:00
Hans-Kristian Arntzen
2588309290
Merge pull request #763 from trzecieu/patch-2
Adding C++ syntax coloring for missed snippet
2018-11-19 10:54:15 +01:00
Piotr Paczkowski (trzeci.eu)
30743aa931
Adding C++ syntax coloring for missed snippet 2018-11-19 10:49:49 +01:00
Hans-Kristian Arntzen
7611dc0967
Merge pull request #762 from trzecieu/patch-1
Syntax coloring for C++ snippets in README.md
2018-11-19 10:13:06 +01:00
Piotr Paczkowski (trzeci.eu)
bc6011b512
Syntax coloring for C++ snippets in README.md 2018-11-19 08:52:12 +01:00
Hans-Kristian Arntzen
ea6bdacd05
Merge pull request #760 from KhronosGroup/fix-758
Parser: Handle group decorations.
2018-11-15 12:01:51 +01:00
Hans-Kristian Arntzen
fa42ed37ba Parser: Handle group decorations. 2018-11-15 10:51:52 +01:00
Hans-Kristian Arntzen
e4822981cc
Merge pull request #759 from lifpan/master
Handle opcode OpSourceContinued.
2018-11-15 10:09:30 +01:00
Hans-Kristian Arntzen
510e1475c6
Merge pull request #756 from cdavis5e/relaxed-block-layout-2
MSL: Also pack 2- and 4- element vectors when necessary.
2018-11-15 10:09:09 +01:00
lifpan
00a765eccf Handle opcode OpSourceContinued. 2018-11-15 09:04:36 +08:00
Hans-Kristian Arntzen
c2fe5878b4
Merge pull request #757 from cdavis5e/msl-extended-arith
MSL: Support extended arithmetic opcodes.
2018-11-14 18:46:07 +01:00
Chip Davis
a5882da091 Test loading from and storing to packed vectors. 2018-11-14 10:47:20 -06:00
Chip Davis
6d675ae6a2 Correct carry/borrow bit checks.
Don't use `addsat()`/`subsat()`; that'll erroneously flag cases where
the sum is exactly the maximum integer value, or the difference is
exactly 0. Also, correct the condition for the `select()` function; it's
basically `mix()` with a boolean factor.

(What was I *thinking*?)
2018-11-14 10:13:56 -06:00
Chip Davis
cf2a890e4f MSL: Support extended arithmetic opcodes. 2018-11-13 17:33:03 -06:00
Chip Davis
bed4918cb5 MSL: Also pack 2- and 4- element vectors when necessary.
This is also needed for `VK_KHR_relaxed_block_layout` support.
2018-11-13 17:31:47 -06:00
Hans-Kristian Arntzen
1adaaba74e
Merge pull request #755 from KhronosGroup/fix-740
GLSL: Support extended arithmetic opcodes.
2018-11-13 16:54:53 +01:00
Hans-Kristian Arntzen
2a8a4fe706 GLSL: Support extended arithmetic opcodes.
- uaddCarry
- usubBorrow
- umulExtended
- imulExtended
2018-11-13 14:50:46 +01:00
Hans-Kristian Arntzen
14a3ce4a20
Merge pull request #754 from lifpan/master
Handle opcode OpModuleProcessed.
2018-11-13 09:23:46 +01:00
lifpan
9161096676 Handle opcode OpModuleProcessed. 2018-11-13 14:28:38 +08:00
Hans-Kristian Arntzen
f734d78c15
Merge pull request #750 from KhronosGroup/msl-travis-fix
MSL: Split out early_fragment_tests.
2018-11-12 17:14:37 +01:00
Hans-Kristian Arntzen
d6be21543d MSL: Split out early_fragment_tests.
Was causing compilation failures, jumped the merge a bit too soon.
2018-11-12 16:20:49 +01:00
Hans-Kristian Arntzen
be732f5f51
Merge pull request #749 from KhronosGroup/fix-747
Deal with depth_greater/depth_less qualifiers.
2018-11-12 13:10:26 +01:00
Hans-Kristian Arntzen
4e5c8d7199 Deal with depth_greater/depth_less qualifiers.
Adds support on HLSL SM 5.0, and fixes bug on GLSL.
Makes sure early fragment tests is tested on MSL as well.
2018-11-12 10:35:36 +01:00
Hans-Kristian Arntzen
b778e16e48 HLSL: Complete support for combined image samplers in legacy. 2018-11-12 09:59:39 +01:00
Hans-Kristian Arntzen
e8e7baf1ca Merge branch 'mgong/CombineOnSM3' of git://github.com/gongminmin/SPIRV-Cross 2018-11-12 09:59:12 +01:00
Minmin Gong
e3ebfdaae5 HLSL: Combine image and sampler on shader model <= 30 2018-11-10 13:44:59 -08:00
Hans-Kristian Arntzen
485eb0fb67
Merge pull request #742 from stenzek/msl-ssign
MSL: Emit wrapper for SSign (sign() for int types)
2018-11-08 12:03:56 +01:00
Connor McLaughlin
1dd676c1de MSL: Emit wrapper for SSign (sign() for int types)
Metal does not define the sign() function for integer types, only
floating-point types.
2018-11-08 13:08:34 +10:00
Hans-Kristian Arntzen
cf5e1c2801
Merge pull request #743 from cdavis5e/relaxed-block-layout
MSL: Also pack members at unaligned offsets.
2018-11-07 19:38:56 +01:00
Hans-Kristian Arntzen
28a7583cfa
Merge pull request #741 from stenzek/msl-early-fragment-tests
MSL: Print early_fragment_tests specifier before fragment
2018-11-07 19:32:37 +01:00
Chip Davis
e50eecfeeb MSL: Also pack members at unaligned offsets.
This is necessary to support `VK_KHR_relaxed_block_layout`.
2018-11-07 09:42:54 -06:00
Connor McLaughlin
801431b45b MSL: Print early_fragment_tests specifier before fragment
The compiler in 10.14 reports an error that the attribute cannot be
applied to types if the specifier is printed before fragment.
2018-11-07 21:54:19 +10:00
Hans-Kristian Arntzen
daaffc4717
Merge pull request #738 from cdavis5e/shader-small-storage
Add support for 8- and 16-bit types to GLSL and MSL.
2018-11-06 19:58:44 +01:00
Chip Davis
0d949e11ff Support bitcasts of 16-bit types. 2018-11-05 14:56:36 -06:00
Chip Davis
ca4744ab72 Support constants of 16-bit integral type in GLSL and MSL.
Constants of 8-bit type aren't supported in GLSL, since there's no
extension letting you use them.
2018-11-02 14:39:55 -05:00
Chip Davis
117ccf407c Use specific base types for 8- and 16-bit integers. 2018-11-01 17:45:10 -05:00
Chip Davis
1fb27b4cda Add support for 8- and 16-bit types to GLSL and MSL.
In GLSL, 8-bit types require GL_EXT_shader_8bit_storage. 16-bit types
can use either GL_AMD_gpu_shader_int16/GL_AMD_gpu_shader_half_float or
GL_EXT_shader_16bit_storage.
2018-11-01 10:20:57 -05:00
Hans-Kristian Arntzen
13633c0500
Merge pull request #737 from KhronosGroup/fix-724
Deal with OpSpecConstantOp used as array size.
2018-11-01 15:26:19 +01:00
Hans-Kristian Arntzen
480acdad18 Deal with OpSpecConstantOp used as array size.
When trying to validate buffer sizes, we usually need to bail out when
using SpecConstantOps, but for some very specific cases where we allow
unsized arrays currently, we can safely allow "unknown" sized arrays as
well.

This is probably the best we can do, when we have even more difficult
cases than this, we throw a more sensible error message.
2018-11-01 14:58:02 +01:00
Hans-Kristian Arntzen
37dbdf14fa
Merge pull request #736 from KhronosGroup/spec-constant-macro-hlsl-msl
Add spec constant macro support to HLSL/MSL as well
2018-11-01 13:24:05 +01:00
Hans-Kristian Arntzen
00d542ed44 Minor nit, set emitted when emitting spec constant op in HLSL. 2018-11-01 11:49:32 +01:00
Hans-Kristian Arntzen
6e99fcf695 Run format_all.sh. 2018-11-01 11:23:48 +01:00
Hans-Kristian Arntzen
d4ad1e266a Add test case for local_size_x_id and some complex cases. 2018-11-01 11:23:48 +01:00
Hans-Kristian Arntzen
62db535b3f Update tests. 2018-11-01 11:23:48 +01:00
Hans-Kristian Arntzen
fd6ff3617a Support macro overrides for spec constants in HLSL. 2018-11-01 11:23:48 +01:00
Hans-Kristian Arntzen
fdfa7b0880
Merge pull request #733 from nicebyte/spec-const-glsl
Alter the handling of spec consts in non-Vulkan GLSL
2018-11-01 10:32:19 +01:00
Grigory Dzhavadyan
a5d82d1138 Alter the handling of spec consts in non-Vulkan GLSL
Previously, when generating non-Vulkan GLSL, each use of a spec constant
would be subsituted for its default value and the declaration of the constant
itself would be omitted completely.

This change slightly alters this behavior. The uses of the constant are kept,
as well as the declaration, although the latter is stripped of the layout
qualifier. The declaration is also prepended with the following code:

    #ifndef <constant name>_value
    #define <constant name> <default constant value>
    #endif

and the constant itself now looks like

    const <constant type> <constant name> = <constant name>_value;

The rationale for this change is that it gives the user a way to provide
custom values for specialization constants even when the target does not
support them.
2018-11-01 00:39:09 -07:00
Hans-Kristian Arntzen
dfd1bf8c56
Merge pull request #734 from zeux/master
Fix Options::force_temporary to work with OpenGL GLSL
2018-10-30 21:18:51 +01:00