瀏覽代碼

another channels support fix

Nicolas Cannasse 7 年之前
父節點
當前提交
273a9bc1b0
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      h3d/impl/GlDriver.hx

+ 6 - 4
h3d/impl/GlDriver.hx

@@ -296,13 +296,15 @@ class GlDriver extends Driver {
 		var name = "";
 		var t = shader.textures;
 		while( t != null ) {
-			if( t.type != curT ) {
-				curT = t.type;
-				name = switch( t.type ) {
+			var tt = t.type;
+			if( tt.match(TChannel(_)) ) tt = TSampler2D;
+			if( tt != curT ) {
+				curT = tt;
+				name = switch( tt ) {
 				case TSampler2D: "Textures";
 				case TSamplerCube: "TexturesCube";
 				case TSampler2DArray: "TexturesArray";
-				default: throw "Unsupported texture type "+t.type;
+				default: throw "Unsupported texture type "+tt;
 				}
 				index = 0;
 			}