yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

glsl: Pass IR::Inst& to Emit functions

This commit is contained in:
ameerj 2021-05-21 19:28:03 -04:00
parent 78f5eb90d7
commit 115c162b9a
6 changed files with 169 additions and 171 deletions

View File

@ -37,8 +37,6 @@ template <typename ArgType>
ArgType Arg(EmitContext& ctx, const IR::Value& arg) { ArgType Arg(EmitContext& ctx, const IR::Value& arg) {
if constexpr (std::is_same_v<ArgType, std::string>) { if constexpr (std::is_same_v<ArgType, std::string>) {
return ctx.reg_alloc.Consume(arg); return ctx.reg_alloc.Consume(arg);
} else if constexpr (std::is_same_v<ArgType, IR::Inst&>) {
return *arg.Inst();
} else if constexpr (std::is_same_v<ArgType, const IR::Value&>) { } else if constexpr (std::is_same_v<ArgType, const IR::Value&>) {
return arg; return arg;
} else if constexpr (std::is_same_v<ArgType, u32>) { } else if constexpr (std::is_same_v<ArgType, u32>) {
@ -58,7 +56,7 @@ void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) {
if constexpr (std::is_same_v<typename Traits::ReturnType, Id>) { if constexpr (std::is_same_v<typename Traits::ReturnType, Id>) {
if constexpr (is_first_arg_inst) { if constexpr (is_first_arg_inst) {
SetDefinition<func>( SetDefinition<func>(
ctx, inst, inst, ctx, inst, *inst,
Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...); Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...);
} else { } else {
SetDefinition<func>( SetDefinition<func>(
@ -66,7 +64,7 @@ void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) {
} }
} else { } else {
if constexpr (is_first_arg_inst) { if constexpr (is_first_arg_inst) {
func(ctx, inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...); func(ctx, *inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...);
} else { } else {
func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...); func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...);
} }
@ -81,7 +79,7 @@ void Invoke(EmitContext& ctx, IR::Inst* inst) {
Invoke<func, false>(ctx, inst, std::make_index_sequence<0>{}); Invoke<func, false>(ctx, inst, std::make_index_sequence<0>{});
} else { } else {
using FirstArgType = typename Traits::template ArgType<1>; using FirstArgType = typename Traits::template ArgType<1>;
static constexpr bool is_first_arg_inst = std::is_same_v<FirstArgType, IR::Inst*>; static constexpr bool is_first_arg_inst = std::is_same_v<FirstArgType, IR::Inst&>;
using Indices = std::make_index_sequence<Traits::NUM_ARGS - (is_first_arg_inst ? 2 : 1)>; using Indices = std::make_index_sequence<Traits::NUM_ARGS - (is_first_arg_inst ? 2 : 1)>;
Invoke<func, is_first_arg_inst>(ctx, inst, Indices{}); Invoke<func, is_first_arg_inst>(ctx, inst, Indices{});
} }

View File

@ -22,7 +22,7 @@ static void Alias(IR::Inst& inst, const IR::Value& value) {
} }
} // namespace } // namespace
void EmitIdentity(EmitContext&, IR::Inst* inst, const IR::Value& value) { void EmitIdentity(EmitContext&, IR::Inst& inst, const IR::Value& value) {
Alias(*inst, value); Alias(inst, value);
} }
} // namespace Shader::Backend::GLSL } // namespace Shader::Backend::GLSL

View File

@ -30,10 +30,10 @@ void EmitGetCbufS16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] const IR
throw NotImplementedException("GLSL"); throw NotImplementedException("GLSL");
} }
void EmitGetCbufU32(EmitContext& ctx, IR::Inst* inst, const IR::Value& binding, void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
const IR::Value& offset) { const IR::Value& offset) {
const auto u32_offset{offset.U32()}; const auto u32_offset{offset.U32()};
ctx.AddU32("{}=floatBitsToUint(cbuf{}[{}][{}]);", *inst, binding.U32(), u32_offset / 16, ctx.AddU32("{}=floatBitsToUint(cbuf{}[{}][{}]);", inst, binding.U32(), u32_offset / 16,
(u32_offset / 4) % 4); (u32_offset / 4) % 4);
} }

View File

