emit_glsl_integer.cpp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. // Copyright 2021 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <string_view>
  5. #include "shader_recompiler/backend/glsl/emit_context.h"
  6. #include "shader_recompiler/backend/glsl/emit_glsl_instructions.h"
  7. #include "shader_recompiler/frontend/ir/value.h"
  8. #include "shader_recompiler/profile.h"
  9. namespace Shader::Backend::GLSL {
  10. void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  11. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  12. ctx.AddU32("{}={}+{};", inst, a, b);
  13. }
  14. void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  15. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  16. throw NotImplementedException("GLSL Instruction");
  17. }
  18. void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  19. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  20. throw NotImplementedException("GLSL Instruction");
  21. }
  22. void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  23. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  24. throw NotImplementedException("GLSL Instruction");
  25. }
  26. void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  27. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  28. throw NotImplementedException("GLSL Instruction");
  29. }
  30. void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  31. [[maybe_unused]] std::string value) {
  32. ctx.AddU32("{}=-{};", inst, value);
  33. }
  34. void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  35. [[maybe_unused]] std::string value) {
  36. throw NotImplementedException("GLSL Instruction");
  37. }
  38. void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  39. [[maybe_unused]] std::string value) {
  40. throw NotImplementedException("GLSL Instruction");
  41. }
  42. void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  43. [[maybe_unused]] std::string value) {
  44. throw NotImplementedException("GLSL Instruction");
  45. }
  46. void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  47. [[maybe_unused]] std::string base, [[maybe_unused]] std::string shift) {
  48. throw NotImplementedException("GLSL Instruction");
  49. }
  50. void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  51. [[maybe_unused]] std::string base, [[maybe_unused]] std::string shift) {
  52. throw NotImplementedException("GLSL Instruction");
  53. }
  54. void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  55. [[maybe_unused]] std::string base,
  56. [[maybe_unused]] std::string shift) {
  57. throw NotImplementedException("GLSL Instruction");
  58. }
  59. void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  60. [[maybe_unused]] std::string base,
  61. [[maybe_unused]] std::string shift) {
  62. throw NotImplementedException("GLSL Instruction");
  63. }
  64. void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  65. [[maybe_unused]] std::string base,
  66. [[maybe_unused]] std::string shift) {
  67. throw NotImplementedException("GLSL Instruction");
  68. }
  69. void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  70. [[maybe_unused]] std::string base,
  71. [[maybe_unused]] std::string shift) {
  72. throw NotImplementedException("GLSL Instruction");
  73. }
  74. void EmitBitwiseAnd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  75. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  76. throw NotImplementedException("GLSL Instruction");
  77. }
  78. void EmitBitwiseOr32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  79. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  80. throw NotImplementedException("GLSL Instruction");
  81. }
  82. void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  83. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  84. throw NotImplementedException("GLSL Instruction");
  85. }
  86. void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  87. [[maybe_unused]] std::string base, [[maybe_unused]] std::string insert,
  88. [[maybe_unused]] std::string offset, std::string count) {
  89. throw NotImplementedException("GLSL Instruction");
  90. }
  91. void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  92. [[maybe_unused]] std::string base, [[maybe_unused]] std::string offset,
  93. std::string count) {
  94. throw NotImplementedException("GLSL Instruction");
  95. }
  96. void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  97. [[maybe_unused]] std::string base, [[maybe_unused]] std::string offset,
  98. std::string count) {
  99. throw NotImplementedException("GLSL Instruction");
  100. }
  101. void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  102. [[maybe_unused]] std::string value) {
  103. throw NotImplementedException("GLSL Instruction");
  104. }
  105. void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  106. [[maybe_unused]] std::string value) {
  107. throw NotImplementedException("GLSL Instruction");
  108. }
  109. void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  110. [[maybe_unused]] std::string value) {
  111. throw NotImplementedException("GLSL Instruction");
  112. }
  113. void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  114. [[maybe_unused]] std::string value) {
  115. throw NotImplementedException("GLSL Instruction");
  116. }
  117. void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  118. [[maybe_unused]] std::string value) {
  119. throw NotImplementedException("GLSL Instruction");
  120. }
  121. void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  122. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  123. throw NotImplementedException("GLSL Instruction");
  124. }
  125. void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  126. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  127. throw NotImplementedException("GLSL Instruction");
  128. }
  129. void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  130. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  131. throw NotImplementedException("GLSL Instruction");
  132. }
  133. void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  134. [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
  135. throw NotImplementedException("GLSL Instruction");
  136. }
  137. void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  138. [[maybe_unused]] std::string value, [[maybe_unused]] std::string min,
  139. std::string max) {
  140. throw NotImplementedException("GLSL Instruction");
  141. }
  142. void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  143. [[maybe_unused]] std::string value, [[maybe_unused]] std::string min,
  144. std::string max) {
  145. throw NotImplementedException("GLSL Instruction");
  146. }
  147. void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  148. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  149. throw NotImplementedException("GLSL Instruction");
  150. }
  151. void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  152. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  153. throw NotImplementedException("GLSL Instruction");
  154. }
  155. void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  156. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  157. throw NotImplementedException("GLSL Instruction");
  158. }
  159. void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  160. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  161. throw NotImplementedException("GLSL Instruction");
  162. }
  163. void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  164. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  165. throw NotImplementedException("GLSL Instruction");
  166. }
  167. void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  168. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  169. throw NotImplementedException("GLSL Instruction");
  170. }
  171. void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  172. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  173. throw NotImplementedException("GLSL Instruction");
  174. }
  175. void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  176. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  177. throw NotImplementedException("GLSL Instruction");
  178. }
  179. void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  180. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  181. throw NotImplementedException("GLSL Instruction");
  182. }
  183. void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
  184. [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
  185. throw NotImplementedException("GLSL Instruction");
  186. }
  187. } // namespace Shader::Backend::GLSL