tint: Stub intrinsic @const evaluation

Add support for @const to builtins in intrinsics.def.
Propagate this flag through to the intrinsic table.
Handle builtins that are @const annotated in the resolver.

Currently no intrinsics are decorated with @const, so there's nothing to
test (yet).

Bug: tint:1504
Change-Id: I172483688617782bd7c58b70e3f38d0222a5d1af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92323
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton
2022-06-01 23:57:20 +00:00
committed by Dawn LUCI CQ
parent e0cd855aa2
commit 451eee0fed
13 changed files with 814 additions and 262 deletions

View File

@@ -105,6 +105,8 @@ type Overload struct {
IsDeprecated bool
// The kind of overload
Kind string
// The function name used to evaluate the overload at shader-creation time
ConstEvalFunction string
}
// Intrinsic is used to create the C++ IntrinsicInfo structure
@@ -206,6 +208,7 @@ func (b *IntrinsicTableBuilder) buildOverload(o *sem.Overload) (Overload, error)
CanBeUsedInStage: o.CanBeUsedInStage,
IsDeprecated: o.IsDeprecated,
Kind: string(o.Decl.Kind),
ConstEvalFunction: o.ConstEvalFunction,
}, nil
}