Procházet zdrojové kódy

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

Kitchen před 5 roky
rodič
revize
c0bce01cc9
1 změnil soubory, kde provedl 9 přidání a 2 odebrání
  1. 9 2
      tools/shaderc/shaderc_hlsl.cpp

+ 9 - 2
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);
+				}
 			}
 		}