@ -25,9 +25,9 @@ inline void EmitSetLoopSafetyVariable(EmitContext&) {}
inline void EmitGetLoopSafetyVariable(EmitContext&) {} inline void EmitGetLoopSafetyVariable(EmitContext&) {}
// Microinstruction emitters // Microinstruction emitters
void EmitPhi(EmitContext& ctx, IR::Inst* inst); void EmitPhi(EmitContext& ctx, IR::Inst& inst);
void EmitVoid(EmitContext& ctx); void EmitVoid(EmitContext& ctx);
void EmitIdentity(EmitContext& ctx, IR::Inst* inst, const IR::Value& value); void EmitIdentity(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
void EmitConditionRef(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); void EmitConditionRef(EmitContext& ctx, IR::Inst& inst, const IR::Value& value);
void EmitReference(EmitContext&); void EmitReference(EmitContext&);
void EmitPhiMove(EmitContext& ctx, const IR::Value& phi, const IR::Value& value); void EmitPhiMove(EmitContext& ctx, const IR::Value& phi, const IR::Value& value);
@ -59,7 +59,7 @@ void EmitGetCbufU8(EmitContext& ctx, const IR::Value& binding, const IR::Value&
void EmitGetCbufS8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); void EmitGetCbufS8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset);
void EmitGetCbufU16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); void EmitGetCbufU16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset);
void EmitGetCbufS16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); void EmitGetCbufS16(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset);
void EmitGetCbufU32(EmitContext& ctx, IR::Inst* inst, const IR::Value& binding, void EmitGetCbufU32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
const IR::Value& offset); const IR::Value& offset);
void EmitGetCbufF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); void EmitGetCbufF32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset);
void EmitGetCbufU32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); void EmitGetCbufU32x2(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset);
@ -231,19 +231,19 @@ void EmitGetInBoundsFromOp(EmitContext& ctx);
void EmitFPAbs16(EmitContext& ctx, std::string value); void EmitFPAbs16(EmitContext& ctx, std::string value);
void EmitFPAbs32(EmitContext& ctx, std::string value); void EmitFPAbs32(EmitContext& ctx, std::string value);
void EmitFPAbs64(EmitContext& ctx, std::string value); void EmitFPAbs64(EmitContext& ctx, std::string value);
void EmitFPAdd16(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitFPAdd16(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitFPAdd32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitFPAdd64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitFPFma16(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b, std::string c); void EmitFPFma16(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b, std::string c);
void EmitFPFma32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b, std::string c); void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b, std::string c);
void EmitFPFma64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b, std::string c); void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b, std::string c);
void EmitFPMax32(EmitContext& ctx, std::string a, std::string b); void EmitFPMax32(EmitContext& ctx, std::string a, std::string b);
void EmitFPMax64(EmitContext& ctx, std::string a, std::string b); void EmitFPMax64(EmitContext& ctx, std::string a, std::string b);
void EmitFPMin32(EmitContext& ctx, std::string a, std::string b); void EmitFPMin32(EmitContext& ctx, std::string a, std::string b);
void EmitFPMin64(EmitContext& ctx, std::string a, std::string b); void EmitFPMin64(EmitContext& ctx, std::string a, std::string b);
void EmitFPMul16(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitFPMul16(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitFPMul32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitFPMul64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitFPNeg16(EmitContext& ctx, std::string value); void EmitFPNeg16(EmitContext& ctx, std::string value);
void EmitFPNeg32(EmitContext& ctx, std::string value); void EmitFPNeg32(EmitContext& ctx, std::string value);
void EmitFPNeg64(EmitContext& ctx, std::string value); void EmitFPNeg64(EmitContext& ctx, std::string value);
@ -316,55 +316,55 @@ void EmitFPUnordGreaterThanEqual64(EmitContext& ctx, std::string lhs, std::strin
void EmitFPIsNan16(EmitContext& ctx, std::string value); void EmitFPIsNan16(EmitContext& ctx, std::string value);
void EmitFPIsNan32(EmitContext& ctx, std::string value); void EmitFPIsNan32(EmitContext& ctx, std::string value);
void EmitFPIsNan64(EmitContext& ctx, std::string value); void EmitFPIsNan64(EmitContext& ctx, std::string value);
void EmitIAdd32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitIAdd64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitIAdd64(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitISub32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitISub32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitISub64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitISub64(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitIMul32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitIMul32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitINeg32(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitINeg32(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitINeg64(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitINeg64(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitIAbs32(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitIAbs32(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitIAbs64(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitIAbs64(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitShiftLeftLogical32(EmitContext& ctx, IR::Inst* inst, std::string base, std::string shift); void EmitShiftLeftLogical32(EmitContext& ctx, IR::Inst& inst, std::string base, std::string shift);
void EmitShiftLeftLogical64(EmitContext& ctx, IR::Inst* inst, std::string base, std::string shift); void EmitShiftLeftLogical64(EmitContext& ctx, IR::Inst& inst, std::string base, std::string shift);
void EmitShiftRightLogical32(EmitContext& ctx, IR::Inst* inst, std::string base, std::string shift); void EmitShiftRightLogical32(EmitContext& ctx, IR::Inst& inst, std::string base, std::string shift);
void EmitShiftRightLogical64(EmitContext& ctx, IR::Inst* inst, std::string base, std::string shift); void EmitShiftRightLogical64(EmitContext& ctx, IR::Inst& inst, std::string base, std::string shift);
void EmitShiftRightArithmetic32(EmitContext& ctx, IR::Inst* inst, std::string base, void EmitShiftRightArithmetic32(EmitContext& ctx, IR::Inst& inst, std::string base,
std::string shift); std::string shift);
void EmitShiftRightArithmetic64(EmitContext& ctx, IR::Inst* inst, std::string base, void EmitShiftRightArithmetic64(EmitContext& ctx, IR::Inst& inst, std::string base,
std::string shift); std::string shift);
void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitBitwiseAnd32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitBitwiseOr32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitBitwiseOr32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitBitwiseXor32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitBitwiseXor32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitBitFieldInsert(EmitContext& ctx, IR::Inst* inst, std::string base, std::string insert, void EmitBitFieldInsert(EmitContext& ctx, IR::Inst& inst, std::string base, std::string insert,
std::string offset, std::string count); std::string offset, std::string count);
void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst* inst, std::string base, std::string offset, void EmitBitFieldSExtract(EmitContext& ctx, IR::Inst& inst, std::string base, std::string offset,
std::string count); std::string count);
void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst* inst, std::string base, std::string offset, void EmitBitFieldUExtract(EmitContext& ctx, IR::Inst& inst, std::string base, std::string offset,
std::string count); std::string count);
void EmitBitReverse32(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitBitReverse32(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitBitCount32(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitBitCount32(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitBitwiseNot32(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitBitwiseNot32(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitFindSMsb32(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitFindSMsb32(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitFindUMsb32(EmitContext& ctx, IR::Inst* inst, std::string value); void EmitFindUMsb32(EmitContext& ctx, IR::Inst& inst, std::string value);
void EmitSMin32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitSMin32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitUMin32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitUMin32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitSMax32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitSMax32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitUMax32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b); void EmitUMax32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b);
void EmitSClamp32(EmitContext& ctx, IR::Inst* inst, std::string value, std::string min, void EmitSClamp32(EmitContext& ctx, IR::Inst& inst, std::string value, std::string min,
std::string max); std::string max);
void EmitUClamp32(EmitContext& ctx, IR::Inst* inst, std::string value, std::string min, void EmitUClamp32(EmitContext& ctx, IR::Inst& inst, std::string value, std::string min,
std::string max); std::string max);
void EmitSLessThan(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitSLessThan(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitULessThan(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitULessThan(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitIEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitIEqual(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitSLessThanEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitSLessThanEqual(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitULessThanEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitULessThanEqual(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitSGreaterThan(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitSGreaterThan(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitUGreaterThan(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitUGreaterThan(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitINotEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitINotEqual(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitSGreaterThanEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitSGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitUGreaterThanEqual(EmitContext& ctx, IR::Inst* inst, std::string lhs, std::string rhs); void EmitUGreaterThanEqual(EmitContext& ctx, IR::Inst& inst, std::string lhs, std::string rhs);
void EmitSharedAtomicIAdd32(EmitContext& ctx, std::string pointer_offset, std::string value); void EmitSharedAtomicIAdd32(EmitContext& ctx, std::string pointer_offset, std::string value);
void EmitSharedAtomicSMin32(EmitContext& ctx, std::string pointer_offset, std::string value); void EmitSharedAtomicSMin32(EmitContext& ctx, std::string pointer_offset, std::string value);
void EmitSharedAtomicUMin32(EmitContext& ctx, std::string pointer_offset, std::string value); void EmitSharedAtomicUMin32(EmitContext& ctx, std::string pointer_offset, std::string value);
@ -536,31 +536,31 @@ void EmitBoundImageQueryLod(EmitContext&);
void EmitBoundImageGradient(EmitContext&); void EmitBoundImageGradient(EmitContext&);
void EmitBoundImageRead(EmitContext&); void EmitBoundImageRead(EmitContext&);
void EmitBoundImageWrite(EmitContext&); void EmitBoundImageWrite(EmitContext&);
void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string bias_lc, const IR::Value& offset); std::string coords, std::string bias_lc, const IR::Value& offset);
void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string lod_lc, const IR::Value& offset); std::string coords, std::string lod_lc, const IR::Value& offset);
void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string dref, std::string bias_lc, std::string coords, std::string dref, std::string bias_lc,
const IR::Value& offset); const IR::Value& offset);
void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string dref, std::string lod_lc, std::string coords, std::string dref, std::string lod_lc,
const IR::Value& offset); const IR::Value& offset);
void EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords, void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords,
const IR::Value& offset, const IR::Value& offset2); const IR::Value& offset, const IR::Value& offset2);
void EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, const IR::Value& offset, const IR::Value& offset2, std::string coords, const IR::Value& offset, const IR::Value& offset2,
std::string dref); std::string dref);
void EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords, void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords,
std::string offset, std::string lod, std::string ms); std::string offset, std::string lod, std::string ms);
void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string lod); std::string lod);
void EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords); std::string coords);
void EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords, void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords,
std::string derivates, std::string offset, std::string lod_clamp); std::string derivates, std::string offset, std::string lod_clamp);
void EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords); void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords);
void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords, void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords,
std::string color); std::string color);
void EmitBindlessImageAtomicIAdd32(EmitContext&); void EmitBindlessImageAtomicIAdd32(EmitContext&);
void EmitBindlessImageAtomicSMin32(EmitContext&); void EmitBindlessImageAtomicSMin32(EmitContext&);
@ -584,27 +584,27 @@ void EmitBoundImageAtomicAnd32(EmitContext&);
void EmitBoundImageAtomicOr32(EmitContext&); void EmitBoundImageAtomicOr32(EmitContext&);
void EmitBoundImageAtomicXor32(EmitContext&); void EmitBoundImageAtomicXor32(EmitContext&);
void EmitBoundImageAtomicExchange32(EmitContext&); void EmitBoundImageAtomicExchange32(EmitContext&);
void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value); std::string coords, std::string value);
void EmitLaneId(EmitContext& ctx); void EmitLaneId(EmitContext& ctx);
void EmitVoteAll(EmitContext& ctx, std::string pred); void EmitVoteAll(EmitContext& ctx, std::string pred);
@ -616,13 +616,13 @@ void EmitSubgroupLtMask(EmitContext& ctx);
void EmitSubgroupLeMask(EmitContext& ctx); void EmitSubgroupLeMask(EmitContext& ctx);
void EmitSubgroupGtMask(EmitContext& ctx); void EmitSubgroupGtMask(EmitContext& ctx);
void EmitSubgroupGeMask(EmitContext& ctx); void EmitSubgroupGeMask(EmitContext& ctx);
void EmitShuffleIndex(EmitContext& ctx, IR::Inst* inst, std::string value, std::string index, void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string value, std::string index,
std::string clamp, std::string segmentation_mask); std::string clamp, std::string segmentation_mask);
void EmitShuffleUp(EmitContext& ctx, IR::Inst* inst, std::string value, std::string index, void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, std::string value, std::string index,
std::string clamp, std::string segmentation_mask); std::string clamp, std::string segmentation_mask);
void EmitShuffleDown(EmitContext& ctx, IR::Inst* inst, std::string value, std::string index, void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, std::string value, std::string index,
std::string clamp, std::string segmentation_mask); std::string clamp, std::string segmentation_mask);
void EmitShuffleButterfly(EmitContext& ctx, IR::Inst* inst, std::string value, std::string index, void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, std::string value, std::string index,
std::string clamp, std::string segmentation_mask); std::string clamp, std::string segmentation_mask);
void EmitFSwizzleAdd(EmitContext& ctx, std::string op_a, std::string op_b, std::string swizzle); void EmitFSwizzleAdd(EmitContext& ctx, std::string op_a, std::string op_b, std::string swizzle);
void EmitDPdxFine(EmitContext& ctx, std::string op_a); void EmitDPdxFine(EmitContext& ctx, std::string op_a);

