Commit Graph

3051 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
c2500e504d
Merge pull request #1735 from billhollings/add-const-op-exprs
Add support for additional ops in OpSpecConstantOp.
2021-09-06 11:31:18 +02:00
Bill Hollings
472f9d4f6d Add tests for OpSpecConstantOp ops OpQuantizeToF16 and OpSRem.
Tests provided by @cdavis5e.
2021-09-05 16:51:04 -04:00
Bill Hollings
5fb1ca4f0d Add support for additional ops in OpSpecConstantOp.
MSL: Support op OpQuantizeToF16 in OpSpecConstantOp.
All: Support op OpSRem in OpSpecConstantOp.
2021-09-03 18:20:49 -04:00
Hans-Kristian Arntzen
51d8e7be94
Merge pull request #1734 from KhronosGroup/buffer-reference-uvec2
GLSL: Emit GL_EXT_buffer_reference_uvec2 as required.
2021-09-02 14:12:31 +02:00
Hans-Kristian Arntzen
b8f1e71907 GLSL: Emit GL_EXT_buffer_reference_uvec2 as required. 2021-09-02 13:17:13 +02:00
Hans-Kristian Arntzen
d6fe75df10
Merge pull request #1732 from KhronosGroup/fix-1731
Fix switch fallthrough case in some cases.
2021-08-31 18:31:31 +02:00
Hans-Kristian Arntzen
23c4480d8e Fix switch fallthrough case in some cases. 2021-08-31 17:24:09 +02:00
Hans-Kristian Arntzen
0e2880ab99
Merge pull request #1729 from KhronosGroup/fix-1726
MSL: Consider that function/private variables can be block-like.
2021-08-23 14:55:13 +02:00
Hans-Kristian Arntzen
2eea6a579b MSL: Consider that function/private variables can be block-like.
Handles a special case with array copies.
The implementation of this fix is not perfect, but should be good
enough for time being.
2021-08-23 13:26:45 +02:00
Hans-Kristian Arntzen
840d4483bc
Merge pull request #1728 from KhronosGroup/fix-1727
Track temporary access for OpArrayLength result.
2021-08-23 13:26:34 +02:00
Hans-Kristian Arntzen
5b0cafb416 Track temporary access for OpArrayLength result.
The argument is a literal, but result is still a temporary.
2021-08-23 12:43:41 +02:00
Hans-Kristian Arntzen
c062b6b852
Merge pull request #1725 from billhollings/fix-duplicate-glposition
MSL: Fix duplicate gl_Position outputs when gl_Position defined but unused.
2021-08-23 11:37:10 +02:00
Hans-Kristian Arntzen
fad1590786
Merge pull request #1722 from billhollings/row-maj-mtx-store-from-const
MSL: Support row-major transpose when storing matrix from constant RHS matrix.
2021-08-23 11:29:01 +02:00
Hans-Kristian Arntzen
27e7abeab1
Merge pull request #1724 from billhollings/msl-const-expr-casting
MSL: Fix casting in constant expressions with different sizes.
2021-08-23 11:23:25 +02:00
Bill Hollings
e76fcf9309 MSL: Add test for fixes to MSL constant expression type down-casting. 2021-08-16 13:56:05 -04:00
Bill Hollings
3105e82b2e MSL: Fix duplicate gl_Position outputs when gl_Position defined but unused.
When gl_Position is defined by SPIR-V, but neither used nor initialized,
it appeared twice in the MSL output, as gl_Position and glPosition_1.

The existing tests for whether an output is active check only that it is
used by an op, or initialized. Adding the implicit gl_Position also marked
the existing gl_Position as active, duplicating the output variable.

Fix is that when checking for the need to add an implicit gl_Position
output, also check if the var is already defined in the shader,
and just needs to be marked as active.
Add test shader.
2021-08-16 11:23:15 -04:00
Bill Hollings
a75fe07546 MSL: Fix casting in constant expressions with different sizes.
Previous casting in constant expressions used as_type<> between
types of different overall sizes.
Add check for overall size (width * vecsize) to ensure as_type<> will work,
otherwise use regular cast. Also beef up test of integer values to also check
vecsize, and use regular casts for those.
2021-08-12 16:19:46 -04:00
Bill Hollings
9552ca5473 MSL: Support row-major transpose when storing matrix from constant RHS matrix.
Remove test and exception when storing row-major matrix
from RHS that is not a SPIRExpression.
Add test shaders.
2021-08-12 09:08:35 -04:00
Hans-Kristian Arntzen
bab4e5911b
Merge pull request #1716 from KhronosGroup/terminator-access-fix
Handle value access in terminators.
2021-07-29 15:48:51 +02:00
Hans-Kristian Arntzen
cb613eb675 Handle value access in terminators.
Fixes case where value is created inside loop body and consumed by a
return outside it.
2021-07-29 15:27:52 +02:00
Hans-Kristian Arntzen
1964799fba
Merge pull request #1715 from KhronosGroup/precise-fp16-fp64
GLSL: Emit precise for fp16/fp64 types as well.
2021-07-26 22:45:18 +02:00
Hans-Kristian Arntzen
ac11a91792 GLSL: Emit precise for fp16/fp64 types as well. 2021-07-26 22:05:55 +02:00
Hans-Kristian Arntzen
cd22336a38
Merge pull request #1712 from cdavis5e/msl-subgroup-ballot-simplify
MSL: Simplify spvSubgroupBallot().
2021-07-22 12:15:33 +02:00
Chip Davis
03ad13bae6 MSL: Simplify spvSubgroupBallot().
A bitcast to `uint2` will do just fine. I honestly don't know why I
didn't do it this way earlier.
2021-07-21 00:25:09 -05:00
Hans-Kristian Arntzen
18f3cd6810 GLSL: Ensure ray query object decls are flushed if allocated in Function.
glslang always emits Private variables, but DXC not so much.
2021-07-20 12:04:00 +02:00
Hans-Kristian Arntzen
e51630595f
Merge pull request #1711 from KhronosGroup/fix-1690
GLSL: Implement GL_EXT_ray_query.
2021-07-19 14:37:09 +02:00
Hans-Kristian Arntzen
5b227cc57c GLSL: Implement GL_EXT_ray_query. 2021-07-19 14:01:21 +02:00
Hans-Kristian Arntzen
6196e3b029 MSL: Remove redundant path for SampleMask. 2021-07-15 16:34:06 +02:00
Hans-Kristian Arntzen
2fcbef398c
Merge pull request #1709 from billhollings/fix-sample-mask-in
MSL: Adjust gl_SampleMaskIn for sample-shading and/or fixed sample mask.
2021-07-15 16:32:35 +02:00
Hans-Kristian Arntzen
fe08bf4af4 Remove EXPERIMENTAL from JSON reflection backend. 2021-07-15 16:21:58 +02:00
Bill Hollings
ebb5098def MSL: Adjust gl_SampleMaskIn for sample-shading and/or fixed sample mask.
Vulkan specifies that the Sample Mask Test occurs before fragment shading.
This means gl_SampleMaskIn should be influenced by both sample-shading and
VkPipelineMultisampleStateCreateInfo::pSampleMask.

CTS tests dEQP-VK.pipeline.multisample_shader_builtin.* bear this out.

For sample-shading, gl_SampleMaskIn should only have a single bit set,
Since Metal does not filter for this, apply a bitmask based on gl_SampleID.

For a fixed sample mask, since Metal is unaware of
VkPipelineMultisampleStateCreateInfo::pSampleMask, we need to ensure that
we apply it to both gl_SampleMaskIn and gl_SampleMask. This has the side
effect of a redundant application of pSampleMask if the shader already
includes gl_SampleMaskIn when setting gl_SampleMask, but I don't see an
easy way around this.

