浏览代码

some minor directx fixes

Nicolas Cannasse 8 年之前
父节点
当前提交
6e86e1dbf9
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 5 3
      h3d/impl/DirectXDriver.hx
  2. 1 1
      hxsl/HlslOut.hx

+ 5 - 3
h3d/impl/DirectXDriver.hx

@@ -296,7 +296,10 @@ class DirectXDriver extends h3d.impl.Driver {
 	}
 
 	override public function uploadVertexBuffer(v:VertexBuffer, startVertex:Int, vertexCount:Int, buf:hxd.FloatBuffer, bufPos:Int) {
-		if( startVertex > 0 || vertexCount != v.count ) throw "TODO";
+		if( startVertex > 0 || vertexCount != v.count ) {
+			trace("TODO:" + startVertex + "," + vertexCount + "/" + v.count);
+			return;
+		}
 		v.res.updateSubresource(0, null, hl.Bytes.getArray(buf.getNative()).offset(bufPos<<2), 0, 0);
 	}
 
@@ -312,9 +315,8 @@ class DirectXDriver extends h3d.impl.Driver {
 	}
 
 	override function uploadTexturePixels(t:h3d.mat.Texture, pixels:hxd.Pixels, mipLevel:Int, side:Int) {
-		if( mipLevel != 0 || side != 0 ) throw "TODO";
 		pixels.convert(RGBA);
-		t.t.res.updateSubresource(0, null, pixels.bytes, pixels.width << 2, 0);
+		t.t.res.updateSubresource(mipLevel + side * 6, null, pixels.bytes, pixels.width << 2, 0);
 	}
 
 	static inline var SCISSOR_BIT = 1 << (Pass.colorMask_offset + 4);

+ 1 - 1
hxsl/HlslOut.hx

@@ -4,7 +4,7 @@ using hxsl.Ast;
 class HlslOut {
 
 	static var KWD_LIST = [
-		"s_input", "s_output", "_in", "_out", "in", "out", "mul",
+		"s_input", "s_output", "_in", "_out", "in", "out", "mul","matrix","vector","export","half","float","double","line","linear","point","precise"
 	];
 	static var KWDS = [for( k in KWD_LIST ) k => true];
 	static var GLOBALS = {