mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
feat(shader): add EmitNative impl + EmitGlsl for recompiler
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user