suyu/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp

66 lines
1.6 KiB
C++
Raw Normal View History

2021-02-08 06:54:35 +01:00
// Copyright 2021 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "shader_recompiler/backend/spirv/emit_spirv.h"
namespace Shader::Backend::SPIRV {
2021-02-17 04:59:28 +01:00
void EmitBitCastU16F16(EmitContext&) {
2021-02-08 06:54:35 +01:00
throw NotImplementedException("SPIR-V Instruction");
}
2021-02-17 04:59:28 +01:00
Id EmitBitCastU32F32(EmitContext& ctx, Id value) {
2021-02-16 08:10:22 +01:00
return ctx.OpBitcast(ctx.U32[1], value);
2021-02-08 06:54:35 +01:00
}
2021-02-17 04:59:28 +01:00
void EmitBitCastU64F64(EmitContext&) {
2021-02-08 06:54:35 +01:00
throw NotImplementedException("SPIR-V Instruction");
}
2021-02-17 04:59:28 +01:00
void EmitBitCastF16U16(EmitContext&) {
2021-02-08 06:54:35 +01:00
throw NotImplementedException("SPIR-V Instruction");
}
2021-02-17 04:59:28 +01:00
Id EmitBitCastF32U32(EmitContext& ctx, Id value) {
2021-02-16 08:10:22 +01:00
return ctx.OpBitcast(ctx.F32[1], value);
2021-02-08 06:54:35 +01:00
}
2021-02-17 04:59:28 +01:00
void EmitBitCastF64U64(EmitContext&) {
2021-02-08 06:54:35 +01:00
throw NotImplementedException("SPIR-V Instruction");
}
2021-02-17 04:59:28 +01:00
void EmitPackUint2x32(EmitContext&) {
2021-02-08 06:54:35 +01:00
throw NotImplementedException("SPIR-V Instruction");
}
2021-02-19 22:10:18 +01:00
Id EmitUnpackUint2x32(EmitContext& ctx, Id value) {
return ctx.OpBitcast(ctx.U32[2], value);
2021-02-08 06:54:35 +01:00
}
2021-02-19 22:10:18 +01:00
Id EmitPackFloat2x16(EmitContext& ctx, Id value) {
return ctx.OpBitcast(ctx.U32[1], value);
2021-02-08 06:54:35 +01:00
}
2021-02-19 22:10:18 +01:00
Id EmitUnpackFloat2x16(EmitContext& ctx, Id value) {
return ctx.OpBitcast(ctx.F16[2], value);
2021-02-08 06:54:35 +01:00
}
2021-02-19 22:10:18 +01:00
Id EmitPackHalf2x16(EmitContext& ctx, Id value) {
return ctx.OpPackHalf2x16(ctx.U32[1], value);
2021-02-08 06:54:35 +01:00
}
2021-02-19 22:10:18 +01:00
Id EmitUnpackHalf2x16(EmitContext& ctx, Id value) {
return ctx.OpUnpackHalf2x16(ctx.F32[2], value);
}
Id EmitPackDouble2x32(EmitContext& ctx, Id value) {
return ctx.OpBitcast(ctx.F64[1], value);
}
Id EmitUnpackDouble2x32(EmitContext& ctx, Id value) {
return ctx.OpBitcast(ctx.U32[2], value);
2021-02-08 06:54:35 +01:00
}
} // namespace Shader::Backend::SPIRV