gl4es icon indicating copy to clipboard operation
gl4es copied to clipboard

Missing function - GL_EXT_framebuffer_blit

Open ITotalJustice opened this issue 6 years ago • 10 comments

Hi! So i am trying to boot Psychonauts using your box86 with gl4es on the raspberry pi4, however I get the error:

ERROR: Missing required OpenGL extensions:
    - GL_EXT_framebuffer_blit
Start Up completed in 0.85 seconds
LIBGL: Shuting down
Segmentation fault

After which the game opens a window for a half second then seg faults.

ITotalJustice avatar Aug 03 '19 17:08 ITotalJustice

Ah. I have added the extension string (because the function is already supported)

ptitSeb avatar Aug 03 '19 17:08 ptitSeb

Thank you! Got a lot further now, however the game fails to boot (after a minute or so). I still have the shader DEBUG flag enabled, this was the last few lines.

TEXTURESANITY: pshader 0xac112368 is 'DiffuseColorAlpha.fpo'
PSYCHONAUTS UNIX FILENAME: corrected 'Workresource/PixelShaders/fpo/Color1Tex.fpo' to 'WorkResource/PixelShaders/fpo/Color1Tex.fpo'
glCreateShader(GL_FRAGMENT_SHADER)
glShaderSource(462, 1, 0xaa4e1cfc, 0xb6ac5f2c)
glCompileShader(462)
glGetShaderiv(462, GL_COMPILE_STATUS, 0xb6ac5f30)
glGetShaderInfoLog(462, 1024, 0xb6ac5f28, 0x869a020)
Failed to compile a pixel shader!
  '0:8(14): error: initializer of global variable `ps_t0' must be a constant expression
'
Wrote shader in question to badshader.bin
ERROR: Assert in /home/icculus/projects/psychonauts/Source/CommonLibs/DFGraphics/OpenGLGraphics.cpp, line 2127
pD3DShader != NULL

Encountered Error:
  Psychonauts has encountered an error

/home/icculus/projects/psychonauts/Source/CommonLibs/DFGraphics/OpenGLGraphics.cpp, line 2127
pD3DShader != NULL

 Please contact technical support at http://www.doublefine.com.

Unsupported Int 3 call
LIBGL: Shuting down

I am unsure if this is unrelated to gl4es, so feel free to close if it is not.

ITotalJustice avatar Aug 03 '19 17:08 ITotalJustice

Yeah, that's probably gl4es related. You can remove the debug trace, and use LIBGL_LOGSHADERERROR=1 here.

(also, is it running fine with VC4 mesa driver?)

ptitSeb avatar Aug 03 '19 18:08 ptitSeb

No it fails with the default gl because it doesn't have support for s3tc (no hardware support so its disabled?). Iirc gl4es has support for it since i used it with openmw with no s3tc errors, and textures loaded.

heres the log using LIBGL_LOGSHADERERROR=1

LIBGL: Error while compiling shader 462. Original source is:
#version 120
vec4 ps_r0;
vec4 ps_t0 = gl_TexCoord[0];
uniform sampler2D ps_s0;
#define ps_v0 gl_Color
#define ps_oC0 gl_FragColor

void main()
{
	ps_t0 = texture2D(ps_s0, ps_t0.xy);
	ps_r0 = ps_v0 * ps_t0;
	ps_oC0 = ps_r0;
}


=======
ShaderConv Source is:
#version 100
precision highp float;
precision highp int;
varying lowp vec4 _gl4es_FrontColor;
varying mediump vec4 _gl4es_TexCoord[1];

vec4 ps_r0;
vec4 ps_t0 = _gl4es_TexCoord[0];
uniform sampler2D ps_s0;
#define ps_v0 _gl4es_FrontColor
#define ps_oC0 gl_FragColor

void main()
{
	ps_t0 = texture2D(ps_s0, ps_t0.xy);
	ps_r0 = ps_v0 * ps_t0;
	ps_oC0 = ps_r0;
}


