mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 16:19:44 +00:00
GLES: Specify glsl version precisely in depal.
Should prevent more of #11588 on vertex shaders, and may help Apple devices some too.
This commit is contained in:
parent
2dbdd73e5f
commit
e46701dee6
@ -51,7 +51,7 @@ void GenerateDepalShader300(char *buffer, GEBufferFormat pixelFormat, ShaderLang
|
||||
WRITE(p, "precision mediump float;\n");
|
||||
WRITE(p, "precision highp int;\n");
|
||||
} else {
|
||||
WRITE(p, "#version 330\n");
|
||||
WRITE(p, "#version %d\n", gl_extensions.GLSLVersion());
|
||||
}
|
||||
WRITE(p, "in vec2 v_texcoord0;\n");
|
||||
WRITE(p, "out vec4 fragColor0;\n");
|
||||
|
@ -75,8 +75,9 @@ bool DepalShaderCacheGLES::CreateVertexShader() {
|
||||
std::string prelude;
|
||||
if (gl_extensions.IsGLES) {
|
||||
prelude = useGL3_ ? "#version 300 es\n" : "#version 100\n";
|
||||
} else if (useGL3_) {
|
||||
prelude = "#version 330\n";
|
||||
} else {
|
||||
// We need to add a corresponding #version. Apple drivers fail without an exact match.
|
||||
prelude = StringFromFormat("#version %d\n", gl_extensions.GLSLVersion());
|
||||
}
|
||||
vertexShader_ = render_->CreateShader(GL_VERTEX_SHADER, prelude + src, "depal");
|
||||
return true;
|
||||
|
@ -579,7 +579,7 @@ std::string ApplyGLSLPrelude(const std::string &source, uint32_t stage) {
|
||||
std::string temp;
|
||||
std::string version = "";
|
||||
if (!gl_extensions.IsGLES && gl_extensions.IsCoreContext) {
|
||||
// We need to add a corresponding #version. Apple drives fail without an exact match.
|
||||
// We need to add a corresponding #version. Apple drivers fail without an exact match.
|
||||
version = StringFromFormat("#version %d\n", gl_extensions.GLSLVersion());
|
||||
}
|
||||
if (stage == GL_FRAGMENT_SHADER) {
|
||||
|
Loading…
Reference in New Issue
Block a user