View File

@ -11,221 +11,221 @@
#include "shader_recompiler/profile.h" #include "shader_recompiler/profile.h"
namespace Shader::Backend::GLSL { namespace Shader::Backend::GLSL {
void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
ctx.AddU32("{}={}+{};", *inst, a, b); ctx.AddU32("{}={}+{};", inst, a, b);
} }
void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitIMul32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitINeg32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
ctx.AddU32("{}=-{};", *inst, value); ctx.AddU32("{}=-{};", inst, value);
} }
void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitINeg64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitIAbs32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitIAbs64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitShiftLeftLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string shift) { [[maybe_unused]] std::string base, [[maybe_unused]] std::string shift) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitShiftLeftLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string shift) { [[maybe_unused]] std::string base, [[maybe_unused]] std::string shift) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitShiftRightLogical32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string base,
[[maybe_unused]] std::string shift) { [[maybe_unused]] std::string shift) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitShiftRightLogical64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string base,
[[maybe_unused]] std::string shift) { [[maybe_unused]] std::string shift) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitShiftRightArithmetic32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string base,
[[maybe_unused]] std::string shift) { [[maybe_unused]] std::string shift) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitShiftRightArithmetic64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string base,
[[maybe_unused]] std::string shift) { [[maybe_unused]] std::string shift) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitwiseAnd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitwiseAnd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitwiseOr32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitwiseOr32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitwiseXor32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitFieldInsert([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string insert, [[maybe_unused]] std::string base, [[maybe_unused]] std::string insert,
[[maybe_unused]] std::string offset, std::string count) { [[maybe_unused]] std::string offset, std::string count) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitFieldSExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string offset, [[maybe_unused]] std::string base, [[maybe_unused]] std::string offset,
std::string count) { std::string count) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitFieldUExtract([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string base, [[maybe_unused]] std::string offset, [[maybe_unused]] std::string base, [[maybe_unused]] std::string offset,
std::string count) { std::string count) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitReverse32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitCount32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitBitwiseNot32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitFindSMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitFindUMsb32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value) { [[maybe_unused]] std::string value) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitSMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitUMin32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitSMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitUMax32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string a, [[maybe_unused]] std::string b) { [[maybe_unused]] std::string a, [[maybe_unused]] std::string b) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitSClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value, [[maybe_unused]] std::string min, [[maybe_unused]] std::string value, [[maybe_unused]] std::string min,
std::string max) { std::string max) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitUClamp32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string value, [[maybe_unused]] std::string min, [[maybe_unused]] std::string value, [[maybe_unused]] std::string min,
std::string max) { std::string max) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitSLessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitULessThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitIEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitSLessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitULessThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitSGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitUGreaterThan([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitINotEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitSGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }
void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst* inst, void EmitUGreaterThanEqual([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst,
[[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) { [[maybe_unused]] std::string lhs, [[maybe_unused]] std::string rhs) {
throw NotImplementedException("GLSL Instruction"); throw NotImplementedException("GLSL Instruction");
} }

View File

@ -19,7 +19,7 @@ static void NotImplemented() {
throw NotImplementedException("GLSL instruction"); throw NotImplementedException("GLSL instruction");
} }
void EmitPhi(EmitContext& ctx, IR::Inst* inst) { void EmitPhi(EmitContext& ctx, IR::Inst& inst) {
NotImplemented(); NotImplemented();
} }
@ -648,27 +648,27 @@ void EmitFPAbs64(EmitContext& ctx, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitFPAdd16(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b) { void EmitFPAdd16(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b) {
NotImplemented(); NotImplemented();
} }
void EmitFPAdd32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b) { void EmitFPAdd32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b) {
NotImplemented(); NotImplemented();
} }
void EmitFPAdd64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b) { void EmitFPAdd64(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b) {
NotImplemented(); NotImplemented();
} }
void EmitFPFma16(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b, std::string c) { void EmitFPFma16(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b, std::string c) {
NotImplemented(); NotImplemented();
} }
void EmitFPFma32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b, std::string c) { void EmitFPFma32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b, std::string c) {
NotImplemented(); NotImplemented();
} }
void EmitFPFma64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b, std::string c) { void EmitFPFma64(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b, std::string c) {
NotImplemented(); NotImplemented();
} }
@ -688,15 +688,15 @@ void EmitFPMin64(EmitContext& ctx, std::string a, std::string b) {
NotImplemented(); NotImplemented();
} }
void EmitFPMul16(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b) { void EmitFPMul16(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b) {
NotImplemented(); NotImplemented();
} }
void EmitFPMul32(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b) { void EmitFPMul32(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b) {
NotImplemented(); NotImplemented();
} }
void EmitFPMul64(EmitContext& ctx, IR::Inst* inst, std::string a, std::string b) { void EmitFPMul64(EmitContext& ctx, IR::Inst& inst, std::string a, std::string b) {
NotImplemented(); NotImplemented();
} }
@ -1582,64 +1582,64 @@ void EmitBoundImageWrite(EmitContext&) {
NotImplemented(); NotImplemented();
} }
void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageSampleImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string bias_lc, const IR::Value& offset) { std::string coords, std::string bias_lc, const IR::Value& offset) {
NotImplemented(); NotImplemented();
} }
void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageSampleExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string lod_lc, const IR::Value& offset) { std::string coords, std::string lod_lc, const IR::Value& offset) {
NotImplemented(); NotImplemented();
} }
void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageSampleDrefImplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string dref, std::string bias_lc, std::string coords, std::string dref, std::string bias_lc,
const IR::Value& offset) { const IR::Value& offset) {
NotImplemented(); NotImplemented();
} }
void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageSampleDrefExplicitLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string dref, std::string lod_lc, std::string coords, std::string dref, std::string lod_lc,
const IR::Value& offset) { const IR::Value& offset) {
NotImplemented(); NotImplemented();
} }
void EmitImageGather(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords, void EmitImageGather(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords,
const IR::Value& offset, const IR::Value& offset2) { const IR::Value& offset, const IR::Value& offset2) {
NotImplemented(); NotImplemented();
} }
void EmitImageGatherDref(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageGatherDref(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, const IR::Value& offset, const IR::Value& offset2, std::string coords, const IR::Value& offset, const IR::Value& offset2,
std::string dref) { std::string dref) {
NotImplemented(); NotImplemented();
} }
void EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords, void EmitImageFetch(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords,
std::string offset, std::string lod, std::string ms) { std::string offset, std::string lod, std::string ms) {
NotImplemented(); NotImplemented();
} }
void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string lod) { std::string lod) {
NotImplemented(); NotImplemented();
} }
void EmitImageQueryLod(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageQueryLod(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords) { std::string coords) {
NotImplemented(); NotImplemented();
} }
void EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords, void EmitImageGradient(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords,
std::string derivates, std::string offset, std::string lod_clamp) { std::string derivates, std::string offset, std::string lod_clamp) {
NotImplemented(); NotImplemented();
} }
void EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords) { void EmitImageRead(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords) {
NotImplemented(); NotImplemented();
} }
void EmitImageWrite(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, std::string coords, void EmitImageWrite(EmitContext& ctx, IR::Inst& inst, const IR::Value& index, std::string coords,
std::string color) { std::string color) {
NotImplemented(); NotImplemented();
} }
@ -1732,57 +1732,57 @@ void EmitBoundImageAtomicExchange32(EmitContext&) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicIAdd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicSMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicUMin32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicSMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicUMax32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicInc32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicDec32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicAnd32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicOr32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicXor32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, void EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst& inst, const IR::Value& index,
std::string coords, std::string value) { std::string coords, std::string value) {
NotImplemented(); NotImplemented();
} }
@ -1827,22 +1827,22 @@ void EmitSubgroupGeMask(EmitContext& ctx) {
NotImplemented(); NotImplemented();
} }
void EmitShuffleIndex(EmitContext& ctx, IR::Inst* inst, std::string value, std::string index, void EmitShuffleIndex(EmitContext& ctx, IR::Inst& inst, std::string value, std::string index,
std::string clamp, std::string segmentation_mask) { std::string clamp, std::string segmentation_mask) {
NotImplemented(); NotImplemented();
} }
void EmitShuffleUp(EmitContext& ctx, IR::Inst* inst, std::string value, std::string index, void EmitShuffleUp(EmitContext& ctx, IR::Inst& inst, std::string value, std::string index,
std::string clamp, std::string segmentation_mask) { std::string clamp, std::string segmentation_mask) {
NotImplemented(); NotImplemented();
} }
void EmitShuffleDown(EmitContext& ctx, IR::Inst* inst, std::string value, std::string index, void EmitShuffleDown(EmitContext& ctx, IR::Inst& inst, std::string value, std::string index,
std::string clamp, std::string segmentation_mask) { std::string clamp, std::string segmentation_mask) {
NotImplemented(); NotImplemented();
} }
void EmitShuffleButterfly(EmitContext& ctx, IR::Inst* inst, std::string value, std::string index, void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, std::string value, std::string index,
std::string clamp, std::string segmentation_mask) { std::string clamp, std::string segmentation_mask) {
NotImplemented(); NotImplemented();
} }