Perf tweaks
This commit is contained in:
parent
cfefce44a6
commit
06529d4fe7
16
GL/flush.c
16
GL/flush.c
|
@ -2,9 +2,9 @@
|
||||||
#include "../containers/aligned_vector.h"
|
#include "../containers/aligned_vector.h"
|
||||||
#include "private.h"
|
#include "private.h"
|
||||||
|
|
||||||
static PolyList OP_LIST;
|
PolyList OP_LIST;
|
||||||
static PolyList PT_LIST;
|
PolyList PT_LIST;
|
||||||
static PolyList TR_LIST;
|
PolyList TR_LIST;
|
||||||
|
|
||||||
/** Don't fully comply to the GL standard to make some performance
|
/** Don't fully comply to the GL standard to make some performance
|
||||||
* gains. Specifically glDepthRange will be ignored, and the final
|
* gains. Specifically glDepthRange will be ignored, and the final
|
||||||
|
@ -15,16 +15,6 @@ static PolyList TR_LIST;
|
||||||
|
|
||||||
#define FAST_MODE GL_TRUE
|
#define FAST_MODE GL_TRUE
|
||||||
|
|
||||||
PolyList* _glActivePolyList() {
|
|
||||||
if(_glIsBlendingEnabled()) {
|
|
||||||
return &TR_LIST;
|
|
||||||
} else if(_glIsAlphaTestEnabled()) {
|
|
||||||
return &PT_LIST;
|
|
||||||
} else {
|
|
||||||
return &OP_LIST;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PolyList* _glOpaquePolyList() {
|
PolyList* _glOpaquePolyList() {
|
||||||
return &OP_LIST;
|
return &OP_LIST;
|
||||||
}
|
}
|
||||||
|
|
27
GL/private.h
27
GL/private.h
|
@ -277,7 +277,6 @@ struct SubmissionTarget;
|
||||||
float _glClipLineToNearZ(const Vertex* v1, const Vertex* v2, Vertex* vout);
|
float _glClipLineToNearZ(const Vertex* v1, const Vertex* v2, Vertex* vout);
|
||||||
void _glClipTriangleStrip(SubmissionTarget* target, uint8_t fladeShade);
|
void _glClipTriangleStrip(SubmissionTarget* target, uint8_t fladeShade);
|
||||||
|
|
||||||
PolyList *_glActivePolyList();
|
|
||||||
PolyList* _glOpaquePolyList();
|
PolyList* _glOpaquePolyList();
|
||||||
PolyList* _glPunchThruPolyList();
|
PolyList* _glPunchThruPolyList();
|
||||||
PolyList *_glTransparentPolyList();
|
PolyList *_glTransparentPolyList();
|
||||||
|
@ -338,8 +337,30 @@ void _glSetInternalPaletteFormat(GLenum val);
|
||||||
GLboolean _glIsSharedTexturePaletteEnabled();
|
GLboolean _glIsSharedTexturePaletteEnabled();
|
||||||
void _glApplyColorTable(TexturePalette *palette);
|
void _glApplyColorTable(TexturePalette *palette);
|
||||||
|
|
||||||
GLboolean _glIsBlendingEnabled();
|
extern GLboolean BLEND_ENABLED;
|
||||||
GLboolean _glIsAlphaTestEnabled();
|
extern GLboolean ALPHA_TEST_ENABLED;
|
||||||
|
|
||||||
|
GL_FORCE_INLINE GLboolean _glIsBlendingEnabled() {
|
||||||
|
return BLEND_ENABLED;
|
||||||
|
}
|
||||||
|
|
||||||
|
GL_FORCE_INLINE GLboolean _glIsAlphaTestEnabled() {
|
||||||
|
return ALPHA_TEST_ENABLED;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern PolyList OP_LIST;
|
||||||
|
extern PolyList PT_LIST;
|
||||||
|
extern PolyList TR_LIST;
|
||||||
|
|
||||||
|
GL_FORCE_INLINE PolyList* _glActivePolyList() {
|
||||||
|
if(BLEND_ENABLED) {
|
||||||
|
return &TR_LIST;
|
||||||
|
} else if(ALPHA_TEST_ENABLED) {
|
||||||
|
return &PT_LIST;
|
||||||
|
} else {
|
||||||
|
return &OP_LIST;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GLboolean _glIsMipmapComplete(const TextureObject* obj);
|
GLboolean _glIsMipmapComplete(const TextureObject* obj);
|
||||||
GLubyte* _glGetMipmapLocation(const TextureObject* obj, GLuint level);
|
GLubyte* _glGetMipmapLocation(const TextureObject* obj, GLuint level);
|
||||||
|
|
12
GL/state.c
12
GL/state.c
|
@ -23,7 +23,7 @@ static GLboolean LIGHTING_ENABLED = GL_FALSE;
|
||||||
/* Is the shared texture palette enabled? */
|
/* Is the shared texture palette enabled? */
|
||||||
static GLboolean SHARED_PALETTE_ENABLED = GL_FALSE;
|
static GLboolean SHARED_PALETTE_ENABLED = GL_FALSE;
|
||||||
|
|
||||||
static GLboolean ALPHA_TEST_ENABLED = GL_FALSE;
|
GLboolean ALPHA_TEST_ENABLED = GL_FALSE;
|
||||||
|
|
||||||
static GLboolean POLYGON_OFFSET_ENABLED = GL_FALSE;
|
static GLboolean POLYGON_OFFSET_ENABLED = GL_FALSE;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ static int _calc_pvr_depth_test() {
|
||||||
|
|
||||||
static GLenum BLEND_SFACTOR = GL_ONE;
|
static GLenum BLEND_SFACTOR = GL_ONE;
|
||||||
static GLenum BLEND_DFACTOR = GL_ZERO;
|
static GLenum BLEND_DFACTOR = GL_ZERO;
|
||||||
static GLboolean BLEND_ENABLED = GL_FALSE;
|
GLboolean BLEND_ENABLED = GL_FALSE;
|
||||||
|
|
||||||
static GLfloat OFFSET_FACTOR = 0.0f;
|
static GLfloat OFFSET_FACTOR = 0.0f;
|
||||||
static GLfloat OFFSET_UNITS = 0.0f;
|
static GLfloat OFFSET_UNITS = 0.0f;
|
||||||
|
@ -98,14 +98,6 @@ GLboolean _glIsNormalizeEnabled() {
|
||||||
return NORMALIZE_ENABLED;
|
return NORMALIZE_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLboolean _glIsBlendingEnabled() {
|
|
||||||
return BLEND_ENABLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLboolean _glIsAlphaTestEnabled() {
|
|
||||||
return ALPHA_TEST_ENABLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _calcPVRBlendFactor(GLenum factor) {
|
static int _calcPVRBlendFactor(GLenum factor) {
|
||||||
switch(factor) {
|
switch(factor) {
|
||||||
case GL_ZERO:
|
case GL_ZERO:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user