[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
1 changed files with 11 additions and 9 deletions

View File

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