d3d12: Fix binding of tex/sampler
This commit is contained in:
@@ -97,13 +97,14 @@ void D3D12FragmentDecompiler::insertConstants(std::stringstream & OS)
|
|||||||
OS << " " << PT.type << " " << PI.name << ";" << std::endl;
|
OS << " " << PT.type << " " << PI.name << ";" << std::endl;
|
||||||
}
|
}
|
||||||
OS << "};" << std::endl << std::endl;
|
OS << "};" << std::endl << std::endl;
|
||||||
size_t textureIndex = 0;
|
|
||||||
for (ParamType PT : m_parr.params[PF_PARAM_UNIFORM])
|
for (ParamType PT : m_parr.params[PF_PARAM_UNIFORM])
|
||||||
{
|
{
|
||||||
if (PT.type != "sampler2D")
|
if (PT.type != "sampler2D")
|
||||||
continue;
|
continue;
|
||||||
for (ParamItem PI : PT.items)
|
for (ParamItem PI : PT.items)
|
||||||
{
|
{
|
||||||
|
size_t textureIndex = atoi(PI.name.data() + 3);
|
||||||
OS << "Texture2D " << PI.name << " : register(t" << textureIndex << ");" << std::endl;
|
OS << "Texture2D " << PI.name << " : register(t" << textureIndex << ");" << std::endl;
|
||||||
OS << "sampler " << PI.name << "sampler : register(s" << textureIndex << ");" << std::endl;
|
OS << "sampler " << PI.name << "sampler : register(s" << textureIndex << ");" << std::endl;
|
||||||
textureIndex++;
|
textureIndex++;
|
||||||
|
|||||||
Reference in New Issue
Block a user