little fix for d3d

This commit is contained in:
aap 2020-05-01 14:20:02 +02:00
parent e4b4bf9d16
commit dfedaee353
1 changed files with 6 additions and 0 deletions

View File

@ -909,7 +909,11 @@ static void
releaseDynamicVBs(void) releaseDynamicVBs(void)
{ {
DynamicVB *dvb; DynamicVB *dvb;
int i;
for(dvb = dynamicVBs; dvb; dvb = dvb->next){ for(dvb = dynamicVBs; dvb; dvb = dvb->next){
for(i = 0; i < MAXNUMSTREAMS; i++)
if(deviceCache.vertexStreams[i].buffer == *dvb->buf)
deviceCache.vertexStreams[i].buffer = nil;
destroyVertexBuffer(*dvb->buf); destroyVertexBuffer(*dvb->buf);
*dvb->buf = nil; *dvb->buf = nil;
} }
@ -955,6 +959,8 @@ releaseDynamicIBs(void)
{ {
DynamicIB *ivb; DynamicIB *ivb;
for(ivb = dynamicIBs; ivb; ivb = ivb->next){ for(ivb = dynamicIBs; ivb; ivb = ivb->next){
if(deviceCache.indices == *ivb->buf)
deviceCache.indices = nil;
destroyIndexBuffer(*ivb->buf); destroyIndexBuffer(*ivb->buf);
*ivb->buf = nil; *ivb->buf = nil;
} }