OGLRender:

- Force cache alignment on the 5-bit LUT.
- Better localize OpenGL-specific LUTs.
This commit is contained in:
rogerman 2015-03-27 19:52:31 +00:00
parent e9b919d792
commit 75bdce0942
2 changed files with 11 additions and 16 deletions

View File

@ -40,16 +40,16 @@ static OGLVersion _OGLDriverVersion = {0, 0, 0};
static OpenGLRenderer *_OGLRenderer = NULL; static OpenGLRenderer *_OGLRenderer = NULL;
// Lookup Tables // Lookup Tables
CACHE_ALIGN GLfloat material_8bit_to_float[256] = {0}; static CACHE_ALIGN GLfloat material_8bit_to_float[256] = {0};
CACHE_ALIGN GLuint dsDepthToD24S8_LUT[32768] = {0}; static CACHE_ALIGN GLuint dsDepthToD24S8_LUT[32768] = {0};
const GLfloat divide5bitBy31_LUT[32] = {0.0, 0.03225806451613, 0.06451612903226, 0.09677419354839, static CACHE_ALIGN const GLfloat divide5bitBy31_LUT[32] = {0.0, 0.03225806451613, 0.06451612903226, 0.09677419354839,
0.1290322580645, 0.1612903225806, 0.1935483870968, 0.2258064516129, 0.1290322580645, 0.1612903225806, 0.1935483870968, 0.2258064516129,
0.258064516129, 0.2903225806452, 0.3225806451613, 0.3548387096774, 0.258064516129, 0.2903225806452, 0.3225806451613, 0.3548387096774,
0.3870967741935, 0.4193548387097, 0.4516129032258, 0.4838709677419, 0.3870967741935, 0.4193548387097, 0.4516129032258, 0.4838709677419,
0.5161290322581, 0.5483870967742, 0.5806451612903, 0.6129032258065, 0.5161290322581, 0.5483870967742, 0.5806451612903, 0.6129032258065,
0.6451612903226, 0.6774193548387, 0.7096774193548, 0.741935483871, 0.6451612903226, 0.6774193548387, 0.7096774193548, 0.741935483871,
0.7741935483871, 0.8064516129032, 0.8387096774194, 0.8709677419355, 0.7741935483871, 0.8064516129032, 0.8387096774194, 0.8709677419355,
0.9032258064516, 0.9354838709677, 0.9677419354839, 1.0}; 0.9032258064516, 0.9354838709677, 0.9677419354839, 1.0};
static bool BEGINGL() static bool BEGINGL()
{ {

View File

@ -1,7 +1,7 @@
/* /*
Copyright (C) 2006 yopyop Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 shash Copyright (C) 2006-2007 shash
Copyright (C) 2008-2013 DeSmuME team Copyright (C) 2008-2015 DeSmuME team
This file is free software: you can redistribute it and/or modify This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -383,11 +383,6 @@ extern void (*oglrender_endOpenGL)();
extern void (*OGLLoadEntryPoints_3_2_Func)(); extern void (*OGLLoadEntryPoints_3_2_Func)();
extern void (*OGLCreateRenderer_3_2_Func)(OpenGLRenderer **rendererPtr); extern void (*OGLCreateRenderer_3_2_Func)(OpenGLRenderer **rendererPtr);
// Lookup Tables
extern CACHE_ALIGN GLfloat material_8bit_to_float[256];
extern CACHE_ALIGN GLuint dsDepthToD24S8_LUT[32768];
extern const GLfloat divide5bitBy31_LUT[32];
FORCEINLINE u32 BGRA8888_32_To_RGBA6665_32(const u32 srcPix); FORCEINLINE u32 BGRA8888_32_To_RGBA6665_32(const u32 srcPix);
FORCEINLINE u32 BGRA8888_32Rev_To_RGBA6665_32Rev(const u32 srcPix); FORCEINLINE u32 BGRA8888_32Rev_To_RGBA6665_32Rev(const u32 srcPix);
bool IsVersionSupported(unsigned int checkVersionMajor, unsigned int checkVersionMinor, unsigned int checkVersionRevision); bool IsVersionSupported(unsigned int checkVersionMajor, unsigned int checkVersionMinor, unsigned int checkVersionRevision);