mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
GLSL: implement abs() on unsigned arguments.
It's a no-op. Bug: tint:1458 Change-Id: Ib97c409fd806da1c97ac867f21ef42b8a18c178c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/82364 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
committed by
Tint LUCI CQ
parent
b4c338ff37
commit
628289e17d
@@ -684,6 +684,11 @@ bool GeneratorImpl::EmitBuiltinCall(std::ostream& out,
|
||||
if (builtin->Type() == sem::BuiltinType::kFma && version_.IsES()) {
|
||||
return EmitEmulatedFMA(out, expr);
|
||||
}
|
||||
if (builtin->Type() == sem::BuiltinType::kAbs &&
|
||||
TypeOf(expr->args[0])->UnwrapRef()->is_unsigned_scalar_or_vector()) {
|
||||
// GLSL does not support abs() on unsigned arguments. However, it's a no-op.
|
||||
return EmitExpression(out, expr->args[0]);
|
||||
}
|
||||
if (builtin->IsBarrier()) {
|
||||
return EmitBarrierCall(out, builtin);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user