From 98a924874f2f95911d8b7a59c6178236a3ad574d Mon Sep 17 00:00:00 2001 From: vlj Date: Fri, 15 May 2015 01:03:46 +0200 Subject: [PATCH] d3d12: Inline constants It's slow --- rpcs3/Emu/RSX/D3D12/FragmentProgramDecompiler.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/D3D12/FragmentProgramDecompiler.cpp b/rpcs3/Emu/RSX/D3D12/FragmentProgramDecompiler.cpp index aad765f258..7dbccdff74 100644 --- a/rpcs3/Emu/RSX/D3D12/FragmentProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/D3D12/FragmentProgramDecompiler.cpp @@ -431,14 +431,21 @@ void FragmentDecompiler::insertOutputs(std::stringstream & OS) void FragmentDecompiler::insertConstants(std::stringstream & OS) { - OS << "cbuffer CONSTANT : register(b2)" << std::endl; + // TODO : Avoid constant recompilation and properly use constant buffer +/* OS << "cbuffer CONSTANT : register(b2)" << std::endl; OS << "{" << std::endl; for (ParamType PT : m_parr.params[PARAM_UNIFORM]) { for (ParamItem PI : PT.items) OS << " " << PT.type << " " << PI.name << ";" << std::endl; } - OS << "};" << std::endl; + OS << "};" << std::endl;*/ + + for (ParamType PT : m_parr.params[PARAM_UNIFORM]) + { + for (ParamItem PI : PT.items) + OS << PT.type << " " << PI.name << " = " << PI.value << ";" << std::endl; + } } void FragmentDecompiler::insertMainStart(std::stringstream & OS)