Also, simplify the logic for including the fixed sample mask in gl_ShaderMask,
and print the fixed sample mask as a hex value for readability of bits.
2021-07-13 21:22:13 -04:00
Hans-Kristian Arntzen
be3988b13c
Merge pull request #1706 from SpaceIm/fix/ios-bundle
CMake: fix cross-build to iOS/tvOS/watchOS
2021-07-13 13:23:48 +02:00
Hans-Kristian Arntzen
a70ce5192e
Merge pull request #1708 from KhronosGroup/fix-interpolant-access-chain
MSL: Add test for PR 1707
2021-07-13 13:23:36 +02:00
Hans-Kristian Arntzen
71b83a18f4 MSL: Add test for scalar access chain pull interpolant. 2021-07-13 12:25:18 +02:00
Hans-Kristian Arntzen
d42c0b2e08
Merge pull request #1707 from billhollings/fix-interpolant-access-chain
MSL: Fix setting SPIRVCrossDecorationInterpolantComponentExpr decoration.
2021-07-13 12:25:08 +02:00
Bill Hollings
3e04eee491 MSL: Fix setting SPIRVCrossDecorationInterpolantComponentExpr decoration.
When setting SPIRVCrossDecorationInterpolantComponentExpr decoration, take
into consideration a possible array of vectors in an access chain, and don't
apply the decoration until we traverse through the array into the vector itself.
2021-07-12 14:52:07 -04:00
SpaceIm
d74eaabde0 fix cross-build to iOS/tvOS/watchOS
see https://cmake.org/cmake/help/latest/policy/CMP0006.html
2021-07-11 15:22:43 +02:00
Hans-Kristian Arntzen
1ae2b58f19
Merge pull request #1700 from pkasting/master
Fix -Wunreachable-code-aggressive.
2021-06-30 22:16:02 +02:00
Hans-Kristian Arntzen
bf746bd680
Merge pull request #1699 from KhronosGroup/pervertexnv
GLSL: Support pervertexNV in NV barycentric extension.
2021-06-30 19:13:21 +02:00
Peter Kasting
7cdab07efe Fix -Wunreachable-code-aggressive.
Bug: chromium:1066980
2021-06-30 09:17:59 -07:00
Hans-Kristian Arntzen
206ee8f171 GLSL: Support pervertexNV in NV barycentric extension. 2021-06-30 16:27:46 +02:00
Hans-Kristian Arntzen
c5b8022e61
Merge pull request #1669 from KhronosGroup/1560-reuse1
Make repository REUSE compliant and check licenses in CI
2021-06-29 11:52:33 +02:00
Hans-Kristian Arntzen
54882ad16d Add GLSL.std.450.h to REUSE. 2021-06-29 11:03:52 +02:00
Jon Leech
3781d49d7c .gitignore ignored new license text 2021-06-29 11:03:52 +02:00
Jon Leech
c862f8d22d Actually checkout repo into new reuse job 2021-06-29 11:03:52 +02:00
Jon Leech
f2a65545b8 Finish adding SPDX tags and setup a reuse checked in Github Actions CI 2021-06-29 11:03:52 +02:00
Jon Leech
2ceca64004 Add missing copyright headers. 2021-06-29 11:03:38 +02:00
Hans-Kristian Arntzen
853e84e8bf
Merge pull request #1698 from KhronosGroup/fix-1691
HLSL: Rewrite how block IO is emitted.
2021-06-29 10:56:34 +02:00
Hans-Kristian Arntzen
d6b29ab017 HLSL: Rewrite how block IO is emitted.
Emit block members directly in the IO structs and sort them.
Ensures we can get some kind of stable order between stages.

To complete the story, we'll need to be able to inject unused inputs /
builtins, or eliminate unused outputs (probably easiest solution).
2021-06-28 15:04:49 +02:00
Hans-Kristian Arntzen
9338996f3b
Merge pull request #1697 from KhronosGroup/fix-1693
GLSL: Emit num_views for OVR_multiview2.
2021-06-28 14:26:29 +02:00