test/tint/builtins/gen: Use returned value

It appears that FXC and DXC do some validation post dead-code-elimination.
These tests have been updated so that the return value is assigned to a storage buffer, ensuring that all validation is performed.

Many DXC tests are affected by https://github.com/microsoft/DirectXShaderCompiler/issues/5082, which have been SKIP'ed.

Fixed: tint:1859
Change-Id: I0001a9a9821846cd0855c3d8ce2bec79ab8e64ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122662
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2023-03-06 18:25:08 +00:00
committed by Dawn LUCI CQ
parent a753ad47a4
commit 77a90cb796
15767 changed files with 166376 additions and 76950 deletions

View File

@@ -360,6 +360,7 @@ func generate(tmpl string, cache *genCache, w io.Writer, writeFile WriteFile) er
"DeepestElementType": gen.DeepestElementType,
"IsAbstract": gen.IsAbstract,
"IsDeclarable": gen.IsDeclarable,
"IsHostShareable": gen.IsHostShareable,
"OverloadUsesF16": gen.OverloadUsesF16,
"IsFirstIn": isFirstIn,
"IsLastIn": isLastIn,

View File

@@ -477,6 +477,10 @@ func DeepestElementType(fqn sem.FullyQualifiedName) sem.FullyQualifiedName {
return fqn.TemplateArguments[0].(sem.FullyQualifiedName)
case "vec":
return fqn.TemplateArguments[1].(sem.FullyQualifiedName)
case "mat2x2", "mat2x3", "mat2x4",
"mat3x2", "mat3x3", "mat3x4",
"mat4x2", "mat4x3", "mat4x4":
return DeepestElementType(fqn.TemplateArguments[0].(sem.FullyQualifiedName))
case "mat":
return DeepestElementType(fqn.TemplateArguments[2].(sem.FullyQualifiedName))
case "array":
@@ -503,6 +507,12 @@ func IsDeclarable(fqn sem.FullyQualifiedName) bool {
return !IsAbstract(DeepestElementType(fqn)) && !strings.HasPrefix(fqn.Target.GetName(), "_")
}
// IsHostShareable returns true if the FullyQualifiedName refers to a type that is host-sharable.
// See https://www.w3.org/TR/WGSL/#host-shareable-types
func IsHostShareable(fqn sem.FullyQualifiedName) bool {
return IsDeclarable(fqn) && DeepestElementType(fqn).Target.GetName() != "bool"
}
// OverloadUsesF16 returns true if the overload uses the f16 type anywhere in the signature.
func OverloadUsesF16(overload sem.Overload) bool {
for _, param := range overload.Parameters {