mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Outrun on OpenGL: Fix weird purple highlight seen on some devices
mediump int is just not enough.
This commit is contained in:
1 parent
0510101f6c
commit
d99cba7308
3 files changed
+12
No files matched your search
@@ -264,6 +264,13 @@ void ShaderWriter::EndFSMain(const char *vec4_color_variable) {
|
||||
C("}\n");
|
||||
}
|
||||
|
||||
void ShaderWriter::HighPrecisionInt() {
|
||||
if (ShaderLanguageIsOpenGL(lang_.shaderLanguage) && lang_.gles) {
|
||||
C("precision highp int;\n");
|
||||
C("precision highp uint;\n");
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderWriter::DeclareTexture2D(const char *name, int binding) {
|
||||
switch (lang_.shaderLanguage) {
|
||||
case HLSL_D3D11:
|
||||
|
||||
@@ -63,6 +63,9 @@ public:
|
||||
// F: Formats into the buffer.
|
||||
ShaderWriter &F(const char *format, ...);
|
||||
|
||||
// Useful for fragment shaders in GLES.
|
||||
void HighPrecisionInt();
|
||||
|
||||
// Several of the shader languages ignore samplers, beware of that.
|
||||
void DeclareSampler2D(const char *name, int binding);
|
||||
void DeclareTexture2D(const char *name, int binding);
|
||||
|
||||
@@ -18,6 +18,8 @@ bool GenerateReinterpretFragmentShader(char *buffer, GEBufferFormat from, GEBuff
|
||||
|
||||
ShaderWriter writer(buffer, lang, ShaderStage::Fragment, nullptr, 0);
|
||||
|
||||
writer.HighPrecisionInt();
|
||||
|
||||
writer.DeclareSampler2D("samp", 0);
|
||||
writer.DeclareTexture2D("tex", 0);
|
||||
|
||||
|
||||
Reference in new issue
Block a user