aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMai <[email protected]>2023-05-09 17:33:04 -0400
committerGitHub <[email protected]>2023-05-09 17:33:04 -0400
commit4ab79a8c023aa63caaa93848b09b9fe8b183b1a9 (patch)
tree2f7269d62d5cc3c8bb0b82de587e3fb43ce3a1fb /src
parentab75463999f4f3291976b079d42d52ee91eebf3f (diff)
parent18c37509fa44b8c6e4543b5d429fbae5d8fe4e5d (diff)
downloadsirit-4ab79a8c023aa63caaa93848b09b9fe8b183b1a9.tar.gz
sirit-4ab79a8c023aa63caaa93848b09b9fe8b183b1a9.zip
Merge pull request #2 from GPUCode/masterHEADmaster
Implement required ops for Citra
Diffstat (limited to 'src')
-rw-r--r--src/instructions/arithmetic.cpp2
-rw-r--r--src/instructions/extension.cpp4
-rw-r--r--src/instructions/memory.cpp6
-rw-r--r--src/stream.h1
4 files changed, 13 insertions, 0 deletions
diff --git a/src/instructions/arithmetic.cpp b/src/instructions/arithmetic.cpp
index 4fa8057..ab62177 100644
--- a/src/instructions/arithmetic.cpp
+++ b/src/instructions/arithmetic.cpp
@@ -40,5 +40,7 @@ DEFINE_BINARY(OpFMod, spv::Op::OpFMod)
DEFINE_BINARY(OpSRem, spv::Op::OpSRem)
DEFINE_BINARY(OpFRem, spv::Op::OpFRem)
DEFINE_BINARY(OpIAddCarry, spv::Op::OpIAddCarry)
+DEFINE_BINARY(OpVectorTimesScalar, spv::Op::OpVectorTimesScalar)
+DEFINE_BINARY(OpDot, spv::Op::OpDot)
} // namespace Sirit
diff --git a/src/instructions/extension.cpp b/src/instructions/extension.cpp
index 9f7aa43..005c189 100644
--- a/src/instructions/extension.cpp
+++ b/src/instructions/extension.cpp
@@ -72,5 +72,9 @@ DEFINE_UNARY(OpFindUMsb, GLSLstd450FindUMsb)
DEFINE_UNARY(OpInterpolateAtCentroid, GLSLstd450InterpolateAtCentroid)
DEFINE_BINARY(OpInterpolateAtSample, GLSLstd450InterpolateAtSample)
DEFINE_BINARY(OpInterpolateAtOffset, GLSLstd450InterpolateAtOffset)
+DEFINE_UNARY(OpNormalize, GLSLstd450Normalize)
+DEFINE_BINARY(OpCross, GLSLstd450Cross)
+DEFINE_UNARY(OpLength, GLSLstd450Length)
+DEFINE_TRINARY(OpFMix, GLSLstd450FMix)
} // namespace Sirit
diff --git a/src/instructions/memory.cpp b/src/instructions/memory.cpp
index a542e9f..68f0154 100644
--- a/src/instructions/memory.cpp
+++ b/src/instructions/memory.cpp
@@ -46,6 +46,12 @@ Id Module::OpVectorInsertDynamic(Id result_type, Id vector, Id component, Id ind
<< index << EndOp{};
}
+Id Module::OpVectorShuffle(Id result_type, Id vector_1, Id vector_2, std::span<const Literal> components) {
+ code->Reserve(5 + components.size());
+ return *code << OpId{spv::Op::OpVectorShuffle, result_type} << vector_1 << vector_2
+ << components << EndOp{};
+}
+
Id Module::OpCompositeInsert(Id result_type, Id object, Id composite,
std::span<const Literal> indexes) {
code->Reserve(5 + indexes.size());
diff --git a/src/stream.h b/src/stream.h
index 7029b6c..bf9e48a 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -11,6 +11,7 @@
#include <concepts>
#include <cstddef>
#include <functional>
+#include <span>
#include <string_view>
#include <unordered_map>
#include <variant>