Commit Graph

1562 Commits

Author SHA1 Message Date
Chip Davis
a5882da091 Test loading from and storing to packed vectors. 2018-11-14 10:47:20 -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
Arseny Kapoulkine
7f055e8a68 Fix Options::force_temporary to work with OpenGL GLSL
Setting force_temporary to true produces invalid GLSL because sampler
variables are copied:

    highp sampler2D _377 = DiffuseMapTexture;

This change fixes the problem by always forwarding forwardable
variables. I also took an opportunity to restructure the code to make
it easier to read and add extra conditions to in the future.
2018-10-30 10:49:18 -07:00
Hans-Kristian Arntzen
236df43689 Try release build for Travis. 2018-10-27 14:02:09 +02:00
Hans-Kristian Arntzen
a89ab694e1
Merge pull request #732 from KhronosGroup/travis-release-build
Try release build for Travis.
2018-10-27 14:00:46 +02:00
Hans-Kristian Arntzen
6570038860 Try release build for Travis. 2018-10-27 12:26:35 +02:00
Hans-Kristian Arntzen
76d6238315
Merge pull request #731 from KhronosGroup/travis-windows
Add Windows support in Travis CI
2018-10-27 01:45:10 +02:00
Hans-Kristian Arntzen
6157bf3cae Add Windows support in Travis CI.
- Add new Windows support
- Use CMake/CTest instead of Make + shell scripts
- Use --parallel in CTest
- Fix CTest on Windows
- Cleanups in test_shaders.py
- Force specific commit for SPIRV-Headers
- Fix Inf/NaN odd-ball case by moving to ASM
2018-10-27 00:22:30 +02:00
Hans-Kristian Arntzen
bfeb388edf
Merge pull request #729 from KhronosGroup/fix-728
HLSL: Use same logic as GLSL for picking cbuffer block name.
2018-10-23 09:10:55 +02:00
Hans-Kristian Arntzen
226d837d7e HLSL: Use same logic as GLSL for picking cbuffer block name.
HLSL just picked the variable name which did not work as expected for
some users. Use the same logic as GLSL and set up declared_block_names,
so the actual name can be queried later.
2018-10-22 09:50:04 +02:00
Hans-Kristian Arntzen
a8e5a0bb9c
Merge pull request #722 from KhronosGroup/parser-refactor
Hoist out parsing module from spirv_cross::Compiler
2018-10-19 12:50:12 +02:00
Hans-Kristian Arntzen
5bcf02f7c9 Hoist out parsing module from spirv_cross::Compiler.
This is a large refactor which splits out the SPIR-V parser from
Compiler and moves it into its more appropriately named Parser module.

The Parser is responsible for building a ParsedIR structure which is
then consumed by one or more compilers.

Compiler can take a ParsedIR by value or move reference. This should
allow for optimal case for both multiple compilations and single
compilation scenarios.
2018-10-19 12:01:31 +02:00
Khronos Group Webmaster
cc5c0204d8
Create CODE_OF_CONDUCT.md 2018-10-10 15:52:21 -04:00
Hans-Kristian Arntzen
d2928bda70
Merge pull request #721 from KhronosGroup/fix-720
Refactor MSL to use SPIRCombinedImageSampler.
2018-10-05 10:10:49 +02:00
Hans-Kristian Arntzen
a697299bc1 Refactor MSL to use SPIRCombinedImageSampler.
Avoids special "meta" data to express this type.
Makes MSL implementation in line with HLSL.
2018-10-05 09:49:57 +02:00
Hans-Kristian Arntzen
519565b030
Merge pull request #718 from cdavis5e/op-image-sampled-image
MSL: Handle OpImage on OpSampledImage expressions.
2018-10-04 21:30:08 +02:00
Hans-Kristian Arntzen
3c512d04b5
Merge pull request #717 from cdavis5e/depth-gather-swizzle
MSL: Swizzle gathers on depth textures as well.
2018-10-04 18:36:59 +02:00