=======
Compiler message is
0:8(14): error: initializer of global variable `ps_t0' must be a constant expression

LIBGL: End of Error log
Failed to compile a pixel shader!
  '0:8(14): error: initializer of global variable `ps_t0' must be a constant expression
'
Wrote shader in question to badshader.bin
ERROR: Assert in /home/icculus/projects/psychonauts/Source/CommonLibs/DFGraphics/OpenGLGraphics.cpp, line 2127
pD3DShader != NULL

Encountered Error:
  Psychonauts has encountered an error

/home/icculus/projects/psychonauts/Source/CommonLibs/DFGraphics/OpenGLGraphics.cpp, line 2127
pD3DShader != NULL

 Please contact technical support at http://www.doublefine.com.

Unsupported Int 3 call
LIBGL: Shuting down

ITotalJustice avatar Aug 03 '19 19:08 ITotalJustice

Yes, gl4es handle s3tc texture. They are uncompressed in memory, because GLES hardware doesn't support that, but at least it work.

Now, the shader error. I see the issue now, but I need to think on how to handle that case. This seems tricky.

ptitSeb avatar Aug 03 '19 19:08 ptitSeb

So I implemented some "on-the-fly" hacking of shaders. Now Psychonauts should start.

ptitSeb avatar Aug 04 '19 16:08 ptitSeb

Hi, sadly it still fails to start. Heres the output with LOGSHADERERROR=1

LIBGL: Error while compiling shader 462. Original source is:
#version 110
vec4 ps_r0;
vec4 ps_t0 = gl_TexCoord[0];
uniform sampler2D ps_s0;
#define ps_v0 gl_Color
#define ps_oC0 gl_FragColor

void main()
{
	ps_t0 = texture2D(ps_s0, ps_t0.xy);
	ps_r0 = ps_v0 * ps_t0;
	ps_oC0 = ps_r0;
}


=======
ShaderConv Source is:
#version 100
precision highp float;
precision highp int;
varying lowp vec4 _gl4es_FrontColor;
varying mediump vec4 _gl4es_TexCoord[1];
vec4 ps_r0;
vec4 ps_t0 = _gl4es_TexCoord[0];
uniform sampler2D ps_s0;
#define ps_v0 _gl4es_FrontColor
#define ps_oC0 gl_FragColor

void main()
{
	ps_t0 = texture2D(ps_s0, ps_t0.xy);
	ps_r0 = ps_v0 * ps_t0;
	ps_oC0 = ps_r0;
}


=======
Compiler message is
0:7(14): error: initializer of global variable `ps_t0' must be a constant expression

LIBGL: End of Error log
Failed to compile a pixel shader!
  '0:7(14): error: initializer of global variable `ps_t0' must be a constant expression
'
Wrote shader in question to badshader.bin
ERROR: Assert in /home/icculus/projects/psychonauts/Source/CommonLibs/DFGraphics/OpenGLGraphics.cpp, line 2127
pD3DShader != NULL

Encountered Error:
  Psychonauts has encountered an error

/home/icculus/projects/psychonauts/Source/CommonLibs/DFGraphics/OpenGLGraphics.cpp, line 2127
pD3DShader != NULL

 Please contact technical support at http://www.doublefine.com.

Unsupported Int 3 call
LIBGL: Shuting down

ITotalJustice avatar Aug 04 '19 17:08 ITotalJustice

Ah yes, that's because I tried it with LIBGL_GL=21. I have made a change, it should work now even without it.

ptitSeb avatar Aug 04 '19 18:08 ptitSeb

Tried that as well, still get the same error only that #version 110 is now #version 120.

When you said that you tried it, you mean that the game is working on your end?

ITotalJustice avatar Aug 04 '19 18:08 ITotalJustice

It doesn't launch on my side because the Pandora on which I'm testing doesn't have enough Variying it seems.

Can you put the shader log error here, I wounder why it would not work now.

ptitSeb avatar Aug 04 '19 19:08 ptitSeb