dawn-cmake/test/tint/builtins/gen/literal
James Price 4d3af66bbd tint/msl: Preserve trailing vec3 padding
In order to preserve padding properly for MSL, we need to use its
packed_vec type for all vec3 types in storage buffers, not just struct
members. This commit includes a complete rewrite of the PackedVec3
transform to achieve this. The key details are:

* An internal `__packed_vec3<>` type was added, which corresponds to a
  `type::Vector` with an additional flag to indicate that it will be
  emitted as packed vector.

* The `PackedVec3` transform replaces all vec3 types used in
  host-shareable address spaces with the internal `__packed_vec3`
  type. This includes vec3 types that appear as the store type of a
  pointer.

* When used as an array element, these `__packed_vec3` types are
  wrapped in a struct that contains a single `__packed_vec3`
  member. This allows us to add an `@align()` attribute that ensures
  that `array<vec3<T>>` still has the correct array element stride.

* When the `vec3<T>` appears as a struct member in the input program,
  we apply the `@align()` to that member to ensure that we do not
  change its offset.

* Matrix types with three rows that are used in memory are replaced
  with an array of columns, where each column uses a `__packed_vec3`
  inside an aligned wrapper structure as above.

* Accesses to host-shareable memory that involve any of these types
  invoke a "pack" or "unpack" helper function to convert them to the
  equivalent type that uses `__packed_vec3` or a regular `vec3` as
  required.

* The `chromium_internal_relaxed_uniform_layout` extension is used to
  avoid issues where modifying a type in the uniform address space
  triggers stricter layout validation rules.

