From 3d37a816c6adc2708a7be70f5a7fbe0af36b8227 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 23 Sep 2026 14:51:18 +0200 Subject: [PATCH] [glsl] fix clang 23 build error for unused function `SetDefinition` (#4389) Reported by @gixel > unused function template SetDefinition in: src/shader_recompiler/backend/glsl/emit_glsl.cpp:32:6: error: unused function template 'SetDefinition' [-Werror,-Wunused-template] - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4389 Reviewed-by: MaranBr Reviewed-by: Maufeat --- .../backend/glsl/emit_glsl.cpp | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cpp index 66ecfc9f74..8ec180bc42 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -28,11 +31,6 @@ struct FuncTraits { using ArgType = std::tuple_element_t>; }; -template -void SetDefinition(EmitContext& ctx, IR::Inst* inst, Args... args) { - inst->SetDefinition(func(ctx, std::forward(args)...)); -} - template auto Arg(EmitContext& ctx, const IR::Value& arg) { if constexpr (std::is_same_v) { @@ -53,21 +51,10 @@ auto Arg(EmitContext& ctx, const IR::Value& arg) { template void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence) { using Traits = FuncTraits; - if constexpr (std::is_same_v) { - if constexpr (is_first_arg_inst) { - SetDefinition( - ctx, inst, *inst, - Arg>(ctx, inst->Arg(I))...); - } else { - SetDefinition( - ctx, inst, Arg>(ctx, inst->Arg(I))...); - } + if constexpr (is_first_arg_inst) { + func(ctx, *inst, Arg>(ctx, inst->Arg(I))...); } else { - if constexpr (is_first_arg_inst) { - func(ctx, *inst, Arg>(ctx, inst->Arg(I))...); - } else { - func(ctx, Arg>(ctx, inst->Arg(I))...); - } + func(ctx, Arg>(ctx, inst->Arg(I))...); } }