mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-22 17:47:20 +03:00
Don't use IBOs
This commit is contained in:
parent
7dae1b0268
commit
1209902fe9
3 changed files with 9 additions and 7 deletions
10
vendor/librw/src/gl/gl3pipe.cpp
vendored
10
vendor/librw/src/gl/gl3pipe.cpp
vendored
|
|
@ -28,7 +28,7 @@ freeInstanceData(Geometry *geometry)
|
|||
return;
|
||||
InstanceDataHeader *header = (InstanceDataHeader*)geometry->instData;
|
||||
geometry->instData = nil;
|
||||
glDeleteBuffers(1, &header->ibo);
|
||||
// glDeleteBuffers(1, &header->ibo);
|
||||
glDeleteBuffers(1, &header->vbo);
|
||||
#ifdef RW_GL_USE_VAOS
|
||||
glDeleteBuffers(1, &header->vao);
|
||||
|
|
@ -92,10 +92,10 @@ instanceMesh(rw::ObjPipeline *rwpipe, Geometry *geo)
|
|||
glGenVertexArrays(1, &header->vao);
|
||||
glBindVertexArray(header->vao);
|
||||
#endif
|
||||
glGenBuffers(1, &header->ibo);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, header->totalNumIndex*2,
|
||||
header->indexBuffer, GL_STATIC_DRAW);
|
||||
// glGenBuffers(1, &header->ibo);
|
||||
// glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
// glBufferData(GL_ELEMENT_ARRAY_BUFFER, header->totalNumIndex*2,
|
||||
// header->indexBuffer, GL_STATIC_DRAW);
|
||||
|
||||
return header;
|
||||
}
|
||||
|
|
|
|||
5
vendor/librw/src/gl/gl3render.cpp
vendored
5
vendor/librw/src/gl/gl3render.cpp
vendored
|
|
@ -1,6 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "../rwbase.h"
|
||||
#include "../rwerror.h"
|
||||
|
|
@ -25,7 +26,7 @@ drawInst_simple(InstanceDataHeader *header, InstanceData *inst)
|
|||
{
|
||||
flushCache();
|
||||
glDrawElements(header->primType, inst->numIndex,
|
||||
GL_UNSIGNED_SHORT, (void*)(uintptr)inst->offset);
|
||||
GL_UNSIGNED_SHORT, ((uint8*) header->indexBuffer) + inst->offset);
|
||||
}
|
||||
|
||||
// Emulate PS2 GS alpha test FB_ONLY case: failed alpha writes to frame- but not to depth buffer
|
||||
|
|
@ -93,7 +94,7 @@ disableAttribPointers(AttribDesc *attribDescs, int32 numAttribs)
|
|||
void
|
||||
setupVertexInput(InstanceDataHeader *header)
|
||||
{
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue