Преглед на файлове

use spec signature instead of rt signature for batchShader id generation

Nicolas Cannasse преди 6 години
родител
ревизия
f69e8b8fb1
променени са 2 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 1 1
      hxsl/Cache.hx
  2. 3 1
      hxsl/CacheFile.hx

+ 1 - 1
hxsl/Cache.hx

@@ -427,7 +427,7 @@ class Cache {
 
 	function createBatchShader( rt : RuntimeShader ) {
 		var s = new hxsl.SharedShader("");
-		var id = rt.signature.substr(0, 8);
+		var id = rt.spec.signature.substr(0, 8);
 
 		function declVar( name, t, kind ) : TVar {
 			return {

+ 3 - 1
hxsl/CacheFile.hx

@@ -273,8 +273,10 @@ class CacheFile extends Cache {
 				if( r == null ) continue;
 				//log("Recompile "+[for( s in shaderList ) shaderName(s)]);
 				var rt = link(shaderList, batchMode); // will compile + update linkMap
-				if( rt.spec.signature != r.specSign )
+				if( rt.spec.signature != r.specSign ) {
+					var signParts = [for( i in rt.spec.instances ) i.shader.data.name+"_" + i.bits + "_" + i.index];					
 					throw "assert";
+				}
 				runtimeShaders.push(rt);
 				rttMap.set(r.specSign, rt);
 			}