d3d12: Fix binding of tex/sampler

This commit is contained in:
vlj 2015-06-27 23:21:11 +02:00 committed by Vincent Lejeune
parent 3cc3974466
commit cb0ebad210

View File

@ -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++;