From c0bce01cc910732f92772dde968d6611431e9d09 Mon Sep 17 00:00:00 2001 From: Kitchen Date: Fri, 25 Sep 2020 14:33:57 +0800 Subject: [PATCH] fix texture bind info missed in vertex shader after compiled (#2270) --- tools/shaderc/shaderc_hlsl.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index ed30c1e70..f3c54252c 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -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); + } } }