瀏覽代碼

auto translate vertex texture.get to getLod(uv,0) in directx

Nicolas Cannasse 5 年之前
父節點
當前提交
bfaf35ffd4
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      hxsl/HlslOut.hx

+ 3 - 1
hxsl/HlslOut.hx

@@ -240,7 +240,7 @@ class HlslOut {
 			addValue(args[0], tabs);
 			switch( g ) {
 			case Texture:
-				add(".Sample(");
+				add(isVertex ? ".SampleLevel(" : ".Sample(");
 			case TextureLod:
 				add(".SampleLevel(");
 			default:
@@ -262,6 +262,8 @@ class HlslOut {
 				add(",");
 				addValue(args[i],tabs);
 			}
+			if( g == Texture && isVertex )
+				add(",0");
 			add(")");
 		case TCall({ e : TGlobal(g = (Texel | TexelLod)) }, args):
 			addValue(args[0], tabs);