forked from LeenkxTeam/LNXSDK
Deinterleaved Vertex Buffer Update
This commit is contained in:
@ -102,8 +102,9 @@ class ShaderContext {
|
||||
constants = [];
|
||||
textureUnits = [];
|
||||
|
||||
var instStruct: VertexStructure = null;
|
||||
if (instancingType > 0) { // Instancing
|
||||
var instStruct = new VertexStructure();
|
||||
instStruct = new VertexStructure();
|
||||
instStruct.add("ipos", VertexData.Float3);
|
||||
if (instancingType == 2 || instancingType == 4) {
|
||||
instStruct.add("irot", VertexData.Float3);
|
||||
@ -117,11 +118,19 @@ class ShaderContext {
|
||||
this.instanceStride = Std.int(instStruct.byteSize() / 4);
|
||||
|
||||
instStruct.instanced = true;
|
||||
pipeState.inputLayout = [structure, instStruct];
|
||||
}
|
||||
else { // Regular
|
||||
pipeState.inputLayout = [structure];
|
||||
#if lnx_deinterleaved
|
||||
var layouts: Array<VertexStructure> = [];
|
||||
for (e in structure.elements) {
|
||||
var s = new VertexStructure();
|
||||
s.add(e.name, e.data);
|
||||
layouts.push(s);
|
||||
}
|
||||
#else
|
||||
var layouts = [structure];
|
||||
#end
|
||||
if (instStruct != null) layouts.push(instStruct);
|
||||
pipeState.inputLayout = layouts;
|
||||
|
||||
// Depth
|
||||
pipeState.depthWrite = raw.depth_write;
|
||||
|
||||
Reference in New Issue
Block a user