Bug: tint:1571
Fixed: tint:1837
Change-Id: Idaf2da2f5bcb2be00c85ec657edfb614186476bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/121200
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-02-27 20:21:03 +00:00
..
abs Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
acos Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
acosh Implement const-eval for `acosh` 2022-11-10 02:39:08 +00:00
all Add const-eval for `all`. 2022-11-03 12:07:49 +00:00
any Add const-eval for `any`. 2022-10-29 16:21:24 +00:00
arrayLength Tint: Implement f16 in uniform and storage address space 2022-11-24 05:25:35 +00:00
asin Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
asinh Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
atan Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
atan2 Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
atanh Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
atomicAdd tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicAnd tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicCompareExchangeWeak tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicExchange tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicLoad tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicMax tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicMin tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicOr tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicStore tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicSub tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
atomicXor tint/transform: Inline HLSL uniform / storage buffers 2023-02-24 17:16:55 +00:00
ceil Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
clamp Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
cos Add const-eval for `cos` and `cosh` 2022-11-10 15:52:41 +00:00
cosh Add const-eval for `cos` and `cosh` 2022-11-10 15:52:41 +00:00
countLeadingZeros tint: const eval of countLeadingZeros 2022-10-29 14:02:38 +00:00
countOneBits tint: const eval of countOneBits 2022-10-31 18:44:15 +00:00
countTrailingZeros tint: const eval of countTrailingZeros 2022-10-29 14:02:38 +00:00
cross Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
degrees Add const-eval for `degrees` and `radians` 2022-11-21 18:00:01 +00:00
determinant tint: const eval of determinant builtin 2022-11-23 19:16:15 +00:00
distance Const eval for `distance` 2022-11-24 21:48:48 +00:00
dot tint: const eval of dot builtin 2022-11-22 15:02:55 +00:00
dot4I8Packed tint: Allow signed / unsigned texture builtin params 2022-10-24 23:58:53 +00:00
dot4U8Packed tint: Allow signed / unsigned texture builtin params 2022-10-24 23:58:53 +00:00
dpdx test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
dpdxCoarse test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
dpdxFine test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
dpdy test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
dpdyCoarse test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
dpdyFine test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
exp Add const-eval for `exp` and `exp2`. 2022-11-23 16:37:21 +00:00
exp2 Add const-eval for `exp` and `exp2`. 2022-11-23 16:37:21 +00:00
extractBits tint: const eval of extractBits 2022-11-03 13:03:08 +00:00
faceForward tint: const eval of faceForward builtin 2022-11-25 23:35:53 +00:00
firstLeadingBit tint: const eval of firstLeadingBit 2022-10-31 20:34:36 +00:00
firstTrailingBit tint: const eval of firstTrailingBit 2022-10-31 22:57:14 +00:00
floor Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
fma Const eval for `fma` 2022-11-24 21:54:00 +00:00
fract tint: const eval of fract 2022-12-13 23:59:45 +00:00
frexp tint: Suffix builtin return types with '_f32' 2022-11-23 19:57:00 +00:00
fwidth test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
fwidthCoarse test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
fwidthFine test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
insertBits tint: const eval of insertBits 2022-11-02 20:40:23 +00:00
inverseSqrt Const eval for `inverseSqrt` 2022-11-24 18:16:13 +00:00
ldexp tint: const eval of ldexp builtin 2022-12-16 18:37:19 +00:00
length tint: const eval of length builtin 2022-11-23 00:00:45 +00:00
log Add const-eval for `log` and `log2`. 2022-11-23 17:34:40 +00:00
log2 Add const-eval for `log` and `log2`. 2022-11-23 17:34:40 +00:00
max Add const-eval for `min` and `max` 2022-11-15 18:39:38 +00:00
min Add const-eval for `min` and `max` 2022-11-15 18:39:38 +00:00
mix tint: const eval of mix builtin 2022-12-12 15:31:21 +00:00
modf tint: Suffix builtin return types with '_f32' 2022-11-23 19:57:00 +00:00
normalize Const eval for `normalize` 2022-11-25 04:25:18 +00:00
pack2x16float Add const-eval for pack and unpack of 2x16float. 2022-11-09 20:04:37 +00:00
pack2x16snorm Implemement const-eval for some pack routines. 2022-11-07 14:32:16 +00:00
pack2x16unorm Implemement const-eval for some pack routines. 2022-11-07 14:32:16 +00:00
pack4x8snorm Implemement const-eval for some pack routines. 2022-11-07 14:32:16 +00:00
pack4x8unorm Implemement const-eval for some pack routines. 2022-11-07 14:32:16 +00:00
pow tint: const eval of pow builtin 2022-12-13 16:29:06 +00:00
quantizeToF16 tint: Implement const-eval of quantizeToF16 2022-11-02 17:29:48 +00:00
radians Add const-eval for `degrees` and `radians` 2022-11-21 18:00:01 +00:00
reflect tint: const eval of reflect builtin 2022-11-28 15:13:16 +00:00
refract tint: const eval of refract builtin 2022-11-28 21:14:36 +00:00
reverseBits tint: const eval of reverseBits 2022-11-04 13:48:26 +00:00
round Add const-eval for `round` 2022-11-16 22:52:08 +00:00
saturate Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
select Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
sign tint: Implement signed-int overloads of sign() 2022-12-07 19:52:49 +00:00
sin tint: Use PI/2 as the input value for sin tests 2023-02-24 18:57:39 +00:00
sinh Add const-eval for `sin` and `sinh` 2022-11-10 14:20:36 +00:00
smoothstep Add const-eval for `smoothstep` 2022-11-16 23:02:39 +00:00
sqrt Add const-eval for `sqrt` 2022-11-16 21:15:49 +00:00
step Fix generation of f16 values. 2022-11-10 00:32:12 +00:00
storageBarrier test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
tan Add const-eval for `tan` and `tanh` 2022-11-10 15:55:00 +00:00
tanh Add const-eval for `tan` and `tanh` 2022-11-10 15:55:00 +00:00
textureDimensions tint/msl: Preserve trailing vec3 padding 2023-02-27 20:21:03 +00:00
textureGather Update GLSL test results. 2022-12-15 16:42:28 +00:00
textureGatherCompare Update GLSL test results. 2022-12-15 16:42:28 +00:00
textureLoad tint/msl: Preserve trailing vec3 padding 2023-02-27 20:21:03 +00:00
textureNumLayers tint: Add bgra8unorm storage texture support 2023-01-18 19:42:03 +00:00
textureNumLevels Enable the 1D -> 2D texture transform in GLSL writer. 2023-01-07 17:19:21 +00:00
textureNumSamples tint/intrinsics: Texture queries now return unsigned integer / vectors 2022-10-26 18:36:44 +00:00
textureSample Enable the 1D -> 2D texture transform in GLSL writer. 2023-01-07 17:19:21 +00:00
textureSampleBaseClampToEdge tint/msl: Preserve trailing vec3 padding 2023-02-27 20:21:03 +00:00
textureSampleBias Update GLSL test results. 2022-12-15 16:42:28 +00:00
textureSampleCompare Update GLSL test results. 2022-12-15 16:42:28 +00:00
textureSampleCompareLevel Update GLSL test results. 2022-12-15 16:42:28 +00:00
textureSampleGrad Update GLSL test results. 2022-12-15 16:42:28 +00:00
textureSampleLevel Update GLSL test results. 2022-12-15 16:42:28 +00:00
textureStore tint: Add bgra8unorm storage texture support 2023-01-18 19:42:03 +00:00
transpose tint: const eval of transpose builtin 2022-11-23 23:12:56 +00:00
trunc Add const-eval for `trunc` 2022-11-16 20:07:31 +00:00
unpack2x16float Add const-eval for pack and unpack of 2x16float. 2022-11-09 20:04:37 +00:00
unpack2x16snorm Implemement const-eval for some unpack routines. 2022-11-07 22:28:01 +00:00
unpack2x16unorm Implemement const-eval for some unpack routines. 2022-11-07 22:28:01 +00:00
unpack4x8snorm Implemement const-eval for some unpack routines. 2022-11-07 22:28:01 +00:00
unpack4x8unorm Implemement const-eval for some unpack routines. 2022-11-07 22:28:01 +00:00
workgroupBarrier test/tint: Regenerate expectations 2022-07-26 17:16:15 +00:00
workgroupUniformLoad tint: Add support for workgroupUniformLoad 2023-01-06 02:25:06 +00:00