2021-02-08 00:54:35 -05: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"
|
2021-05-03 19:53:00 -04:00
|
|
|
#include "shader_recompiler/backend/spirv/emit_spirv_instructions.h"
|
2021-02-08 00:54:35 -05:00
|
|
|
|
|
|
|
namespace Shader::Backend::SPIRV {
|
|
|
|
|
2021-03-07 22:01:22 -05:00
|
|
|
Id EmitSelectU1(EmitContext& ctx, Id cond, Id true_value, Id false_value) {
|
|
|
|
return ctx.OpSelect(ctx.U1, cond, true_value, false_value);
|
|
|
|
}
|
|
|
|
|
2021-04-17 00:48:35 -04:00
|
|
|
Id EmitSelectU8(EmitContext&, Id, Id, Id) {
|
2021-02-08 00:54:35 -05:00
|
|
|
throw NotImplementedException("SPIR-V Instruction");
|
|
|
|
}
|
|
|
|
|
2021-02-22 20:59:16 -05:00
|
|
|
Id EmitSelectU16(EmitContext& ctx, Id cond, Id true_value, Id false_value) {
|
|
|
|
return ctx.OpSelect(ctx.U16, cond, true_value, false_value);
|
2021-02-08 00:54:35 -05:00
|
|
|
}
|
|
|
|
|
2021-02-22 20:59:16 -05:00
|
|
|
Id EmitSelectU32(EmitContext& ctx, Id cond, Id true_value, Id false_value) {
|
2021-02-21 15:50:14 -05:00
|
|
|
return ctx.OpSelect(ctx.U32[1], cond, true_value, false_value);
|
2021-02-08 00:54:35 -05:00
|
|
|
}
|
|
|
|
|
2021-02-22 20:59:16 -05:00
|
|
|
Id EmitSelectU64(EmitContext& ctx, Id cond, Id true_value, Id false_value) {
|
|
|
|
return ctx.OpSelect(ctx.U64, cond, true_value, false_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
Id EmitSelectF16(EmitContext& ctx, Id cond, Id true_value, Id false_value) {
|
|
|
|
return ctx.OpSelect(ctx.F16[1], cond, true_value, false_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
Id EmitSelectF32(EmitContext& ctx, Id cond, Id true_value, Id false_value) {
|
|
|
|
return ctx.OpSelect(ctx.F32[1], cond, true_value, false_value);
|
2021-02-08 00:54:35 -05:00
|
|
|
}
|
|
|
|
|
2021-03-21 19:28:37 -04:00
|
|
|
Id EmitSelectF64(EmitContext& ctx, Id cond, Id true_value, Id false_value) {
|
|
|
|
return ctx.OpSelect(ctx.F64[1], cond, true_value, false_value);
|
|
|
|
}
|
|
|
|
|
2021-02-08 00:54:35 -05:00
|
|
|
} // namespace Shader::Backend::SPIRV
|