diff --git a/rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp b/rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp index a99747f81d..13a97cda55 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12FragmentProgramDecompiler.cpp @@ -97,13 +97,14 @@ void D3D12FragmentDecompiler::insertConstants(std::stringstream & OS) OS << " " << PT.type << " " << PI.name << ";" << std::endl; } OS << "};" << std::endl << std::endl; - size_t textureIndex = 0; + for (ParamType PT : m_parr.params[PF_PARAM_UNIFORM]) { if (PT.type != "sampler2D") continue; for (ParamItem PI : PT.items) { + size_t textureIndex = atoi(PI.name.data() + 3); OS << "Texture2D " << PI.name << " : register(t" << textureIndex << ");" << std::endl; OS << "sampler " << PI.name << "sampler : register(s" << textureIndex << ");" << std::endl; textureIndex++;