emit_spirv_atomic.cpp 18 KB

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