mcst-linux-kernel/patches-2024.06.26/gl4es-1.1.4/0075-GLES2-improve-logging-...

46 lines
2.3 KiB
Diff

From 75f4ba82b0c7bd35b17af9b2e962bc78afa3859d Mon Sep 17 00:00:00 2001
From: ptitSeb <sebastien.chev@gmail.com>
Date: Sat, 24 Oct 2020 14:41:02 +0200
Subject: [PATCH 075/233] [GLES2] improve logging of ARB program error
---
src/gl/fpe.c | 8 +++++++-
src/gl/oldprogram.c | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/gl/fpe.c b/src/gl/fpe.c
index 5fd2e134..f5011763 100755
--- a/src/gl/fpe.c
+++ b/src/gl/fpe.c
@@ -335,7 +335,13 @@ void fpe_oldprogram(fpe_state_t* state) {
if(status!=GL_TRUE) {
char buff[1000];
gles_glGetProgramInfoLog(glstate->fpe->prog, 1000, NULL, buff);
- printf("LIBGL: FPE ARB Program link failed: %s\n", buff);
+ if(globals4es.logshader)
+ printf("LIBGL: FPE ARB Program link failed: %s\n with vertex %s%s%s%s%s and fragment %s%s%s%s%s\n",
+ buff,
+ state->vertex_prg_id?"custom:\n":"default", state->vertex_prg_id?old_vtx->string:"", state->vertex_prg_id?"\nconverted:\n":"", state->vertex_prg_id?old_vtx->shader->source:"", state->vertex_prg_id?"\n":"",
+ state->fragment_prg_id?"custom:\n":"default", state->vertex_prg_id?old_frg->string:"", state->fragment_prg_id?"\nconverted:\n":"", state->fragment_prg_id?old_vtx->shader->source:"", state->fragment_prg_id?"\n":"");
+ else
+ printf("LIBGL: FPE ARB Program link failed: %s\n", buff);
}
DBG(printf("Created program %d, with vertex=%d (old=%d) fragment=%d (old=%d), alpha=%d/%d\n", glstate->fpe->prog, glstate->fpe->vert, state->vertex_prg_id, glstate->fpe->frag, state->fragment_prg_id, state->alphatest, state->alphafunc);)
}
diff --git a/src/gl/oldprogram.c b/src/gl/oldprogram.c
index 3006b58f..2ed96af1 100755
--- a/src/gl/oldprogram.c
+++ b/src/gl/oldprogram.c
@@ -157,7 +157,7 @@ void gl4es_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const G
// Convert to GLSL
const GLchar * p[1] = {0};
p[0] = gl4es_convertARB(old->string, vertex, &glstate->glsl->error_msg, &glstate->glsl->error_ptr);
- if(!p[0]) {
+ if((!p[0]) || (glstate->glsl->error_ptr!=-1)) {
DBG(printf("Error with ARB->GLSL conversion\nsource is:\n%s\n======\n", old->shader->source);)
errorShim(GL_INVALID_OPERATION);
return;
--
2.11.0