PaulsCode Forum

Mupen64Plus AE => General Discussion => Topic started by: Narann on December 01, 2014, 04:49:49 PM

Title: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 01, 2014, 04:49:49 PM
Hello buddies!  ;D

I realize here is maybe the most active place talking about mupen64plus devs, even if it's mainly AE related there is a lot of work pushed back in the main repo (I think it's good!).

When I see how few N64 scene is it's a shame we are all separate.

So, as you maybe know, I've tried very hard to push Rice OpenGL 2.1 and OpenGL ES 2 compliant and remove gl2es. The idea was to limit as branching as possible and have a Rice version that should compile smoothly for Desktop and Smartphones.

I have no experience is smartphone. I know you are the most well placed guys to give me feedbacks and this is why I'm here. :)

@littleguy, if you read my code you will see I've put all what you merged back to rice as the main code path now. I tried as much a possible to remove every dependencies to old opengl.

So, if put the "official" (without too much hack) Rice version to AE (and possibly other) would be possible I would be glad to help.

Please tell me what is wrong (I'm sure there is) with the current state of Rice before I ask Richard to merge all of this into the main repo.

Here is my original mail on the mupen64plus mailing list:

Quote
Hi guys!

I've finally push the most boring code part to do on a open source
project: Prepare extension calls! :D

This was necessary to bring back the cross platform stuff m64p project
is supposed to be.

So at this stage, the repo should compile at the same cross platform
level than before all my changes.

Next: "From what I understand", you "should" be able to compile in
OpenGL ES. I say should because for now, the only way I've been able to
tests for OGLES is hardcoding the driver flag in the Makefile:196, use
USE_GLES, and maybe hide some #if SDL_VIDEO_OPENGL stuff in osal_opengl.h.

I know, this does not seem sexy. Everything would became easier once
your feedbacks will came and the Makefile will be more consistent.

Why it take so long?

1) I've not been able to prepare a building env with my Raspberry Pie.
So the OpenGL ES code is not truely tested. I've tested actually
"forced" the Mesa GL ES driver of my chipset. It was working but I have
no idea if this is a relevant test case.

2) Seriously, the way to create OpenGL callbacks is a pain. So I have to
find "huge" amount of motivation to spend my little personal time to do
such boring stuff... But it's done now!

So now guys, I need you!

There is a true lack of "nice" OGLES way to compile

If anyone could compile this on various platform (I'm specially
interested by ES hardware) and report what they have to fight for etc...
If you also could compile the original repo to be sure it's a problem
coming from my modifications:

https://github.com/Narann/mupen64plus-video-rice << Mine

https://github.com/mupen64plus/mupen64plus-video-rice << official repo
(my modifs are not pushed yet)

There is still some code cleanup to do. I also know Zelda 64 as a tiny
clamping problems on the shader side (bringing to some dark dots in the
screen) but it should be ok for testing.

Any feedback is welcome. I'm also interested about performance feedbacks
(slower? faster?). I have the impression it's a little faster.

Once again, a big thanks to LittleBoy77. Your code really help me to
follow the good direction! :)

A big thanks in advance for all of you that could help me on this last
(but not easy) step!

Any feedback on this is welcome.

We all want Rice code don't die. This was my intent when I've choose to rework Rice code.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: littleguy on December 01, 2014, 05:18:13 PM
Great to see you here Narann.  My plate is suddenly piling up with things I want to do :D  I'll try to take a look this week to see if it builds and runs without obvious defects.

Just so I understand, was your goal to implement Rice video using a single GL/GLES codepath, using only API methods that exist in GLES2 and GL2.1?
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: littleguy on December 01, 2014, 08:38:20 PM
Narann - Would you mind merging upstream master into your fork?  Or, rebase a copy of your fork onto upstream master?  (You would need to do one of these anyhow before submitting a pull request.)  Some recent changes in the SDL_VIDEO_OPENGL (USE_GLES) flags are causing conflicts that are better resolved by you than me.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 01, 2014, 08:52:31 PM
I'll try to take a look this week to see if it builds and runs without obvious defects.
I'm sure you will have to hack. Go as far as you can and report. I will try to fix as much as I can.

Just so I understand, was your goal to implement Rice video using a single GL/GLES codepath, using only API methods that exist in GLES2 and GL2.1?
I've deeply modify the way Rice work. A lot of stuff has been removed because are not relevant anymore cause my GLSL implementation is far more flexible (DecodedMux is one of the bigger remove). "I  guess" this should increase global performances and reduce the need to have "CPU composited" textures that do some combining that was impossible to do on old GFX cards.

Narann - Would you mind merging upstream master into your fork?  Or, rebase a copy of your fork onto upstream master?  (You would need to do one of these anyhow before submitting a pull request.)  Some recent changes in the SDL_VIDEO_OPENGL (USE_GLES) flags are causing conflicts that are better resolved by you than me.

