mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
fix(agc): use nid postfix for shader preparation transactions exports
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include <prx/libc/include/General.hpp>
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/ShaderPreparation.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/ShaderPreparationScope.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/Driver.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderUtils.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderConstants.hpp"
|
||||
@@ -61,7 +61,7 @@ int CreateInterpolantMapping(const char* fn, ShaderRegister* regs, const Shader*
|
||||
throw std::runtime_error(std::string(fn) + ": input semantic count exceeds 32");
|
||||
}
|
||||
|
||||
AgcDriver::DriverDetail::ShaderPreparationTransaction transaction;
|
||||
AgcDriver::ShaderPreparationScope transaction;
|
||||
std::array<ShaderRegister, 32> values{};
|
||||
auto* output = regs;
|
||||
regs = values.data();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "SceShaders.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/ShaderPreparation.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/ShaderPreparationScope.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/Driver.hpp"
|
||||
#include "prx/libc/include/general/VabiMacros.hpp"
|
||||
#include "prx/libSceAgc/Shader/include/ShaderConstants.hpp"
|
||||
@@ -22,7 +22,7 @@ extern "C" int APS5_VABI sceAgcLinkShaders(ShaderRegister* context, ShaderRegist
|
||||
|
||||
// The simple vertex/pixel pipeline combines two primitive context registers
|
||||
// and 32 interpolant registers. Publish only after both helpers succeed.
|
||||
AgcDriver::DriverDetail::ShaderPreparationTransaction transaction;
|
||||
AgcDriver::ShaderPreparationScope transaction;
|
||||
std::array<ShaderRegister, 34> contextValues{};
|
||||
std::array<ShaderRegister, 3> primitiveValues{};
|
||||
sceAgcCreatePrimState(contextValues.data(), primitiveValues.data(), nullptr, vertex, primitiveType);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGCDRIVER_EXECUTION_INCLUDE_SHADERPREPARATIONSCOPE_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGCDRIVER_EXECUTION_INCLUDE_SHADERPREPARATIONSCOPE_HPP
|
||||
|
||||
namespace AgcDriver::DriverDetail {
|
||||
class ShaderPreparationTransaction;
|
||||
}
|
||||
|
||||
extern "C" AgcDriver::DriverDetail::ShaderPreparationTransaction* AgcDriverBeginShaderPreparation_nid_postfix();
|
||||
extern "C" void AgcDriverCommitShaderPreparation_nid_postfix(AgcDriver::DriverDetail::ShaderPreparationTransaction* transaction);
|
||||
extern "C" void AgcDriverEndShaderPreparation_nid_postfix(AgcDriver::DriverDetail::ShaderPreparationTransaction* transaction) noexcept;
|
||||
|
||||
namespace AgcDriver {
|
||||
|
||||
class ShaderPreparationScope {
|
||||
public:
|
||||
ShaderPreparationScope() : transaction(AgcDriverBeginShaderPreparation_nid_postfix()) {}
|
||||
~ShaderPreparationScope() { AgcDriverEndShaderPreparation_nid_postfix(transaction); }
|
||||
ShaderPreparationScope(const ShaderPreparationScope&) = delete;
|
||||
ShaderPreparationScope& operator=(const ShaderPreparationScope&) = delete;
|
||||
void Commit() { AgcDriverCommitShaderPreparation_nid_postfix(transaction); }
|
||||
|
||||
private:
|
||||
DriverDetail::ShaderPreparationTransaction* transaction;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "prx/libSceAgcDriver/Execution/include/GuestMemory.hpp"
|
||||
#include "CacheKey.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/ShaderPreparation.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/ShaderPreparationScope.hpp"
|
||||
#include "CompiledVariant.hpp"
|
||||
#include "Optimization/ResourceProgram.hpp"
|
||||
#include <cstdlib>
|
||||
@@ -571,3 +572,15 @@ void Driver::RegisterShader(const Shader* shader) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extern "C" AgcDriver::DriverDetail::ShaderPreparationTransaction* AgcDriverBeginShaderPreparation_nid_postfix() {
|
||||
return new AgcDriver::DriverDetail::ShaderPreparationTransaction();
|
||||
}
|
||||
|
||||
extern "C" void AgcDriverCommitShaderPreparation_nid_postfix(AgcDriver::DriverDetail::ShaderPreparationTransaction* transaction) {
|
||||
transaction->Commit();
|
||||
}
|
||||
|
||||
extern "C" void AgcDriverEndShaderPreparation_nid_postfix(AgcDriver::DriverDetail::ShaderPreparationTransaction* transaction) noexcept {
|
||||
delete transaction;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user