mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 23:59:27 +01:00
Small bit of clean up in GLES-software.
This commit is contained in:
parent
f6ef6fa0d9
commit
296b9b1c16
@ -218,11 +218,14 @@ if(FASTLOG)
|
|||||||
add_definitions(-DDEBUGFAST)
|
add_definitions(-DDEBUGFAST)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# For now GLES and EGL are tied to each other.
|
||||||
|
# Enabling GLES also disables the OpenGL plugin.
|
||||||
option(USE_GLES "Enables GLES, disables OGL" OFF)
|
option(USE_GLES "Enables GLES, disables OGL" OFF)
|
||||||
if(USE_GLES)
|
if(USE_GLES)
|
||||||
message("GLES rendering enabled")
|
message("GLES rendering enabled")
|
||||||
add_definitions(-DUSE_GLES)
|
add_definitions(-DUSE_GLES)
|
||||||
add_definitions(-DUSE_EGL)
|
add_definitions(-DUSE_EGL)
|
||||||
|
set(USE_EGL True)
|
||||||
endif()
|
endif()
|
||||||
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)
|
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)
|
||||||
|
|
||||||
|
@ -29,6 +29,19 @@
|
|||||||
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
|
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_GLES
|
||||||
|
#define TEX2D GL_TEXTURE_2D
|
||||||
|
#define PREC "highp"
|
||||||
|
#define TEXTYPE "sampler2D"
|
||||||
|
#define TEXFUNC "texture2D"
|
||||||
|
#else
|
||||||
|
#define TEX2D GL_TEXTURE_RECTANGLE_ARB
|
||||||
|
#define PREC
|
||||||
|
#define TEXTYPE "sampler2DRect"
|
||||||
|
#define TEXFUNC "texture2DRect"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -26,17 +26,6 @@
|
|||||||
#include "DebugUtil.h"
|
#include "DebugUtil.h"
|
||||||
|
|
||||||
#define TEMP_SIZE (1024*1024*4)
|
#define TEMP_SIZE (1024*1024*4)
|
||||||
#ifdef USE_GLES
|
|
||||||
#define PREC "highp"
|
|
||||||
#define TEX2D GL_TEXTURE_2D
|
|
||||||
#define TEXTYPE "sampler2D"
|
|
||||||
#define TEXFUNC "texture2D"
|
|
||||||
#else
|
|
||||||
#define PREC
|
|
||||||
#define TEX2D GL_TEXTURE_RECTANGLE_ARB
|
|
||||||
#define TEXTYPE "sampler2DRect"
|
|
||||||
#define TEXFUNC "texture2DRect"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace HwRasterizer
|
namespace HwRasterizer
|
||||||
{
|
{
|
||||||
@ -176,7 +165,6 @@ namespace HwRasterizer
|
|||||||
#endif
|
#endif
|
||||||
TexCacheEntry &cacheEntry = textures[imageAddr];
|
TexCacheEntry &cacheEntry = textures[imageAddr];
|
||||||
cacheEntry.Update();
|
cacheEntry.Update();
|
||||||
GL_REPORT_ERRORD();
|
|
||||||
|
|
||||||
glBindTexture(TEX2D, cacheEntry.texture);
|
glBindTexture(TEX2D, cacheEntry.texture);
|
||||||
glTexParameteri(TEX2D, GL_TEXTURE_MAG_FILTER, texUnit.texMode0[0].mag_filter ? GL_LINEAR : GL_NEAREST);
|
glTexParameteri(TEX2D, GL_TEXTURE_MAG_FILTER, texUnit.texMode0[0].mag_filter ? GL_LINEAR : GL_NEAREST);
|
||||||
@ -187,7 +175,6 @@ namespace HwRasterizer
|
|||||||
void BeginTriangles()
|
void BeginTriangles()
|
||||||
{
|
{
|
||||||
// disabling depth test sometimes allows more things to be visible
|
// disabling depth test sometimes allows more things to be visible
|
||||||
GL_REPORT_ERRORD();
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
@ -195,7 +182,6 @@ namespace HwRasterizer
|
|||||||
|
|
||||||
if (hasTexture)
|
if (hasTexture)
|
||||||
LoadTexture();
|
LoadTexture();
|
||||||
GL_REPORT_ERRORD();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndTriangles()
|
void EndTriangles()
|
||||||
@ -237,9 +223,9 @@ namespace HwRasterizer
|
|||||||
{ x2, y2, z2 }
|
{ x2, y2, z2 }
|
||||||
};
|
};
|
||||||
static const GLfloat col[3][4] = {
|
static const GLfloat col[3][4] = {
|
||||||
{ r0, g0, b0, 0.1f },
|
{ r0, g0, b0, 1.0f },
|
||||||
{ r1, g1, b1, 0.1f },
|
{ r1, g1, b1, 1.0f },
|
||||||
{ r2, g2, b2, 0.1f }
|
{ r2, g2, b2, 1.0f }
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
glUseProgram(colProg);
|
glUseProgram(colProg);
|
||||||
|
@ -29,19 +29,7 @@ static GLint attr_pos = -1, attr_tex = -1;
|
|||||||
static GLint uni_tex = -1;
|
static GLint uni_tex = -1;
|
||||||
static GLuint program;
|
static GLuint program;
|
||||||
|
|
||||||
#ifdef USE_GLES
|
// Rasterfont isn't compatible with GLES
|
||||||
#define PREC "highp"
|
|
||||||
#define TEX2D GL_TEXTURE_2D
|
|
||||||
#define TEXTYPE "sampler2D"
|
|
||||||
#define TEXFUNC "texture2D"
|
|
||||||
#else
|
|
||||||
#define PREC
|
|
||||||
#define TEX2D GL_TEXTURE_RECTANGLE_ARB
|
|
||||||
#define TEXTYPE "sampler2DRect"
|
|
||||||
#define TEXFUNC "texture2DRect"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef USE_GLES
|
#ifndef USE_GLES
|
||||||
RasterFont* s_pfont = NULL;
|
RasterFont* s_pfont = NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -104,9 +92,9 @@ void SWRenderer::Prepare()
|
|||||||
|
|
||||||
void SWRenderer::RenderText(const char* pstr, int left, int top, u32 color)
|
void SWRenderer::RenderText(const char* pstr, int left, int top, u32 color)
|
||||||
{
|
{
|
||||||
|
#ifndef USE_GLES
|
||||||
int nBackbufferWidth = (int)GLInterface->GetBackBufferWidth();
|
int nBackbufferWidth = (int)GLInterface->GetBackBufferWidth();
|
||||||
int nBackbufferHeight = (int)GLInterface->GetBackBufferHeight();
|
int nBackbufferHeight = (int)GLInterface->GetBackBufferHeight();
|
||||||
#ifndef USE_GLES
|
|
||||||
glColor4f(((color>>16) & 0xff)/255.0f, ((color>> 8) & 0xff)/255.0f,
|
glColor4f(((color>>16) & 0xff)/255.0f, ((color>> 8) & 0xff)/255.0f,
|
||||||
((color>> 0) & 0xff)/255.0f, ((color>>24) & 0xFF)/255.0f);
|
((color>> 0) & 0xff)/255.0f, ((color>>24) & 0xFF)/255.0f);
|
||||||
s_pfont->printMultilineText(pstr,
|
s_pfont->printMultilineText(pstr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user