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-03-05 07:15:16 +01:00
|
|
|
Id EmitPackUint2x32(EmitContext& ctx, Id value) {
|
|
|
|
return ctx.OpBitcast(ctx.U64, value);
|
2021-02-08 06:54:35 +01:00
|
|
|
}
|
|
|
|
|
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
|