Ok, I will try to merge the master into my fork asap.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: retroben on December 01, 2014, 11:08:32 PM
YAY!!! A possible performance increase!  ;D

Hope it is enough of an increase to boost Banjo-Tooie with "no frameskip" closer to full speed.

No Frameskip
8007913F 0001

Here it is in case you wanna try it out.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 01, 2014, 11:54:17 PM
And I finally finished the merging stuff (https://github.com/Narann/mupen64plus-video-rice/commits/master). Not so easy actually as some modifications where made on files which doesn't exists anymore.

I'm almost sure there is some modifications to do on the GLES side. I know GLES need to specify float precisions. This is not something I've done as I wasn't aware what the good choice would have been.

I don't know if fayvel/Gillou68310/krnlyng are on the mupen64plus mailing list but there is a lack of communication (I try to always announce what I'm working on on the mailing list).

That's why, if everybody confirm me my Rice improvements are working fine I will definitely push them to the master and we will not have such situation anymore. :)
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: littleguy on December 02, 2014, 04:55:08 PM
I cannot compile.  Looks like headers are not included properly for the gles codepath.  Did you try building this with USE_GLES==1?  I think you can get to the bottom of this much faster than me.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 02, 2014, 05:16:22 PM
I tried with USE_GLES but I remember I've done some tiny modifications after. I will check asap (sorry).

Don't hesitate to provide compile error message in case I could not reproduce the problem. :(
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: littleguy on December 02, 2014, 07:36:34 PM
I made the following changes to the code:
Code: [Select]

---
 jni/mupen64plus-video-rice/projects/android/Android.mk | 4 ----
 jni/mupen64plus-video-rice/src/OGLES2FragmentShaders.h | 1 -
 jni/mupen64plus-video-rice/src/OGLExtensions.h         | 2 +-
 jni/mupen64plus-video-rice/src/osal_opengl.h           | 1 +
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/jni/mupen64plus-video-rice/projects/android/Android.mk b/jni/mupen64plus-video-rice/projects/android/Android.mk
index eb4a8bc..94885a4 100644
--- a/jni/mupen64plus-video-rice/projects/android/Android.mk
+++ b/jni/mupen64plus-video-rice/projects/android/Android.mk
@@ -38,7 +38,6 @@ LOCAL_C_INCLUDES :=                     \
 LOCAL_SRC_FILES :=                      \
     $(SRCDIR)/Blender.cpp               \
     $(SRCDIR)/Combiner.cpp              \
-    $(SRCDIR)/CombinerTable.cpp         \
     $(SRCDIR)/Config.cpp                \
     $(SRCDIR)/ConvertImage.cpp          \
     $(SRCDIR)/ConvertImage16.cpp        \
@@ -46,12 +45,9 @@ LOCAL_SRC_FILES :=                      \
     $(SRCDIR)/DecodedMux.cpp            \
     $(SRCDIR)/DeviceBuilder.cpp         \
     $(SRCDIR)/FrameBuffer.cpp           \
-    $(SRCDIR)/GeneralCombiner.cpp       \
     $(SRCDIR)/GraphicsContext.cpp       \
     $(SRCDIR)/OGLCombiner.cpp           \
     $(SRCDIR)/OGLDecodedMux.cpp         \
-    $(SRCDIR)/OGLExtCombiner.cpp        \
-    $(SRCDIR)/OGLExtRender.cpp          \
     $(SRCDIR)/OGLES2FragmentShaders.cpp \
     $(SRCDIR)/OGLGraphicsContext.cpp    \
     $(SRCDIR)/OGLRender.cpp             \
diff --git a/jni/mupen64plus-video-rice/src/OGLES2FragmentShaders.h b/jni/mupen64plus-video-rice/src/OGLES2FragmentShaders.h
index e586cab..a97f006 100644
--- a/jni/mupen64plus-video-rice/src/OGLES2FragmentShaders.h
+++ b/jni/mupen64plus-video-rice/src/OGLES2FragmentShaders.h
@@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "osal_opengl.h"
 
 #include "OGLCombiner.h"
