feat(shader): add EmitNative impl + EmitGlsl for recompiler

This commit is contained in:
boykopovar 2026-09-22 09:10:10 +03:00
parent f38c6cd7af
commit eccabe52ec
2 changed files with 9 additions and 2 deletions

View File

@ -23,6 +23,8 @@
#include <string>
#include <ControlFlow/RequestSerializer.hpp>
#include "../../libs/prx/libc/include/general/LogMacros.hpp"
namespace ShaderRecompiler {
namespace {
@ -148,6 +150,9 @@ RecompileResult RecompileImpl(const RecompileRequest& request) {
result.bdaAbiVersion = program.Info().usesDma ? request.target.bdaAbiVersion : 0u;
result.bindings = bindings.bindings;
result.pushConstants = bindings.pushConstants;
std::fprintf(stdout, "[RecompileImpl] shader recompiled\n");
std::fflush(stdout);
return result;
}

View File

@ -131,12 +131,14 @@ std::uint32_t Select(SpirvEmitterState& state, std::uint32_t type, std::uint32_t
template<std::uint32_t TOpcode, IrType TValueType, typename... TArguments>
std::uint32_t EmitNative(SpirvEmitterState& state, TArguments... arguments) {
throw std::runtime_error("EmitNative not implemented");
const auto result = state.module.AllocateId();
state.module.AddFunction(TOpcode, TypeId(state, TValueType), result, arguments...);
return result;
}
template<std::uint32_t TOpcode, IrType TValueType, typename... TArguments>
std::uint32_t EmitGlsl(SpirvEmitterState& state, TArguments... arguments) {
throw std::runtime_error("EmitGlsl not implemented");
return EmitNative<spv::OpExtInst, TValueType>(state, GlslStd450(state), TOpcode, arguments...);
}
template<typename TFunction>