early-access version 2711

This commit is contained in:
pineappleEA
2022-04-29 07:46:31 +02:00
parent 7970248ccc
commit 0fb3af99e2
40 changed files with 110 additions and 362 deletions

View File

@@ -125,6 +125,12 @@ public:
/// Returns type integer.
Id TypeInt(int width, bool is_signed);
/// Returns type signed integer.
Id TypeSInt(int width);
/// Returns type unsigned integer.
Id TypeUInt(int width);
/// Returns type float.
Id TypeFloat(int width);

View File

@@ -28,6 +28,14 @@ Id Module::TypeInt(int width, bool is_signed) {
return *declarations << OpId{spv::Op::OpTypeInt} << width << is_signed << EndOp{};
}
Id Module::TypeSInt(int width) {
return TypeInt(width, true);
}
Id Module::TypeUInt(int width) {
return TypeInt(width, false);
}
Id Module::TypeFloat(int width) {
declarations->Reserve(3);
return *declarations << OpId{spv::Op::OpTypeFloat} << width << EndOp{};

View File

@@ -15,6 +15,7 @@
#include <unordered_map>
#include <variant>
#include <vector>
#include <utility>
#ifndef __cpp_lib_bit_cast
#include <cstring>