-#include "OGLExtCombiner.h"
 
 typedef struct {
     uint32  dwMux0;
diff --git a/jni/mupen64plus-video-rice/src/OGLExtensions.h b/jni/mupen64plus-video-rice/src/OGLExtensions.h
index 82af2c2..a5c9280 100644
--- a/jni/mupen64plus-video-rice/src/OGLExtensions.h
+++ b/jni/mupen64plus-video-rice/src/OGLExtensions.h
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #if !defined(OGL_EXTENSIONS_H)
 #define OGL_EXTENSIONS_H
 
-#include <SDL_opengl.h>
+#include "osal_opengl.h"
 
 /* Just call this one function to load up the function pointers. */
 void OGLExtensions_Init(void);
diff --git a/jni/mupen64plus-video-rice/src/osal_opengl.h b/jni/mupen64plus-video-rice/src/osal_opengl.h
index bc05435..d2b68eb 100644
--- a/jni/mupen64plus-video-rice/src/osal_opengl.h
+++ b/jni/mupen64plus-video-rice/src/osal_opengl.h
@@ -62,6 +62,7 @@
 
 // Function substitutions
 #define glClearDepth            glClearDepthf
+#define glDepthRange            glDepthRangef
 #define pglActiveTexture        glActiveTexture
 
 // No-op substitutions (unavailable in GLES2)
--
1.9.4.msysgit.0

Then I get these errors on compile
Code: [Select]
In file included from jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:24:0:
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.h:50:1: error: expected class-name before '{' token
In file included from jni/mupen64plus-video-rice/projects/android/../../src/DeviceBuilder.cpp:32:0:
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.h:50:1: error: expected class-name before '{' token
jni/mupen64plus-video-rice/projects/android/../../src/DeviceBuilder.cpp: In member function 'virtual CColorCombiner* OGLDeviceBuilder::CreateColorCombiner(CRender*)':
jni/mupen64plus-video-rice/projects/android/../../src/DeviceBuilder.cpp:246:72: error: cannot convert 'COGL_FragmentProgramCombiner*' to 'CColorCombiner*' in assignment
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp: In member function 'virtual void OGLRender::Initialize()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:73:100: error: 'pglVertexAttribPointer' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp: In member function 'virtual bool OGLRender::RenderTexRect()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:580:79: error: 'pglVertexAttribPointer' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp: In member function 'virtual bool OGLRender::RenderFillRect(unsigned int, float)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:628:79: error: 'pglVertexAttribPointer' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:630:45: error: 'pglDisableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:639:44: error: 'pglEnableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp: In member function 'virtual void OGLRender::DrawSimple2DTexture(float, float, float, float, float, float, float, float, COLOR, float, float)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:792:79: error: 'pglVertexAttribPointer' was not declared in this scope
In file included from jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:52:0:
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:33:30: error: expected ')' before 'PFUNCGLACTIVETEXTUREPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:34:30: error: expected ')' before 'PFUNCGLDELETEPROGRAMSARBPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:35:30: error: expected ')' before 'PFUNCGLPROGRAMSTRINGARBPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:36:30: error: expected ')' before 'PFUNCGLBINDPROGRAMARBPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:37:30: error: expected ')' before 'PFUNCGLGENPROGRAMSARBPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:38:30: error: expected ')' before 'PFUNCGLPROGRAMENVPARAMETER4FVARBPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:39:30: error: expected ')' before 'PFUNCGLFOGCOORDPOINTERPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:40:30: error: expected ')' before 'PFUNCGLCLIENTACTIVETEXTUREPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:41:30: error: expected ')' before 'PFUNCGLCREATESHADERPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:42:30: error: expected ')' before 'PFUNCGLSHADERSOURCEPROC'
In file included from jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:52:0:
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:43:30: error: expected ')' before 'PFUNCGLCOMPILESHADERPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:44:30: error: expected ')' before 'PFUNCGLGETSHADERIVPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:45:30: error: expected ')' before 'PFUNCGLGETSHADERINFOLOGPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:46:30: error: expected ')' before 'PFUNCGLCREATEPROGRAMPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:47:30: error: expected ')' before 'PFUNCGLATTACHSHADERPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:48:30: error: expected ')' before 'PFUNCGLBINDATTRIBLOCATIONPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:49:30: error: expected ')' before 'PFUNCGLLINKPROGRAMPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:50:30: error: expected ')' before 'PFUNCGLGETPROGRAMIVPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:51:30: error: expected ')' before 'PFUNCGLGETPROGRAMINFOLOGPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:52:30: error: expected ')' before 'PFUNCGLDETACHSHADERPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:53:30: error: expected ')' before 'PFUNCGLGETUNIFORMLOCATIONPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:54:30: error: expected ')' before 'PFUNCGLDELETESHADERPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:55:30: error: expected ')' before 'PFUNCGLDELETEPROGRAMPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:56:30: error: expected ')' before 'PFUNCGLISSHADERPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:57:30: error: expected ')' before 'PFUNCGLISPROGRAMPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:58:30: error: expected ')' before 'PFUNCGLENABLEVERTEXATTRIBARRAYPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:59:30: error: expected ')' before 'PFUNCGLDISABLEVERTEXATTRIBARRAYPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:60:30: error: expected ')' before 'PFUNCGLVERTEXATTRIBPOINTERPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:61:30: error: expected ')' before 'PFUNCGLUNIFORM4FPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:62:30: error: expected ')' before 'PFUNCGLUNIFORM3FPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:63:30: error: expected ')' before 'PFUNCGLUNIFORM2FPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:64:30: error: expected ')' before 'PFUNCGLUNIFORM1FPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:65:30: error: expected ')' before 'PFUNCGLUNIFORM1IPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:66:30: error: expected ')' before 'PFUNCGLUSEPROGRAMPROC'
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:68:8: error: 'PFUNCGLACTIVETEXTUREPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:69:8: error: 'PFUNCGLPROGRAMSTRINGARBPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:70:8: error: 'PFUNCGLBINDPROGRAMARBPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:71:8: error: 'PFUNCGLGENPROGRAMSARBPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:72:8: error: 'PFUNCGLPROGRAMENVPARAMETER4FVARBPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:73:8: error: 'PFUNCGLFOGCOORDPOINTERPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:74:8: error: 'PFUNCGLCLIENTACTIVETEXTUREPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:75:8: error: 'PFUNCGLCREATESHADERPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:76:8: error: 'PFUNCGLSHADERSOURCEPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:77:8: error: 'PFUNCGLCOMPILESHADERPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:78:8: error: 'PFUNCGLGETSHADERIVPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:79:8: error: 'PFUNCGLGETSHADERINFOLOGPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:80:8: error: 'PFUNCGLCREATEPROGRAMPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:81:8: error: 'PFUNCGLATTACHSHADERPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:82:8: error: 'PFUNCGLBINDATTRIBLOCATIONPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:83:8: error: 'PFUNCGLLINKPROGRAMPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:84:8: error: 'PFUNCGLGETPROGRAMIVPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:85:8: error: 'PFUNCGLGETPROGRAMINFOLOGPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:86:8: error: 'PFUNCGLDETACHSHADERPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:87:8: error: 'PFUNCGLGETUNIFORMLOCATIONPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:88:8: error: 'PFUNCGLDELETESHADERPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:89:8: error: 'PFUNCGLDELETEPROGRAMPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:90:8: error: 'PFUNCGLISSHADERPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:91:8: error: 'PFUNCGLISPROGRAMPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:92:8: error: 'PFUNCGLENABLEVERTEXATTRIBARRAYPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:93:8: error: 'PFUNCGLDISABLEVERTEXATTRIBARRAYPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:94:8: error: 'PFUNCGLVERTEXATTRIBPOINTERPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:95:8: error: 'PFUNCGLUNIFORM4FPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:96:8: error: 'PFUNCGLUNIFORM3FPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:97:8: error: 'PFUNCGLUNIFORM2FPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:98:8: error: 'PFUNCGLUNIFORM1FPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:99:8: error: 'PFUNCGLUNIFORM1IPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLExtensions.h:100:8: error: 'PFUNCGLUSEPROGRAMPROC' does not name a type
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In function 'GLuint createShader(GLenum, char const*)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:136:49: error: 'pglCreateShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:138:48: error: 'pglShaderSource' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:139:28: error: 'pglCompileShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:142:54: error: 'pglGetShaderiv' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:149:68: error: 'pglGetShaderInfoLog' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In function 'GLuint createProgram(GLuint, GLuint)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:171:39: error: 'pglCreateProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:173:37: error: 'pglAttachShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:176:59: error: 'pglBindAttribLocation' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:182:27: error: 'pglLinkProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:185:53: error: 'pglGetProgramiv' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:192:70: error: 'pglGetProgramInfoLog' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:196:37: error: 'pglDetachShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In constructor 'COGLColorCombiner::COGLColorCombiner(CRender*)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:212:70: error: 'pglGetUniformLocation' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:214:36: error: 'pglDeleteShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In destructor 'virtual COGLColorCombiner::~COGLColorCombiner()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:220:34: error: 'pglIsShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:221:36: error: 'pglDeleteShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:223:38: error: 'pglIsProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:224:41: error: 'pglDeleteProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:232:46: error: 'pglIsProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:233:49: error: 'pglDeleteProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In member function 'virtual void COGLColorCombiner::InitCombinerCycleCopy()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:266:43: error: 'pglEnableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:270:41: error: 'pglDisableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In member function 'virtual void COGLColorCombiner::InitCombinerCycleFill()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:291:69: error: 'pglUniform4f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In member function 'GLuint COGLColorCombiner::GenerateCycle12Program()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1095:30: error: 'pglDeleteShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In member function 'GLuint COGLColorCombiner::GenerateCopyProgram()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1143:30: error: 'pglDeleteShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In member function 'void COGLColorCombiner::GenerateCombinerSetting()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1173:43: error: 'pglEnableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1175:100: error: 'pglVertexAttribPointer' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In member function 'void COGLColorCombiner::GenerateCombinerSettingConstants(int)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1209:58: error: 'pglUniform2f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1218:67: error: 'pglUniform4f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1225:70: error: 'pglUniform4f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1233:63: error: 'pglUniform4f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1240:74: error: 'pglUniform3f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1247:72: error: 'pglUniform3f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1254:72: error: 'pglUniform3f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1259:64: error: 'pglUniform1f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1264:72: error: 'pglUniform1f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1269:54: error: 'pglUniform1f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1274:54: error: 'pglUniform1f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1279:42: error: 'pglUniform1i' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1284:42: error: 'pglUniform1i' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1292:63: error: 'pglUniform4f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In member function 'void COGLColorCombiner::StoreUniformLocations(COGLColorCombiner::ShaderSaveType&)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1323:95: error: 'pglGetUniformLocation' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp: In member function 'void COGLColorCombiner::useProgram(const GLuint&)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLCombiner.cpp:1394:32: error: 'pglUseProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp: In member function 'void OGLRender::DrawSimpleRect(int, int, int, int, unsigned int, float, float)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:837:79: error: 'pglVertexAttribPointer' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:839:45: error: 'pglDisableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRender.cpp:848:44: error: 'pglEnableVertexAttribArray' was not declared in this scope
In file included from jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:20:0:
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.h:50:1: error: expected class-name before '{' token
make.exe: *** [obj/local/armeabi/objs/mupen64plus-video-rice/__/__/src/DeviceBuilder.o] Error 1
make.exe: *** Waiting for unfinished jobs....
make.exe: *** [obj/local/armeabi/objs/mupen64plus-video-rice/__/__/src/OGLRender.o] Error 1
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In constructor 'COGL_FragmentProgramCombiner::COGL_FragmentProgramCombiner(CRender*)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:197:3: error: class 'COGL_FragmentProgramCombiner' does not have any field named 'COGLColorCombiner4'
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:199:12: error: 'm_pDecodedMux' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:211:36: error: 'pglCreateProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:212:42: error: 'pglCreateShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:213:44: error: 'pglShaderSource' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:214:24: error: 'pglCompileShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:216:49: error: 'pglGetShaderiv' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:220:45: error: 'pglGetShaderInfoLog' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:232:45: error: 'pglGetShaderInfoLog' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:236:35: error: 'pglAttachShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:239:64: error: 'pglBindAttribLocation' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:244:31: error: 'pglLinkProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:245:69: error: 'pglGetUniformLocation' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:246:56: error: 'pglGetProgramiv' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:250:55: error: 'pglGetProgramInfoLog' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:254:23: error: 'pglDeleteShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:265:45: error: 'pglGetShaderInfoLog' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In destructor 'COGL_FragmentProgramCombiner::~COGL_FragmentProgramCombiner()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:290:28: error: 'pglDeleteProgram' was not declared in this scope
In file included from jni/mupen64plus-video-rice/projects/android/../../src/OGLRenderExt.cpp:24:0:
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.h:50:1: error: expected class-name before '{' token
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'bool COGL_FragmentProgramCombiner::Initialize()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:301:10: error: 'COGLColorCombiner4' has not been declared
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'void COGL_FragmentProgramCombiner::DisableCombiner()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:319:5: error: 'COGLColorCombiner4' has not been declared
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'void COGL_FragmentProgramCombiner::InitCombinerCycleCopy()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:324:5: error: 'm_pOGLRender' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:326:30: error: 'pglUseProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:327:46: error: 'pglUniform1f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:329:43: error: 'pglEnableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:333:41: error: 'pglDisableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'void COGL_FragmentProgramCombiner::InitCombinerCycleFill()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:349:30: error: 'pglUseProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:350:170: error: 'pglUniform4f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'virtual void COGL_FragmentProgramCombiner::GenerateProgramStr()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:429:37: error: 'm_pDecodedMux' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'virtual int COGL_FragmentProgramCombiner::ParseDecodedMux()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:511:16: error: 'COGLColorCombiner4' has not been declared
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:518:78: error: 'pglCreateShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:519:66: error: 'pglShaderSource' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:521:44: error: 'pglCompileShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:537:66: error: 'pglCreateShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:556:79: error: 'pglShaderSource' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:561:46: error: 'pglCompileShader' was not declared in this scope
make.exe: *** [obj/local/armeabi/objs/mupen64plus-video-rice/__/__/src/OGLCombiner.o] Error 1
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:563:73: error: 'pglGetShaderiv' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:568:74: error: 'pglGetShaderInfoLog' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLRenderExt.cpp: In member function 'virtual void OGLRender::DrawSpriteR_Render()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLRenderExt.cpp:88:71: error: 'pglVertexAttribPointer' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:573:42: error: 'pglCreateProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:574:57: error: 'pglAttachShader' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:578:62: error: 'pglBindAttribLocation' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:589:37: error: 'pglLinkProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:592:64: error: 'pglGetProgramiv' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:597:74: error: 'pglGetShaderInfoLog' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:602:36: error: 'pglUseProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:606:65: error: 'pglGetUniformLocation' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:610:32: error: 'pglUniform1i' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:612:32: error: 'pglUniform1i' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:636:22: error: 'm_pDecodedMux' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:642:5: error: 'm_lastIndex' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'virtual void COGL_FragmentProgramCombiner::GenerateCombinerSetting(int)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:651:21: error: 'pglUseProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:652:43: error: 'pglEnableVertexAttribArray' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:654:100: error: 'pglVertexAttribPointer' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'virtual void COGL_FragmentProgramCombiner::GenerateCombinerSettingConstants(int)':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:682:33: error: 'pglUseProgram' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:716:121: error: 'pglUniform4f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:722:68: error: 'pglUniform2f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:728:54: error: 'pglUniform1f' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'int COGL_FragmentProgramCombiner::FindCompiledMux()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:745:45: error: 'm_pDecodedMux' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp: In member function 'void COGL_FragmentProgramCombiner::InitCombinerCycle12()':
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:762:9: error: 'COGLColorCombiner4' has not been declared
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:776:5: error: 'm_pOGLRender' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:780:9: error: 'm_pDecodedMux' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:780:36: error: 'm_dwLastMux0' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:780:79: error: 'm_dwLastMux1' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:780:175: error: 'm_lastIndex' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:797:38: error: 'm_lastIndex' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:798:9: error: 'm_bCycleChanged' was not declared in this scope
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:798:54: error: 'struct RDP_Options' has no member named 'texturesAreReloaded'
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:798:82: error: 'struct RDP_Options' has no member named 'colorsAreReloaded'
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:805:23: error: 'struct RDP_Options' has no member named 'colorsAreReloaded'
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:812:14: error: 'struct RDP_Options' has no member named 'colorsAreReloaded'
jni/mupen64plus-video-rice/projects/android/../../src/OGLES2FragmentShaders.cpp:813:14: error: 'struct RDP_Options' has no member named 'texturesAreReloaded'

Edit: Looks like all the typedefs are broken in OGLExtensions.h...

Edit2: Hang tight, that might be a red herring.  I'll keep hacking for awhile.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 02, 2014, 08:00:17 PM
Thanks a lot! I will try to reproduce this on my side.

The OGLES2FragmentShaders.h and OGLES2FragmentShaders.cpp are not supposed to be there anymore (as "the new way" is supposed to have the same code path). I guess they are in the repo but not used. I think I forgot to remove them from the Makefile and as it compile well on my side I didn't see the potential problem.

Notice I don't have SDL_opengles2.h (I have actually no idea how to prepare a GLES cross compilation env yet). I guess the OpenGL function pointer error are related to the OGLES2FragmentShaders.h.

EDIT: Aaaaah! I think I understand! Let me some time and I should fix the problem on my side. A lot of this #ifndef USE_GLES should not be relevant anymore.

Anyway, any point to help me to have a nice OpenGL ES 2 linux build env is welcome.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: littleguy on December 02, 2014, 08:26:47 PM
Ok.  Keep in mind that we can't #include <SDL_opengl.h> (android native libraries don't contain GL). So everywhere that you see <SDL_opengl.h>, you should replace with "osal_opengl.h".

Also APIENTRYP is not defined in SDL_opengles2.h, so that must also be defined if not already.  I suggest adding the following in OGLExtensions.h:
Code: [Select]
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif

Then when I remove all references to OGLES2FragmentShaders (#include OGLExtensions.h instead) I get far fewer compile errors.  I'll keep digging later, have to take a break now.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 03, 2014, 12:28:26 AM
Thanks littleguy!

I've done some fixes and now USE_GLES compilation is working. I've tried to test it on Linux but I think my OpenGLES 2.0 env doesn't work because this functions:
Code: [Select]
glGetString(GL_RENDERER);
glGetString(GL_EXTENSIONS);
glGetString(GL_VERSION);
glGetString(GL_VENDOR);
Always return NULL...

Such functions should always work...

Bypassing stuff the bad way, I finally have the combiner working but:

Code: [Select]
Linker failure: @
Compile failure in (null) shader:
@
This are supposed to be debugging infos provided by the OpenGL ES driver... It doesn't seems to work...

So I can't get any info on what fail on the GLSL shader.

I know GLSL ES is different from GLSL but as I can't get the error I will never know why it fail and how to fix them.

How you guys are working with OGLES debugging?

The combiner GLSL pattern code is quite simple and often look like:
Code: [Select]
#version 100
uniform vec4 uBlendColor;                         
uniform vec4 uPrimColor;                         
uniform vec4 uEnvColor;                         
uniform vec3 uChromaKeyCenter;                   
uniform vec3 uChromaKeyScale;                   
uniform vec3 uChromaKeyWidth;                   
uniform float uLodFrac;                         
uniform float uPrimLodFrac;                         
uniform float uK5;                         
uniform float uK4;                         
uniform sampler2D uTex0;                         
uniform sampler2D uTex1;                         
uniform vec4 uFogColor;                         
                                                           
varying vec2 vertexTexCoord0;                         
varying vec2 vertexTexCoord1;                         
varying float vertexFog;                         
varying vec4 vertexShadeColor;                         
                                                           
                                                           
void main()                                               
{                                                         
vec4 outColor;                                             
vec3 AColor = vec3(0.0);
vec3 BColor = vec3(0.0);
vec3 CColor = vec3(0.0);
vec3 DColor = texture2D(uTex0,vertexTexCoord0).rgb;
float AAlpha = 0.0;
float BAlpha = 0.0;
float CAlpha = 0.0;
float DAlpha = texture2D(uTex0,vertexTexCoord0).a;
vec3 cycle1Color = (AColor - BColor) * CColor + DColor;
float cycle1Alpha = (AAlpha - BAlpha) * CAlpha + DAlpha;
outColor.rgb = cycle1Color;
outColor.a = cycle1Alpha;
float coverage = 1.0;
coverage = coverage * outColor.a;
coverage = step( 0.5, coverage );
outColor.a = coverage;
if( coverage < 0.1 ) discard;
    gl_FragColor = outColor;                               
}

If you have any experience with N64 RDP you would recognize the data flow.

If any of you is able to compile and run with my latest commits (https://github.com/Narann/mupen64plus-video-rice)

Please provide as much log as possible. It truly help me. :)
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Gillou68310 on December 03, 2014, 05:25:09 AM
How you guys are working with OGLES debugging?


Hi Narann,
Personally I'm using PowerVR SDK to debug OGLES on windows (building with VS2010) but it's also available on linux if you want to give it a try.
http://community.imgtec.com/developers/powervr/graphics-sdk/ (http://community.imgtec.com/developers/powervr/graphics-sdk/)

I tested your code and your shaders fail to compile because it's missing the precision qualifier.
This could be fixed by adding "precision lowp float;" at the start of your fragment shaders.

There's also a problem with textures color but I didn't have time to check the cause.
(http://imagizer.imageshack.us/a/img673/5345/g8ivne.png)

Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 03, 2014, 07:08:21 AM
Hi Gillou68310 and thanks for PowerVR SDK! I will give a try!

If it's only add "precision lowp float;" it should be trivial.

It's amazing you have true OGLES drawing! :'-) #emotion.

About the color (notice it's texture color), IIRC the code transfering textures to GPU was dealing with BGR textures (dunno why) and the GLSL fragment shader was doing the conversion. I've changed this but I guess the OGLES code path still send textures in BGR, I need to check. But I'm sure it's trivial to change.

I will prepare my OGLES env dev with PowerVR asap.

I guess it's not so easy but just in case: I'm very afraid of performance on weak hardwares. If any of you could do true hardware test performance with my Rice version to ensure we don't loose anything. I still have in mind to make Rice compatible with RPi (wich would be a good hardware to test) but I'm focusing to make OGLES code easy to compile and bug free.

EDIT: Yeah! I'm now a based byte with an avatar!
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Gillou68310 on December 03, 2014, 08:45:55 AM
I just tested your branch on my Note3, it doesn't looks faster but it's definitely not slower than before.
https://github.com/Gillou68310/mupen64plus-ae/tree/Narann_rice (https://github.com/Gillou68310/mupen64plus-ae/tree/Narann_rice)

Just in case you don't already have this, I wrote this piece of code a while back in order to initialize an EGL context inside an SDL windows. (check HAVE_EGL in vidext.c)
http://pastebin.com/Sn8xAKUD (http://pastebin.com/Sn8xAKUD)
http://pastebin.com/UxiWcN6E (http://pastebin.com/UxiWcN6E)
http://pastebin.com/BjRMdbJ1 (http://pastebin.com/BjRMdbJ1)
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 03, 2014, 09:14:27 AM
I just tested your branch on my Note3, it doesn't looks faster but it's definitely not slower than before.
https://github.com/Gillou68310/mupen64plus-ae/tree/Narann_rice (https://github.com/Gillou68310/mupen64plus-ae/tree/Narann_rice)
Great! This mean I've not did bad design choices. That's cool! :)

Thanks a lot for such tests, it make me confident I've done the good choice. My code is ten time simpler than the old one. I will continue the move to have a perfect OGL2.1 OGLES2 compliant code.

Just in case you don't already have this, I wrote this piece of code a while back in order to initialize an EGL context inside an SDL windows. (check HAVE_EGL in vidext.c)
http://pastebin.com/Sn8xAKUD (http://pastebin.com/Sn8xAKUD)
http://pastebin.com/UxiWcN6E (http://pastebin.com/UxiWcN6E)
http://pastebin.com/BjRMdbJ1 (http://pastebin.com/BjRMdbJ1)
Thanks! I will try to figure out how I could generate a local OGLES only branch with this.

Just to be sure: As SDL2 deal with EGL, is this still relevant? We should use SDL2 for such right? I'm just curious. :)

Side note for you Gillou: I see you are working on dynarec. This seems very cool! Do you think this could be done in the official repo then moved to AE after? I have the impression that, since AE is the most active dev scene for mupen64plus the upstream is sometime put behind and I think it's sad.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Gillou68310 on December 03, 2014, 09:27:14 AM
Just to be sure: As SDL2 deal with EGL, is this still relevant? We should use SDL2 for such right? I'm just curious. :)

I'm still using SD1.2 ;D I haven't checked SDL2 but if it deals with EGL this is indead not relevant.

Side note for you Gillou: I see you are working on dynarec. This seems very cool! Do you think this could be done in the official repo then moved to AE after? I have the impression that, since AE is the most active dev scene for mupen64plus the upstream is sometime put behind and I think it's sad.

Work in progress 8)
https://github.com/Gillou68310/mupen64plus-ae/issues/1 (https://github.com/Gillou68310/mupen64plus-ae/issues/1)
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Paul on December 03, 2014, 09:28:44 AM
Side note for you Gillou: I see you are working on dynarec. This seems very cool! Do you think this could be done in the official repo then moved to AE after? I have the impression that, since AE is the most active dev scene for mupen64plus the upstream is sometime put behind and I think it's sad.

Gilles has been doing a good job of making sure the changes are solid and discussing with Ari64 before pushing them upstream.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 03, 2014, 09:38:28 AM
I'm still using SD1.2 ;D I haven't checked SDL2 but if it deals with EGL this is indead not relevant.
Ok!
Work in progress 8)
https://github.com/Gillou68310/mupen64plus-ae/issues/1 (https://github.com/Gillou68310/mupen64plus-ae/issues/1)
(https://i.imgur.com/jc9d3DA.gif)
mupen64plus will definitely gain a step forward with this good mindset! Good job!
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: retroben on December 03, 2014, 12:41:21 PM
Is that show awesome? ;D
Edit:And if so,you mean "Great job!"

Do you know why Rice is slower for SM64 than Glide64?
I have "read every frame (slow)" disabled in Glide64 for speed,and it is now faster than Rice in that game.
Try the "SM64 Shining Stars" or any other large leveled hack to see some lag compared to Glide64's smooth speed.
Even the hub world lags on Rice while Glide64 runs smoothly.
And NO,I did not have HQ4X on in the comparison.

Rice is actually faster on Banjo-Tooie than all other plugins.
Too bad Super Smash Bros. is quite slow with Rice. (excluding N64oid's fast speed)
And there is that "yellow plaid" screen or "yellow bricks" issue on my FireTV when using Rice on some games.
The yellow screen does not happen in N64oid,which is why Smash runs so well on it.
I hope this helps out with performance tweaks for Rice.

Rice is my favorite low usage/speedy plugin on PJ64,and mudlord's 6.1.4 version is the fastest one for me.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 03, 2014, 01:12:38 PM
Thanks retroben. I will take a note about the mod you are talking about to see how it run. To be honest I'm more focused on how "my" Rice code run on various games. From my perspective, Rice code is quite fast except for Textures reading, allocation and transfer (something I need to investigate one day...). If you could compile my code and run it on various games that would be awesome. I'm not looking for tiny bugs now, mainly crash or big troubles. :)
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: retroben on December 03, 2014, 02:24:26 PM
I have no idea how to compile things,and if I did,it would probably end up with improper results like many others who "know" how to compile things.

I have seen numerous people having issues with compiling,and also,I would have to get a specific version of a certain thing in order to do it.

If you can make a build for me and others to test,that'd be great.
Make sure to please use a different name space so I don't have to get rid of Gillou's build just to install it.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 03, 2014, 11:14:50 PM
@Gillou, one of the core contributor seems to break some of your dynarec work with it's memory module refactor: https://github.com/mupen64plus/mupen64plus-core/pull/47

Another reason to work on the main core first? :D
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: littleguy on December 03, 2014, 11:25:53 PM
@narann
Gilles is indeed working with the upstream core developers, and he is modifying only a few lines of code.  bsmiles' memory refactoring is a huge undertaking (much like your Rice refactoring) so technically the responsibility for not breaking stuff lies with bsmiles.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Gillou68310 on December 04, 2014, 04:30:11 AM
About the color (notice it's texture color), IIRC the code transfering textures to GPU was dealing with BGR textures (dunno why) and the GLSL fragment shader was doing the conversion. I've changed this but I guess the OGLES code path still send textures in BGR, I need to check. But I'm sure it's trivial to change.

Ok I fixed the wrong texture color issue (OGLES only), and merged back the polygon offset hack.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: bsmiles32 on December 04, 2014, 04:36:27 AM
Yeah, the memory refactoring is huge, but I feel it is badly needed.
And yes, the responsibility for not breaking stuff is mine.
That's why we agreed not to merge the pull request until we are confident that we don't have regressions.
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 06, 2014, 07:19:44 AM
I've pushed new commits that should solve the problems Gillou encounter out of the box.

Please test and report. :)
Title: Re: Rice to OpenGL2.1 and OpenGL ES 2
Post by: Narann on December 15, 2014, 04:12:25 PM
After some (too?) time trying to make my PowerVR SDK env working I realize something: PowerVR debugger need the .so to be dynamically lined to libEGL. But it seems that SDL2 obfuscate EGL so I can't connect the debugger to it directly. I will maybe need your your windows_egl. I will dig more to see if I can "ask" SDL to use libEGL. :)