瀏覽代碼

MeshBatch : - Increased MAX_STORAGE_BUFFER_ELEMENTS to 128MB

TothBenoit 1 年之前
父節點
當前提交
f872f8161d
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      h3d/scene/MeshBatch.hx
  2. 1 1
      hxsl/Cache.hx

+ 1 - 1
h3d/scene/MeshBatch.hx

@@ -131,7 +131,7 @@ class MeshBatch extends MultiMaterial {
 	static var modelViewID = hxsl.Globals.allocID("global.modelView");
 	static var modelViewInverseID = hxsl.Globals.allocID("global.modelViewInverse");
 	static var MAX_BUFFER_ELEMENTS = 4096;
-	static var MAX_STORAGE_BUFFER_ELEMENTS = 65535;
+	static var MAX_STORAGE_BUFFER_ELEMENTS = 128 * 1024 * 1024 >> 2;
 
 	var instanced : h3d.prim.Instanced;
 	var dataPasses : BatchData;

+ 1 - 1
hxsl/Cache.hx

@@ -625,7 +625,7 @@ class Cache {
 		var useStorage = declVar("Batch_UseStorage",TBool,Param);
 		var vcount = declVar("Batch_Count",TInt,Param);
 		var vuniformBuffer = declVar("Batch_Buffer",TBuffer(TVec(4,VFloat),SVar(vcount),Uniform),Param);
-		var vstorageBuffer = declVar("Batch_StorageBuffer",TBuffer(TVec(4,VFloat),SConst(65535),RW),Param);
+		var vstorageBuffer = declVar("Batch_StorageBuffer",TBuffer(TVec(4,VFloat),SConst(128 * 1024 * 1024 >> 2),RW),Param);
 		var voffset = declVar("Batch_Offset", TInt, Local);
 		var euniformBuffer = { e : TVar(vuniformBuffer), p : pos, t : vuniformBuffer.type };
 		var estorageBuffer = { e : TVar(vstorageBuffer), p : pos, t : vstorageBuffer.type };