1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxso] Allocate shader compiler on the heap

In some apps that call us with limited stack space, this can stack overflow
This commit is contained in:
Joshua Ashton 2020-08-26 20:30:51 +01:00 committed by Joshie
parent 3e65c2bb87
commit 81632b91bb

View File

@ -3,6 +3,8 @@
#include "dxso_code.h" #include "dxso_code.h"
#include "dxso_compiler.h" #include "dxso_compiler.h"
#include <memory>
namespace dxvk { namespace dxvk {
DxsoModule::DxsoModule(DxsoReader& reader) DxsoModule::DxsoModule(DxsoReader& reader)
@ -24,22 +26,22 @@ namespace dxvk {
const std::string& fileName, const std::string& fileName,
const DxsoAnalysisInfo& analysis, const DxsoAnalysisInfo& analysis,
const D3D9ConstantLayout& layout) { const D3D9ConstantLayout& layout) {
DxsoCompiler compiler( auto compiler = std::make_unique<DxsoCompiler>(
fileName, moduleInfo, fileName, moduleInfo,
m_header.info(), analysis, m_header.info(), analysis,
layout); layout);
this->runCompiler(compiler, m_code.iter()); this->runCompiler(*compiler, m_code.iter());
m_isgn = compiler.isgn(); m_isgn = compiler->isgn();
m_meta = compiler.meta(); m_meta = compiler->meta();
m_constants = compiler.constants(); m_constants = compiler->constants();
m_usedSamplers = compiler.usedSamplers(); m_usedSamplers = compiler->usedSamplers();
m_usedRTs = compiler.usedRTs(); m_usedRTs = compiler->usedRTs();
compiler.finalize(); compiler->finalize();
return compiler.compile(); return compiler->compile();
} }
void DxsoModule::runAnalyzer( void DxsoModule::runAnalyzer(