fixed handling of NATIVE flag

This commit is contained in:
aap
2017-08-21 23:15:31 +02:00
parent 0d8dc5d799
commit 8fc446f13b
10 changed files with 50 additions and 18 deletions

View File

@@ -27,9 +27,9 @@ instance(rw::ObjPipeline *rwpipe, Atomic *atomic)
{
ObjPipeline *pipe = (ObjPipeline*)rwpipe;
Geometry *geo = atomic->geometry;
if(geo->flags & Geometry::NATIVE)
// TODO: allow for REINSTANCE
if(geo->instData)
return;
geo->flags |= Geometry::NATIVE;
InstanceDataHeader *header = new InstanceDataHeader;
MeshHeader *meshh = geo->meshHeader;
geo->instData = header;
@@ -87,7 +87,8 @@ render(rw::ObjPipeline *rwpipe, Atomic *atomic)
{
ObjPipeline *pipe = (ObjPipeline*)rwpipe;
Geometry *geo = atomic->geometry;
if((geo->flags & Geometry::NATIVE) == 0)
// TODO: allow for REINSTANCE
if(geo->instData == nil)
pipe->instance(atomic);
assert(geo->instData != nil);
assert(geo->instData->platform == PLATFORM_GL3);

View File

@@ -322,7 +322,8 @@ instance(rw::ObjPipeline *rwpipe, Atomic *atomic)
{
ObjPipeline *pipe = (ObjPipeline*)rwpipe;
Geometry *geo = atomic->geometry;
if(geo->flags & Geometry::NATIVE)
// TODO: allow for REINSTANCE (or not, wdgl can't render)
if(geo->instData)
return;
InstanceDataHeader *header = new InstanceDataHeader;
geo->instData = header;
@@ -441,7 +442,6 @@ instance(rw::ObjPipeline *rwpipe, Atomic *atomic)
}
a++;
}
geo->flags |= Geometry::NATIVE;
}
static void