emit_spirv_atomic.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. // Copyright 2021 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "shader_recompiler/backend/spirv/emit_spirv.h"
  5. #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h"
  6. namespace Shader::Backend::SPIRV {
  7. namespace {
  8. Id SharedPointer(EmitContext& ctx, Id offset, u32 index_offset = 0) {
  9. const Id shift_id{ctx.Const(2U)};
  10. Id index{ctx.OpShiftRightArithmetic(ctx.U32[1], offset, shift_id)};
  11. if (index_offset > 0) {
  12. index = ctx.OpIAdd(ctx.U32[1], index, ctx.Const(index_offset));
  13. }
  14. return ctx.profile.support_explicit_workgroup_layout
  15. ? ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, ctx.u32_zero_value, index)
  16. : ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, index);
  17. }
  18. Id StorageIndex(EmitContext& ctx, const IR::Value& offset, size_t element_size) {
  19. if (offset.IsImmediate()) {
  20. const u32 imm_offset{static_cast<u32>(offset.U32() / element_size)};
  21. return ctx.Const(imm_offset);
  22. }
  23. const u32 shift{static_cast<u32>(std::countr_zero(element_size))};
  24. const Id index{ctx.Def(offset)};
  25. if (shift == 0) {
  26. return index;
  27. }
  28. const Id shift_id{ctx.Const(shift)};
  29. return ctx.OpShiftRightLogical(ctx.U32[1], index, shift_id);
  30. }
  31. Id StoragePointer(EmitContext& ctx, const StorageTypeDefinition& type_def,
  32. Id StorageDefinitions::*member_ptr, const IR::Value& binding,
  33. const IR::Value& offset, size_t element_size) {
  34. if (!binding.IsImmediate()) {
  35. throw NotImplementedException("Dynamic storage buffer indexing");
  36. }
  37. const Id ssbo{ctx.ssbos[binding.U32()].*member_ptr};
  38. const Id index{StorageIndex(ctx, offset, element_size)};
  39. return ctx.OpAccessChain(type_def.element, ssbo, ctx.u32_zero_value, index);
  40. }
  41. std::pair<Id, Id> AtomicArgs(EmitContext& ctx) {
  42. const Id scope{ctx.Const(static_cast<u32>(spv::Scope::Device))};
  43. const Id semantics{ctx.u32_zero_value};
  44. return {scope, semantics};
  45. }
  46. Id SharedAtomicU32(EmitContext& ctx, Id offset, Id value,
  47. Id (Sirit::Module::*atomic_func)(Id, Id, Id, Id, Id)) {
  48. const Id pointer{SharedPointer(ctx, offset)};
  49. const auto [scope, semantics]{AtomicArgs(ctx)};
  50. return (ctx.*atomic_func)(ctx.U32[1], pointer, scope, semantics, value);
  51. }
  52. Id StorageAtomicU32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, Id value,
  53. Id (Sirit::Module::*atomic_func)(Id, Id, Id, Id, Id)) {
  54. const Id pointer{StoragePointer(ctx, ctx.storage_types.U32, &StorageDefinitions::U32, binding,
  55. offset, sizeof(u32))};
  56. const auto [scope, semantics]{AtomicArgs(ctx)};
  57. return (ctx.*atomic_func)(ctx.U32[1], pointer, scope, semantics, value);
  58. }
  59. Id StorageAtomicU64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, Id value,
  60. Id (Sirit::Module::*atomic_func)(Id, Id, Id, Id, Id),
  61. Id (Sirit::Module::*non_atomic_func)(Id, Id, Id)) {
  62. if (ctx.profile.support_int64_atomics) {
  63. const Id pointer{StoragePointer(ctx, ctx.storage_types.U64, &StorageDefinitions::U64,
  64. binding, offset, sizeof(u64))};
  65. const auto [scope, semantics]{AtomicArgs(ctx)};
  66. return (ctx.*atomic_func)(ctx.U64, pointer, scope, semantics, value);
  67. }
  68. LOG_ERROR(Shader_SPIRV, "Int64 atomics not supported, fallback to non-atomic");
  69. const Id pointer{StoragePointer(ctx, ctx.storage_types.U32x2, &StorageDefinitions::U32x2,
  70. binding, offset, sizeof(u32[2]))};
  71. const Id original_value{ctx.OpBitcast(ctx.U64, ctx.OpLoad(ctx.U32[2], pointer))};
  72. const Id result{(ctx.*non_atomic_func)(ctx.U64, value, original_value)};
  73. ctx.OpStore(pointer, ctx.OpBitcast(ctx.U32[2], result));
  74. return original_value;
  75. }
  76. } // Anonymous namespace
  77. Id EmitSharedAtomicIAdd32(EmitContext& ctx, Id offset, Id value) {
  78. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicIAdd);
  79. }
  80. Id EmitSharedAtomicSMin32(EmitContext& ctx, Id offset, Id value) {
  81. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicSMin);
  82. }
  83. Id EmitSharedAtomicUMin32(EmitContext& ctx, Id offset, Id value) {
  84. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicUMin);
  85. }
  86. Id EmitSharedAtomicSMax32(EmitContext& ctx, Id offset, Id value) {
  87. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicSMax);
  88. }
  89. Id EmitSharedAtomicUMax32(EmitContext& ctx, Id offset, Id value) {
  90. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicUMax);
  91. }
  92. Id EmitSharedAtomicInc32(EmitContext& ctx, Id offset, Id value) {
  93. const Id shift_id{ctx.Const(2U)};
  94. const Id index{ctx.OpShiftRightArithmetic(ctx.U32[1], offset, shift_id)};
  95. return ctx.OpFunctionCall(ctx.U32[1], ctx.increment_cas_shared, index, value);
  96. }
  97. Id EmitSharedAtomicDec32(EmitContext& ctx, Id offset, Id value) {
  98. const Id shift_id{ctx.Const(2U)};
  99. const Id index{ctx.OpShiftRightArithmetic(ctx.U32[1], offset, shift_id)};
  100. return ctx.OpFunctionCall(ctx.U32[1], ctx.decrement_cas_shared, index, value);
  101. }
  102. Id EmitSharedAtomicAnd32(EmitContext& ctx, Id offset, Id value) {
  103. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicAnd);
  104. }
  105. Id EmitSharedAtomicOr32(EmitContext& ctx, Id offset, Id value) {
  106. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicOr);
  107. }
  108. Id EmitSharedAtomicXor32(EmitContext& ctx, Id offset, Id value) {
  109. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicXor);
  110. }
  111. Id EmitSharedAtomicExchange32(EmitContext& ctx, Id offset, Id value) {
  112. return SharedAtomicU32(ctx, offset, value, &Sirit::Module::OpAtomicExchange);
  113. }
  114. Id EmitSharedAtomicExchange64(EmitContext& ctx, Id offset, Id value) {
  115. if (ctx.profile.support_int64_atomics && ctx.profile.support_explicit_workgroup_layout) {
  116. const Id shift_id{ctx.Const(3U)};
  117. const Id index{ctx.OpShiftRightArithmetic(ctx.U32[1], offset, shift_id)};
  118. const Id pointer{
  119. ctx.OpAccessChain(ctx.shared_u64, ctx.shared_memory_u64, ctx.u32_zero_value, index)};
  120. const auto [scope, semantics]{AtomicArgs(ctx)};
  121. return ctx.OpAtomicExchange(ctx.U64, pointer, scope, semantics, value);
  122. }
  123. LOG_ERROR(Shader_SPIRV, "Int64 atomics not supported, fallback to non-atomic");
  124. const Id pointer_1{SharedPointer(ctx, offset, 0)};
  125. const Id pointer_2{SharedPointer(ctx, offset, 1)};
  126. const Id value_1{ctx.OpLoad(ctx.U32[1], pointer_1)};
  127. const Id value_2{ctx.OpLoad(ctx.U32[1], pointer_2)};
  128. const Id new_vector{ctx.OpBitcast(ctx.U32[2], value)};
  129. ctx.OpStore(pointer_1, ctx.OpCompositeExtract(ctx.U32[1], new_vector, 0U));
  130. ctx.OpStore(pointer_2, ctx.OpCompositeExtract(ctx.U32[1], new_vector, 1U));
  131. return ctx.OpBitcast(ctx.U64, ctx.OpCompositeConstruct(ctx.U32[2], value_1, value_2));
  132. }
  133. Id EmitStorageAtomicIAdd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  134. Id value) {
  135. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicIAdd);
  136. }
  137. Id EmitStorageAtomicSMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  138. Id value) {
  139. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicSMin);
  140. }
  141. Id EmitStorageAtomicUMin32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  142. Id value) {
  143. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicUMin);
  144. }
  145. Id EmitStorageAtomicSMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  146. Id value) {
  147. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicSMax);
  148. }
  149. Id EmitStorageAtomicUMax32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  150. Id value) {
  151. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicUMax);
  152. }
  153. Id EmitStorageAtomicInc32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  154. Id value) {
  155. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  156. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  157. return ctx.OpFunctionCall(ctx.U32[1], ctx.increment_cas_ssbo, base_index, value, ssbo);
  158. }
  159. Id EmitStorageAtomicDec32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  160. Id value) {
  161. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  162. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  163. return ctx.OpFunctionCall(ctx.U32[1], ctx.decrement_cas_ssbo, base_index, value, ssbo);
  164. }
  165. Id EmitStorageAtomicAnd32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  166. Id value) {
  167. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicAnd);
  168. }
  169. Id EmitStorageAtomicOr32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  170. Id value) {
  171. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicOr);
  172. }
  173. Id EmitStorageAtomicXor32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  174. Id value) {
  175. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicXor);
  176. }
  177. Id EmitStorageAtomicExchange32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  178. Id value) {
  179. return StorageAtomicU32(ctx, binding, offset, value, &Sirit::Module::OpAtomicExchange);
  180. }
  181. Id EmitStorageAtomicIAdd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  182. Id value) {
  183. return StorageAtomicU64(ctx, binding, offset, value, &Sirit::Module::OpAtomicIAdd,
  184. &Sirit::Module::OpIAdd);
  185. }
  186. Id EmitStorageAtomicSMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  187. Id value) {
  188. return StorageAtomicU64(ctx, binding, offset, value, &Sirit::Module::OpAtomicSMin,
  189. &Sirit::Module::OpSMin);
  190. }
  191. Id EmitStorageAtomicUMin64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  192. Id value) {
  193. return StorageAtomicU64(ctx, binding, offset, value, &Sirit::Module::OpAtomicUMin,
  194. &Sirit::Module::OpUMin);
  195. }
  196. Id EmitStorageAtomicSMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  197. Id value) {
  198. return StorageAtomicU64(ctx, binding, offset, value, &Sirit::Module::OpAtomicSMax,
  199. &Sirit::Module::OpSMax);
  200. }
  201. Id EmitStorageAtomicUMax64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  202. Id value) {
  203. return StorageAtomicU64(ctx, binding, offset, value, &Sirit::Module::OpAtomicUMax,
  204. &Sirit::Module::OpUMax);
  205. }
  206. Id EmitStorageAtomicAnd64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  207. Id value) {
  208. return StorageAtomicU64(ctx, binding, offset, value, &Sirit::Module::OpAtomicAnd,
  209. &Sirit::Module::OpBitwiseAnd);
  210. }
  211. Id EmitStorageAtomicOr64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  212. Id value) {
  213. return StorageAtomicU64(ctx, binding, offset, value, &Sirit::Module::OpAtomicOr,
  214. &Sirit::Module::OpBitwiseOr);
  215. }
  216. Id EmitStorageAtomicXor64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  217. Id value) {
  218. return StorageAtomicU64(ctx, binding, offset, value, &Sirit::Module::OpAtomicXor,
  219. &Sirit::Module::OpBitwiseXor);
  220. }
  221. Id EmitStorageAtomicExchange64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  222. Id value) {
  223. if (ctx.profile.support_int64_atomics) {
  224. const Id pointer{StoragePointer(ctx, ctx.storage_types.U64, &StorageDefinitions::U64,
  225. binding, offset, sizeof(u64))};
  226. const auto [scope, semantics]{AtomicArgs(ctx)};
  227. return ctx.OpAtomicExchange(ctx.U64, pointer, scope, semantics, value);
  228. }
  229. LOG_ERROR(Shader_SPIRV, "Int64 atomics not supported, fallback to non-atomic");
  230. const Id pointer{StoragePointer(ctx, ctx.storage_types.U32x2, &StorageDefinitions::U32x2,
  231. binding, offset, sizeof(u32[2]))};
  232. const Id original{ctx.OpBitcast(ctx.U64, ctx.OpLoad(ctx.U32[2], pointer))};
  233. ctx.OpStore(pointer, value);
  234. return original;
  235. }
  236. Id EmitStorageAtomicAddF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  237. Id value) {
  238. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  239. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  240. return ctx.OpFunctionCall(ctx.F32[1], ctx.f32_add_cas, base_index, value, ssbo);
  241. }
  242. Id EmitStorageAtomicAddF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  243. Id value) {
  244. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  245. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  246. const Id result{ctx.OpFunctionCall(ctx.F16[2], ctx.f16x2_add_cas, base_index, value, ssbo)};
  247. return ctx.OpBitcast(ctx.U32[1], result);
  248. }
  249. Id EmitStorageAtomicAddF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  250. Id value) {
  251. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  252. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  253. const Id result{ctx.OpFunctionCall(ctx.F32[2], ctx.f32x2_add_cas, base_index, value, ssbo)};
  254. return ctx.OpPackHalf2x16(ctx.U32[1], result);
  255. }
  256. Id EmitStorageAtomicMinF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  257. Id value) {
  258. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  259. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  260. const Id result{ctx.OpFunctionCall(ctx.F16[2], ctx.f16x2_min_cas, base_index, value, ssbo)};
  261. return ctx.OpBitcast(ctx.U32[1], result);
  262. }
  263. Id EmitStorageAtomicMinF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  264. Id value) {
  265. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  266. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  267. const Id result{ctx.OpFunctionCall(ctx.F32[2], ctx.f32x2_min_cas, base_index, value, ssbo)};
  268. return ctx.OpPackHalf2x16(ctx.U32[1], result);
  269. }
  270. Id EmitStorageAtomicMaxF16x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  271. Id value) {
  272. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  273. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  274. const Id result{ctx.OpFunctionCall(ctx.F16[2], ctx.f16x2_max_cas, base_index, value, ssbo)};
  275. return ctx.OpBitcast(ctx.U32[1], result);
  276. }
  277. Id EmitStorageAtomicMaxF32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
  278. Id value) {
  279. const Id ssbo{ctx.ssbos[binding.U32()].U32};
  280. const Id base_index{StorageIndex(ctx, offset, sizeof(u32))};
  281. const Id result{ctx.OpFunctionCall(ctx.F32[2], ctx.f32x2_max_cas, base_index, value, ssbo)};
  282. return ctx.OpPackHalf2x16(ctx.U32[1], result);
  283. }
  284. Id EmitGlobalAtomicIAdd32(EmitContext&) {
  285. throw NotImplementedException("SPIR-V Instruction");
  286. }
  287. Id EmitGlobalAtomicSMin32(EmitContext&) {
  288. throw NotImplementedException("SPIR-V Instruction");
  289. }
  290. Id EmitGlobalAtomicUMin32(EmitContext&) {
  291. throw NotImplementedException("SPIR-V Instruction");
  292. }
  293. Id EmitGlobalAtomicSMax32(EmitContext&) {
  294. throw NotImplementedException("SPIR-V Instruction");
  295. }
  296. Id EmitGlobalAtomicUMax32(EmitContext&) {
  297. throw NotImplementedException("SPIR-V Instruction");
  298. }
  299. Id EmitGlobalAtomicInc32(EmitContext&) {
  300. throw NotImplementedException("SPIR-V Instruction");
  301. }
  302. Id EmitGlobalAtomicDec32(EmitContext&) {
  303. throw NotImplementedException("SPIR-V Instruction");
  304. }
  305. Id EmitGlobalAtomicAnd32(EmitContext&) {
  306. throw NotImplementedException("SPIR-V Instruction");
  307. }
  308. Id EmitGlobalAtomicOr32(EmitContext&) {
  309. throw NotImplementedException("SPIR-V Instruction");
  310. }
  311. Id EmitGlobalAtomicXor32(EmitContext&) {
  312. throw NotImplementedException("SPIR-V Instruction");
  313. }
  314. Id EmitGlobalAtomicExchange32(EmitContext&) {
  315. throw NotImplementedException("SPIR-V Instruction");
  316. }
  317. Id EmitGlobalAtomicIAdd64(EmitContext&) {
  318. throw NotImplementedException("SPIR-V Instruction");
  319. }
  320. Id EmitGlobalAtomicSMin64(EmitContext&) {
  321. throw NotImplementedException("SPIR-V Instruction");
  322. }
  323. Id EmitGlobalAtomicUMin64(EmitContext&) {
  324. throw NotImplementedException("SPIR-V Instruction");
  325. }
  326. Id EmitGlobalAtomicSMax64(EmitContext&) {
  327. throw NotImplementedException("SPIR-V Instruction");
  328. }
  329. Id EmitGlobalAtomicUMax64(EmitContext&) {
  330. throw NotImplementedException("SPIR-V Instruction");
  331. }
  332. Id EmitGlobalAtomicInc64(EmitContext&) {
  333. throw NotImplementedException("SPIR-V Instruction");
  334. }
  335. Id EmitGlobalAtomicDec64(EmitContext&) {
  336. throw NotImplementedException("SPIR-V Instruction");
  337. }
  338. Id EmitGlobalAtomicAnd64(EmitContext&) {
  339. throw NotImplementedException("SPIR-V Instruction");
  340. }
  341. Id EmitGlobalAtomicOr64(EmitContext&) {
  342. throw NotImplementedException("SPIR-V Instruction");
  343. }
  344. Id EmitGlobalAtomicXor64(EmitContext&) {
  345. throw NotImplementedException("SPIR-V Instruction");
  346. }
  347. Id EmitGlobalAtomicExchange64(EmitContext&) {
  348. throw NotImplementedException("SPIR-V Instruction");
  349. }
  350. Id EmitGlobalAtomicAddF32(EmitContext&) {
  351. throw NotImplementedException("SPIR-V Instruction");
  352. }
  353. Id EmitGlobalAtomicAddF16x2(EmitContext&) {
  354. throw NotImplementedException("SPIR-V Instruction");
  355. }
  356. Id EmitGlobalAtomicAddF32x2(EmitContext&) {
  357. throw NotImplementedException("SPIR-V Instruction");
  358. }
  359. Id EmitGlobalAtomicMinF16x2(EmitContext&) {
  360. throw NotImplementedException("SPIR-V Instruction");
  361. }
  362. Id EmitGlobalAtomicMinF32x2(EmitContext&) {
  363. throw NotImplementedException("SPIR-V Instruction");
  364. }
  365. Id EmitGlobalAtomicMaxF16x2(EmitContext&) {
  366. throw NotImplementedException("SPIR-V Instruction");
  367. }
  368. Id EmitGlobalAtomicMaxF32x2(EmitContext&) {
  369. throw NotImplementedException("SPIR-V Instruction");
  370. }
  371. } // namespace Shader::Backend::SPIRV