mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-23 01:57:21 +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,6 +10,7 @@ USERINCLUDE .
|
||||||
|
|
||||||
MACRO LIBRW
|
MACRO LIBRW
|
||||||
MACRO RW_GL3
|
MACRO RW_GL3
|
||||||
|
MACRO RW_OPENGL // because carbide is too stupid
|
||||||
MACRO MASTER
|
MACRO MASTER
|
||||||
|
|
||||||
DEBUGGABLE
|
DEBUGGABLE
|
||||||
|
|
|
||||||
10
vendor/librw/src/gl/gl3pipe.cpp
vendored
10
vendor/librw/src/gl/gl3pipe.cpp
vendored
|
|
@ -28,7 +28,7 @@ freeInstanceData(Geometry *geometry)
|
||||||
return;
|
return;
|
||||||
InstanceDataHeader *header = (InstanceDataHeader*)geometry->instData;
|
InstanceDataHeader *header = (InstanceDataHeader*)geometry->instData;
|
||||||
geometry->instData = nil;
|
geometry->instData = nil;
|
||||||
glDeleteBuffers(1, &header->ibo);
|
// glDeleteBuffers(1, &header->ibo);
|
||||||
glDeleteBuffers(1, &header->vbo);
|
glDeleteBuffers(1, &header->vbo);
|
||||||
#ifdef RW_GL_USE_VAOS
|
#ifdef RW_GL_USE_VAOS
|
||||||
glDeleteBuffers(1, &header->vao);
|
glDeleteBuffers(1, &header->vao);
|
||||||
|
|
@ -92,10 +92,10 @@ instanceMesh(rw::ObjPipeline *rwpipe, Geometry *geo)
|
||||||
glGenVertexArrays(1, &header->vao);
|
glGenVertexArrays(1, &header->vao);
|
||||||
glBindVertexArray(header->vao);
|
glBindVertexArray(header->vao);
|
||||||
#endif
|
#endif
|
||||||
glGenBuffers(1, &header->ibo);
|
// glGenBuffers(1, &header->ibo);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
// glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, header->totalNumIndex*2,
|
// glBufferData(GL_ELEMENT_ARRAY_BUFFER, header->totalNumIndex*2,
|
||||||
header->indexBuffer, GL_STATIC_DRAW);
|
// header->indexBuffer, GL_STATIC_DRAW);
|
||||||
|
|
||||||
return header;
|
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 <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "../rwbase.h"
|
#include "../rwbase.h"
|
||||||
#include "../rwerror.h"
|
#include "../rwerror.h"
|
||||||
|
|
@ -25,7 +26,7 @@ drawInst_simple(InstanceDataHeader *header, InstanceData *inst)
|
||||||
{
|
{
|
||||||
flushCache();
|
flushCache();
|
||||||
glDrawElements(header->primType, inst->numIndex,
|
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
|
// 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
|
void
|
||||||
setupVertexInput(InstanceDataHeader *header)
|
setupVertexInput(InstanceDataHeader *header)
|
||||||
{
|
{
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, header->ibo);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
glBindBuffer(GL_ARRAY_BUFFER, header->vbo);
|
||||||
setAttribPointers(header->attribDesc, header->numAttribs);
|
setAttribPointers(header->attribDesc, header->numAttribs);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue