Open inactive123 opened 7 years ago
@bparker06 Did your PR here (https://github.com/libretro/Craft/pull/14) also take care of these issues? There is still a bounty open for this, would be nice to see this finally resolved so it could work on Android/iOS.
I just tried the AArch64 build of RA Android and it still crashes there, but probably because of the memcpy referenced in #14 and not a divide by zero.
I have dug into this with a debugger. The issue appears to be with the skybox loading in renderer_load_shader
. It seems to be passed bad data for the shader that does not compile properly.
The error appears to be coming from these lines:
static void renderer_load_shader(craft_info_t *info, size_t len, size_t len2,
const char **string, const char **string2)
{
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
GLuint vert, frag;
info->program = glCreateProgram();
vert = glCreateShader(GL_VERTEX_SHADER);
frag = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(vert, (GLsizei)len, (const GLchar**)string, 0);
glShaderSource(frag, (GLsizei)len2, (const GLchar**)string2, 0);
glCompileShader(vert);
glCompileShader(frag);
glAttachShader(info->program, vert);
glAttachShader(info->program, frag);
glLinkProgram(info->program);
glDeleteShader(vert);
glDeleteShader(frag);
#endif
}
These manifest themselves primarily on ARM-based systems but they can also manifest on other systems, and they are what is currently preventing the core from working at all on iOS and Android.
Related to issues like this -
https://github.com/libretro/Craft/issues/7
A working proof of concept for this would be if by fixing these issues, the core would then work on either iOS or Android. Either one of the two would be good enough to start with.