mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 17:35:30 +00:00
Implement atomicSub intrinsic
Polyfill this for HLSL using an atomic add with the operand negated. Fixed: tint:1130 Change-Id: Ifa32d58973f1b48593ec0f6320f47f4358a5a3a9 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/62760 Auto-Submit: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
a96dce9c89
commit
f9d19719fd
@@ -91,6 +91,7 @@ bool IsAtomicIntrinsic(IntrinsicType i) {
|
||||
return i == sem::IntrinsicType::kAtomicLoad ||
|
||||
i == sem::IntrinsicType::kAtomicStore ||
|
||||
i == sem::IntrinsicType::kAtomicAdd ||
|
||||
i == sem::IntrinsicType::kAtomicSub ||
|
||||
i == sem::IntrinsicType::kAtomicMax ||
|
||||
i == sem::IntrinsicType::kAtomicMin ||
|
||||
i == sem::IntrinsicType::kAtomicAnd ||
|
||||
|
||||
@@ -303,6 +303,9 @@ IntrinsicType ParseIntrinsicType(const std::string& name) {
|
||||
if (name == "atomicAdd") {
|
||||
return IntrinsicType::kAtomicAdd;
|
||||
}
|
||||
if (name == "atomicSub") {
|
||||
return IntrinsicType::kAtomicSub;
|
||||
}
|
||||
if (name == "atomicMax") {
|
||||
return IntrinsicType::kAtomicMax;
|
||||
}
|
||||
@@ -513,6 +516,8 @@ const char* str(IntrinsicType i) {
|
||||
return "atomicStore";
|
||||
case IntrinsicType::kAtomicAdd:
|
||||
return "atomicAdd";
|
||||
case IntrinsicType::kAtomicSub:
|
||||
return "atomicSub";
|
||||
case IntrinsicType::kAtomicMax:
|
||||
return "atomicMax";
|
||||
case IntrinsicType::kAtomicMin:
|
||||
|
||||
@@ -125,6 +125,7 @@ enum class IntrinsicType {
|
||||
kAtomicLoad,
|
||||
kAtomicStore,
|
||||
kAtomicAdd,
|
||||
kAtomicSub,
|
||||
kAtomicMax,
|
||||
kAtomicMin,
|
||||
kAtomicAnd,
|
||||
|
||||
Reference in New Issue
Block a user