|
@@ -331,7 +331,8 @@ class MeshBatch extends MultiMaterial {
|
|
|
for( index in 0...materials.length ) {
|
|
|
var mat = materials[index];
|
|
|
if( mat == null ) continue;
|
|
|
- var matInfo = @:privateAccess instanced.primitive.getMaterialIndexes(index);
|
|
|
+ var matCount = @:privateAccess instanced.primitive.getMaterialIndexCount(index);
|
|
|
+ var matStart = @:privateAccess instanced.primitive.getMaterialIndexStart(index);
|
|
|
for( p in mat.getPasses() ) @:privateAccess {
|
|
|
var ctx = scene.renderer.getPassByName(p.name);
|
|
|
if( ctx == null ) throw "Could't find renderer pass "+p.name;
|
|
@@ -342,8 +343,8 @@ class MeshBatch extends MultiMaterial {
|
|
|
var shader = output.shaderCache.makeBatchShader(rt, shaders, instancedParams);
|
|
|
|
|
|
var b = new BatchData();
|
|
|
- b.indexCount = matInfo.count;
|
|
|
- b.indexStart = matInfo.start;
|
|
|
+ b.indexCount = matCount;
|
|
|
+ b.indexStart = matStart;
|
|
|
b.paramsCount = shader.paramsSize;
|
|
|
b.maxInstance = Std.int( ( useStorageBuffer ? MAX_STORAGE_BUFFER_ELEMENTS : MAX_BUFFER_ELEMENTS ) / b.paramsCount);
|
|
|
b.bufferFormat = hxd.BufferFormat.VEC4_DATA;
|
|
@@ -757,9 +758,8 @@ class MeshBatch extends MultiMaterial {
|
|
|
matInfos = alloc.allocBuffer( materialCount, hxd.BufferFormat.VEC4_DATA, Uniform );
|
|
|
var pos : Int = 0;
|
|
|
for ( i in 0...materials.length ) {
|
|
|
- var matInfo = prim.getMaterialIndexes(i);
|
|
|
- tmpMatInfos[pos++] = matInfo.count;
|
|
|
- tmpMatInfos[pos++] = matInfo.start;
|
|
|
+ tmpMatInfos[pos++] = prim.getMaterialIndexCount(i);
|
|
|
+ tmpMatInfos[pos++] = prim.getMaterialIndexStart(i);
|
|
|
pos += 2;
|
|
|
}
|
|
|
matInfos.uploadFloats( tmpMatInfos, 0, materialCount );
|