mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 08:39:51 +00:00
Move Apple GL2.0 forcing to a common place.
This commit is contained in:
parent
6088c7d5f5
commit
086dc9e0ed
@ -15,14 +15,6 @@
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
// SDL 1.2 on Apple does not have support for OpenGL 3 and hence needs
|
||||
// special treatment in the shader generator.
|
||||
#if defined(__APPLE__)
|
||||
const bool forceOpenGL2_0 = true;
|
||||
#else
|
||||
const bool forceOpenGL2_0 = false;
|
||||
#endif
|
||||
|
||||
#include <cstdio>
|
||||
#include <sstream>
|
||||
|
||||
@ -116,8 +108,7 @@ bool GenerateFragmentShader(const ShaderID &id, char *buffer) {
|
||||
|
||||
WRITE(p, "precision lowp float;\n");
|
||||
} else {
|
||||
// TODO: Handle this in VersionGEThan?
|
||||
if (!forceOpenGL2_0 || gl_extensions.IsCoreContext) {
|
||||
if (!gl_extensions.ForceGL2 || gl_extensions.IsCoreContext) {
|
||||
if (gl_extensions.VersionGEThan(3, 3, 0)) {
|
||||
fragColor0 = "fragColor0";
|
||||
texture = "texture";
|
||||
|
@ -34,14 +34,6 @@
|
||||
#include "GPU/Common/ShaderId.h"
|
||||
#include "GPU/Common/VertexDecoderCommon.h"
|
||||
|
||||
// SDL 1.2 on Apple does not have support for OpenGL 3 and hence needs
|
||||
// special treatment in the shader generator.
|
||||
#if defined(__APPLE__)
|
||||
const bool forceOpenGL2_0 = true;
|
||||
#else
|
||||
const bool forceOpenGL2_0 = false;
|
||||
#endif
|
||||
|
||||
#undef WRITE
|
||||
|
||||
#define WRITE p+=sprintf
|
||||
@ -130,8 +122,7 @@ void GenerateVertexShader(const ShaderID &id, char *buffer) {
|
||||
highpFog = (gl_extensions.bugs & BUG_PVR_SHADER_PRECISION_BAD) ? true : false;
|
||||
highpTexcoord = highpFog;
|
||||
} else {
|
||||
// TODO: Handle this in VersionGEThan?
|
||||
if (!forceOpenGL2_0 || gl_extensions.IsCoreContext) {
|
||||
if (!gl_extensions.ForceGL2 || gl_extensions.IsCoreContext) {
|
||||
if (gl_extensions.VersionGEThan(3, 3, 0)) {
|
||||
glslES30 = true;
|
||||
WRITE(p, "#version 330\n");
|
||||
|
@ -379,6 +379,12 @@ void CheckGLExtensions() {
|
||||
gl_extensions.ARB_vertex_array_object = true;
|
||||
gl_extensions.ARB_framebuffer_object = true;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
if (!gl_extensions.IsGLES && !gl_extensions.IsCoreContext) {
|
||||
// Apple doesn't allow OpenGL 3.x+ in compatibility contexts.
|
||||
gl_extensions.ForceGL2 = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
ProcessGPUFeatures();
|
||||
|
||||
|
@ -37,6 +37,7 @@ struct GLExtensions {
|
||||
bool IsGLES;
|
||||
bool IsCoreContext;
|
||||
bool GLES3; // true if the full OpenGL ES 3.0 is supported
|
||||
bool ForceGL2;
|
||||
|
||||
// OES
|
||||
bool OES_depth24;
|
||||
|
Loading…
Reference in New Issue
Block a user