Commit Graph

3088 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen
5afb3d313f MSL: Fix some trivial bugs not caught by CI when adding ray query. 2021-10-21 21:53:41 +02:00
Hans-Kristian Arntzen
345a7d171c
Merge pull request #1773 from congyue1977/master
Support Metal 2.4 Intersection Query, Implement GL_EXT_ray_query.
2021-10-21 15:56:15 +02:00
丛越
2895a43274 Fix unsupported exceptions for ConvertUToAccelerationStructure & BindingTableRecordOffset. 2021-10-21 19:01:38 +08:00
丛越
d52ec1e196 Fix all requested changes, test_shaders.py supports compiling MSL 2.4 shaders, and the Intersection Query currently only supports MSL 2.4 on the iOS platform. 2021-10-21 17:46:45 +08:00
Hans-Kristian Arntzen
6d13c99273
Merge pull request #1780 from billhollings/out-of-bounds-swizzle-fix
Per spec, support undefined behavior for out-of-bounds swizzles.
2021-10-20 22:24:18 +02:00
Bill Hollings
595eb0c21d Per spec, support undefined behavior for out-of-bounds swizzles.
Per spec, instead of throwing exception for out-of-bounds swizzles,
engage undefined behavior by defaulting to the .x swizzle.
2021-10-20 14:46:30 -04:00
丛越
597f29d09d Support Metal 2.4 Intersection Query, Implement GL_EXT_ray_query. 2021-10-19 18:45:10 +08:00
Hans-Kristian Arntzen
e4243b898c
Merge pull request #1766 from KhronosGroup/fix-1765
Fix some silly bugs in trivial mix op detection.
2021-10-13 16:46:53 +02:00
Hans-Kristian Arntzen
6382f15470 Test behavior around OpSelect with matrices. 2021-10-13 16:08:29 +02:00
Hans-Kristian Arntzen
6071df5840 Fix wrong detection of trivial_mix_op.
Effectively, only the last component of the select was considered, need
to correctly early out if any case is hit.
2021-10-13 15:34:00 +02:00
Hans-Kristian Arntzen
97a438d214
Merge pull request #1757 from KhronosGroup/fix-1754
Improve handling of INT_MIN/INT64_MIN literals.
2021-09-30 17:04:30 +02:00
Hans-Kristian Arntzen
f72bb3c6f5 Improve handling of INT_MIN/INT64_MIN literals.
We cannot naively convert these to decimal literals. C/C++ (and thus
MSL) has extremely awkward literal promotion rules.
2021-09-30 16:29:30 +02:00
Hans-Kristian Arntzen
457c00bd07
Merge pull request #1756 from KhronosGroup/fix-1753
HLSL: Fix NumWorkgroups for SPIR-V 1.4+
2021-09-30 16:22:51 +02:00
Hans-Kristian Arntzen
91c25e8473
Merge pull request #1755 from KhronosGroup/fix-1751
MSVC: Workaround crtdbg macroing free().
2021-09-30 16:22:34 +02:00
Hans-Kristian Arntzen
9b2a8c7622 HLSL: Ensure synthetic NumWorkgroups variable is considered active.
In SPIR-V 1.4+, active global variables must be marked as such.
2021-09-30 14:39:42 +02:00
Hans-Kristian Arntzen
bb04156d3c CLI/HLSL: Don't set explicit binding for synthesized NumWorkgroups CBV. 2021-09-30 14:30:49 +02:00
Hans-Kristian Arntzen
96d95fbb31 MSVC: Workaround crtdbg macroing free(). 2021-09-30 14:12:08 +02:00
Hans-Kristian Arntzen
9462b90067
Merge pull request #1752 from billhollings/function-constants-opquantize
MSL: Support synthetic functions in function constants.
2021-09-30 14:06:10 +02:00
Hans-Kristian Arntzen
325f107c5b
Merge pull request #1745 from billhollings/location-component-vecsize
MSL: Track location component to match vecsize between shader stages.
2021-09-30 14:02:25 +02:00
Bill Hollings
ec054dad7f MSL: Support synthetic functions in function constants.
Emit synthetic functions before function constants.
Support use of spvQuantizeToF16() in function constants for numerical
behavior consistency with the op code.
Ensure subnormal results from OpQuantizeToF16 are flushed to zero per SPIR-V spec.

Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
Any MSL reference shader that inclues a synthetic function is affected,
since the location it is emitted has changed.
2021-09-28 19:10:16 -04:00
Hans-Kristian Arntzen
dee35bf3ce
Merge pull request #1749 from billhollings/fastmath-quantize
MSL: Honor infinities in OpQuantizeToF16 when compiling using fast-math.
2021-09-27 13:09:33 +02:00
Bill Hollings
ba66a91402 MSL: Use vec<T, n> in template SpvHalfTypeSelector for function spvQuantizeToF16().
Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
2021-09-25 14:36:42 -04:00
Bill Hollings
a2671e35b0 MSL: Consolidate spvQuantizeToF16() functions into a single template function.
Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
2021-09-24 14:41:15 -04:00
Bill Hollings
5742047b24 MSL: Honor infinities in OpQuantizeToF16 when compiling using fast-math.
Add spvQuantizeToF16() family of synthetic functions to convert
from float to half and back again, and add function attribute
[[clang::optnone]] to honor infinities during conversions.

Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
2021-09-24 11:22:05 -04:00
Hans-Kristian Arntzen
05ac99ae23
Merge pull request #1748 from billhollings/fastmath-nocontraction
MSL: Honor DecorationNoContraction when compiling using fast-math.
2021-09-24 12:17:42 +02:00
Bill Hollings
fb3defc9ef MSL: Honor DecorationNoContraction when compiling using fast-math.
Add [[clang::optnone]] attribute to spvF*() functions used for handling
floating point operations decorated with DecorationNoContraction.

Just using precise::fma() did not work.

Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
2021-09-23 14:37:08 -04:00
Bill Hollings
548a23da34 MSL: Track location component to match vecsize between shader stages.
Matching output/input struct member types between shader stages could fail if
a location is shared between members, each using different components of that
location, because the member vecsize was only stored once for the location.

Add MSLShaderInput::component member.
Use LocationComponentPair to key inputs_by_location, instead of just location.
ensure_correct_input_type() pass component value as well as location.
2021-09-23 09:56:04 -04:00
Hans-Kristian Arntzen
fe1af2ae72
Merge pull request #1747 from KhronosGroup/ci-fix
Fix CI
2021-09-23 13:09:38 +02:00
Hans-Kristian Arntzen
d579444a82
Merge pull request #1744 from billhollings/location-attribute-fix
MSL: Fix location and component variable matching between shader stages.
2021-09-23 12:45:02 +02:00
Hans-Kristian Arntzen
6628e10fc6
Merge pull request #1746 from billhollings/fast-math-per-vulkan
MSL: Selectively enable fast-math in MSL code to match Vulkan CTS results.
2021-09-23 12:37:33 +02:00
Hans-Kristian Arntzen
3ca99bbbcc Remove tests for Ubuntu 16.04.
Github Actions nuked support for 16.04 and all CI runs are failing.
2021-09-23 12:33:46 +02:00
Hans-Kristian Arntzen
0f12557695 Remove obsolete Travis CI YML. 2021-09-23 12:32:40 +02:00
Bill Hollings
40141ffddf MSL: Selectively enable fast-math in MSL code to match Vulkan CTS results.
Based on CTS testing, math optimizations between MSL and Vulkan are inconsistent.
In some cases, enabling MSL's fast-math compilation option matches Vulkan's math
results. In other cases, disabling it does. Broadly enabling or disabling fast-math
across all shaders results in some CTS test failures either way.

To fix this, selectively enable/disable fast-math optimizations in the MSL code,
using metal::fast and metal::precise function namespaces, where supported, and
the [[clang::optnone]] function attribute otherwise.

Adjust SPIRV-Cross unit test reference shaders to accommodate these changes.
2021-09-22 18:58:31 -04:00
Bill Hollings
86dfac12c8 MSL: Fix location and component variable matching between shader stages.
Consolidate derivation of Metal 'user(locnL_C)' output/input location
and component attribute qualifier, to establish SVOT across stages.
2021-09-18 18:55:12 -04:00
Hans-Kristian Arntzen
b81334a513
Merge pull request #1738 from billhollings/return-value-after-discard-terminator
MSL: Return fragment function value even when last SPIR-V Op is discard (OpKill).
2021-09-15 11:55:39 +02:00
Bill Hollings
2a150f5a2f MSL: Add explanatory comment requested in PR review. 2021-09-14 14:58:42 -04:00
Bill Hollings
35e92e6ffb MSL: Return fragment function value even when last SPIR-V Op is discard (OpKill).
Add test shader for new functionality.
Add legacy test reference shader for unrelated buffer-bitcast
test, that doesn't seem to have been added previously.
2021-09-12 16:28:21 -04:00
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