intrinsic/gen: Don't permutate impossible workgroup ptr types
Change-Id: I1e6a3436553ca886a52075315d09ff7ef04eb492 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116082 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
parent
a42280fb66
commit
3febbd218f
|
@ -328,17 +328,22 @@ func validate(fqn sem.FullyQualifiedName, uses *sem.StageUses) bool {
|
|||
return false // Builtin, untypeable return type
|
||||
}
|
||||
|
||||
switch fqn.Target.GetName() {
|
||||
case "array":
|
||||
elTy := fqn.TemplateArguments[0].(sem.FullyQualifiedName)
|
||||
isStorable := func(elTy sem.FullyQualifiedName) bool {
|
||||
elTyName := elTy.Target.GetName()
|
||||
switch {
|
||||
case elTyName == "bool" ||
|
||||
case elTyName == "bool",
|
||||
strings.Contains(elTyName, "sampler"),
|
||||
strings.Contains(elTyName, "texture"):
|
||||
return false // Not storable
|
||||
case IsAbstract(DeepestElementType(elTy)):
|
||||
return false // Abstract types are not typeable
|
||||
strings.Contains(elTyName, "texture"),
|
||||
IsAbstract(DeepestElementType(elTy)):
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
switch fqn.Target.GetName() {
|
||||
case "array":
|
||||
if !isStorable(fqn.TemplateArguments[0].(sem.FullyQualifiedName)) {
|
||||
return false
|
||||
}
|
||||
case "ptr":
|
||||
// https://gpuweb.github.io/gpuweb/wgsl/#address-space
|
||||
|
@ -355,6 +360,9 @@ func validate(fqn sem.FullyQualifiedName, uses *sem.StageUses) bool {
|
|||
if access != "read_write" {
|
||||
return false
|
||||
}
|
||||
if !isStorable(fqn.TemplateArguments[1].(sem.FullyQualifiedName)) {
|
||||
return false
|
||||
}
|
||||
case "uniform":
|
||||
if access != "read" {
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue