fix texture bind info missed in vertex shader after compiled (#2270)

This commit is contained in:
Kitchen 2020-09-25 14:33:57 +08:00 committed by GitHub
parent d03f7c6327
commit c0bce01cc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -513,7 +513,7 @@ namespace bgfx { namespace hlsl
hr = reflect->GetResourceBindingDesc(ii, &bindDesc);
if (SUCCEEDED(hr) )
{
if (D3D_SIT_SAMPLER == bindDesc.Type)
if (D3D_SIT_SAMPLER == bindDesc.Type || D3D_SIT_TEXTURE == bindDesc.Type)
{
BX_TRACE("\t%s, %d, %d, %d"
, bindDesc.Name
@ -523,7 +523,10 @@ namespace bgfx { namespace hlsl
);
bx::StringView end = bx::strFind(bindDesc.Name, "Sampler");
if (!end.isEmpty() )
if (end.isEmpty())
end = bx::strFind(bindDesc.Name, "Texture");
if (!end.isEmpty())
{
Uniform un;
un.name.assign(bindDesc.Name, (end.getPtr() - bindDesc.Name) );
@ -534,6 +537,10 @@ namespace bgfx { namespace hlsl
_uniforms.push_back(un);
}
}
else
{
BX_TRACE("\t%s, unknown bind data", bindDesc.Name);
}
}
}