Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
68 user(s) are online (57 user(s) are browsing Forums)

Members: 0
Guests: 68

more...
Support us!
Recent OS4 Files
OS4Depot.net



« 1 ... 7 8 9 (10) 11 12 13 ... 17 »


Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Joined:
2007/7/14 20:30
From Lothric
Posts: 446
@kas1e

Somewhere in the GLES4 source there were prototypes for the wrapper functions (using the identical names but without VARARGS68K APICALL). Have you ruled out them?

I would not blame Cadog yet. Or if you want to debug it, start with Valgrind and Clang sanitizer instead of diving in blindly.

   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
@Capehill
Quote:

Somewhere in the GLES4 source there were prototypes for the wrapper functions (using the identical names but without VARARGS68K APICALL). Have you ruled out them?


Yep, they all in the agl.c which i at moment didn't build, so libgl4es.a didn't have even that object with those wrapper functions.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Joined:
2012/12/21 10:55
Posts: 27
@kas1e

Try

struct TagItem tags[] =
{
    {
OGLES2_CCT_WINDOW               , (ULONG)hidden->win},
    {
OGLES2_CCT_DEPTH                16                },
    {
OGLES2_CCT_STENCIL              8                 },
    {
OGLES2_CCT_VSYNC                0                 },
    {
OGLES2_CCT_SINGLE_GET_ERROR_MODE1                 },
    {
OGLES2_CCT_RESIZE_VIEWPORT      TRUE              },
    {
TAG_DONE                                            }
};

hidden->IGL=IOGLES2->aglCreateContext(0tags);


   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
@Georg
Yeah, tried it yesterday : it did fix issue for Cadog, but still trashing of memory in another game (letters fall) still present. Its like it just once i use another function for context creation, issue with memory trashing shifts somewhere else.

Visually it look like this (press to open in new tab for fullsize images):

Resized Image

Resized Image

Of course it can be different issue, but as Cadog background disappear with depend on prinfs before context creation, i feel that trahing in the lettersfall game are of the same roots.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Joined:
2007/7/14 20:30
From Lothric
Posts: 446
@kas1e

Do you have a smaller OpenGL example which uses succesfully glDrawArrays and GL_TRIANGLE_FANs? If you get consistently this drawing bug I think it's something else.

   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
@Capehill
Quote:

Do you have a smaller OpenGL example which uses succesfully glDrawArrays and GL_TRIANGLE_FANs?


Some small test cases works.

Tested 4 games so far:

Bloboats : have no problems

Cadog: have no problems, except that this disappeared title background pic if before context creation put some prinfs in the SDL code.

LettersFall : that trashing as show on screenhots above. But to add, Daniel on his setup didn't have that.

Quake3: works fine when it use glbegin/glend code path, but have bugs when use glDrawElements. From ogles2 side there is all ok as Daniel test. And it also seems like memory trahing issue. We made some workaround for it in gl4es , but it's just shift memory trashing somewhere else, but not actually fix anything.

IrrLicht Engine: have the same kind of problems as quake3 have (also use a lot of glDrawElements and glDrawArrays), and also by our workaround shift the trashing somewhere else.


We can think about some particular function being broken or so, but, example with Cadog (and the way how it reacts when there is just before printf ("aaa") or printfs ("aaaa") ; mean that there is 100% memory trahing issue.

I will try for now to remove all the opening of amiga stuff from gl4es, and doint 100% everything from SDL, to see if it will change anything.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Joined:
2012/12/21 10:55
Posts: 27
@kas1e

Check this context array creation/finding/expanding/shrinking routines in agl.c. This in agl_context_remove() looks suspicious:

while(agl_context_len && !agl_context[agl_context_len].context) --agl_context_len;


If an array contains len items then accessing array[len] is invalid. Even here where array is allocated/reallocated in chunks of multiple of 10 (agl_context_cap) and zeroed. Especially in case len happens to be multiple of 10, because then array[len] points to unallocated memory/chunk (not zeroed).


   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2006/11/20 16:26
From Norway
Posts: 2703
@Georg

It should be treated as false, and stop right there.
I think program is understand that if statement agl_context_len is 0 then first part of the statement is false, then there is no point for program and check if second part is also false, and requires bout to be TRUE.

Depending on agl_context_len being a index or the number of items. but i agree this make more sense:

while(agl_context_len && !agl_context[agl_context_len-1].context) agl_context_len--;


_________________
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
@Georg
Quote:

Check this context array creation/finding/expanding/shrinking routines in agl.c

For now i even didn't use agl.c at all, and those agl_context_remove() in no use. I just open/close ogles2.library / iface from SDL, create context, and only after creating of context do call initialize_gl4es(); (so i do that to avoid any gl4es loading before context creation, in case its gl4es cause trashing at begining).

That how my SDL_os4gl.c currently looks like (which i link against libgl4es.a , without compiled agl.c in it).

/*
    SDL - Simple DirectMedia Layer
    Copyright (C) 1997-2006 Sam Lantinga

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

    Sam Lantinga
    slouken@libsdl.org
*/
/*
 * GL support for AmigaOS 4 using GL4ES->OGLES2
 */

#include "SDL_config.h"

#if SDL_VIDEO_OPENGL

#include "SDL_os4video.h"
#include "SDL_os4utils.h"
#include "SDL_os4blit.h"

#include <proto/exec.h>
#include <proto/intuition.h>

#include <proto/ogles2.h>
#include <GL4ES/gl.h>

#include "../../main/amigaos4/SDL_os4debug.h"

voidaglGetProcAddress(const char *);  // gl4es's aglGetProcAddress
void amiga_pre_swap(); // from gl4es to make working aglSwapBuffers()
void amiga_post_swap(); // from gl4es to make working aglSwapBuffers()
extern void initialize_gl4es(); // initialisation of gl4es.

/*
 * initialize OGLES2 context
 */
 
struct Library *LOGLES2 0;  
struct OGLES2IFace *IOGLES2 0


int os4video_GL_Init(_THIS)
{
    
struct SDL_PrivateVideoData *hidden _this->hidden;

    
LOGLES2 IExec->OpenLibrary("ogles2.library"0);
    if(!
LOGLES2) {
        
printf("LIBGL: Warning, cannot open ogles2 Library!n");
        return;
    }
    
IOGLES2 = (struct OGLES2IFace *)IExec->GetInterface(LOGLES2"main"1NULL); 
    if(!
IOGLES2) {
        
printf("LIBGL: Warning, cannot openogles2 Interface!n");
        
IExec->CloseLibrary(LOGLES2);
        
LOGLES2 NULL;
    }
    
    
dprintf("Initializing GL4ES->OGLES2..n");    
    
    
hidden->IGL=IOGLES2->aglCreateContextTags(0,
                
OGLES2_CCT_WINDOW,(ULONG)hidden->win,
                
OGLES2_CCT_DEPTH,16,
                
OGLES2_CCT_STENCIL,8,
                
OGLES2_CCT_VSYNC,0,
                
OGLES2_CCT_SINGLE_GET_ERROR_MODE,1,
                
OGLES2_CCT_RESIZE_VIEWPORTTRUE,
            
TAG_DONE);
    
    
/*
    struct TagItem tags[] = 
    { 
        {OGLES2_CCT_WINDOW               , (ULONG)hidden->win}, 
        {OGLES2_CCT_DEPTH                , 16                }, 
        {OGLES2_CCT_STENCIL              , 8                 }, 
        {OGLES2_CCT_VSYNC                , 0                 }, 
        {OGLES2_CCT_SINGLE_GET_ERROR_MODE, 1                 }, 
        {OGLES2_CCT_RESIZE_VIEWPORT      , TRUE              }, 
        {TAG_DONE                                            } 
    }; 

    hidden->IGL=IOGLES2->aglCreateContext(0, tags);
    */

    
initialize_gl4es();


    if (
hidden->IGL)
    {
        
_this->gl_config.driver_loaded 1;
    
        
IOGLES2->aglMakeCurrent(hidden->IGL);
        
        
hidden->OpenGL TRUE;

        return 
0;
    }
    else
    {
        
_this->gl_config.driver_loaded 0;
        
SDL_SetError("Failed to create OGLES2 context");
    }

    return -
1;

}

void os4video_GL_Term(_THIS)
{
    
struct SDL_PrivateVideoData *hidden _this->hidden;
    
    
dprintf("Terminate GL4ES->OGLES2..n");
    
    
IOGLES2->aglDestroyContext(hidden->IGL);
        
    
IExec->DropInterface((struct Interface *)IOGLES2);
    
IExec->CloseLibrary(LOGLES2);

    
_this->gl_config.driver_loaded 0;

    
hidden->OpenGL FALSE;
    
}

int    os4video_GL_GetAttribute(_THISSDL_GLattr attribintvalue)
{
   return 
0;
}

int    os4video_GL_MakeCurrent(_THIS)
{
    return 
0;
}

void os4video_GL_SwapBuffers(_THIS)
{
    
amiga_pre_swap();
    
// Swap the Buffers!
    
if(IOGLES2) {
        
IOGLES2->aglSwapBuffers();
    }
    
amiga_post_swap(); 
}


void *os4video_GL_GetProcAddress(_THIS, const char *proc) {
    
void *func NULL;

    if ( !
_this->gl_config.driver_loaded )
    {
        if (
os4video_GL_Init(_this) != 0)
        {
            return 
NULL;
        }
    }

    
func = (void *)aglGetProcAddress(proc);
    return 
func;
}

int os4video_GL_LoadLibrary(_THIS, const char *path) {
    
/* Library is always open */
    
_this->gl_config.driver_loaded 1;

    return 
0;
}
#endif


From gl4es side agl.c in no use, only amigaos.c , which for now looks like this:

#include "amigaos.h"

#include <stdlib.h> 
#include <stdio.h>
#include <string.h>
#include <proto/exec.h>
// make sure we don't use inline version here
#undef __USE_INLINE__
#include <proto/ogles2.h>


extern struct Library *LOGLES2
extern struct OGLES2IFace *IOGLES2;


// Open OGLES2 library and interface
void os4OpenLib(void** lib)
{
    *
lib LOGLES2;
}

// Close OGLES2 lib and interface
void os4CloseLib()
{
}

static 
void AmiglActiveTexture (GLenum texture) {
    return 
IOGLES2->glActiveTexture(texture);
}

static 
void AmiglAttachShader (GLuint programGLuint shader) {
    return 
IOGLES2->glAttachShader(programshader);
}

static 
void AmiglBindAttribLocation (GLuint programGLuint index, const GLchar *name) {
    return 
IOGLES2->glBindAttribLocation(programindexname);
}

static 
void AmiglBindBuffer (GLenum targetGLuint buffer) {
    return 
IOGLES2->glBindBuffer(targetbuffer);
}

static 
void AmiglBindFramebuffer (GLenum targetGLuint framebuffer) {
    return 
IOGLES2->glBindFramebuffer(targetframebuffer);
}

static 
void AmiglBindRenderbuffer (GLenum targetGLuint renderbuffer) {
    return 
IOGLES2->glBindRenderbuffer(targetrenderbuffer);
}

static 
void AmiglBindTexture (GLenum targetGLuint texture) {
    return 
IOGLES2->glBindTexture(targettexture);
}

static 
void AmiglBlendColor (GLfloat redGLfloat greenGLfloat blueGLfloat alpha) {
    return 
IOGLES2->glBlendColor(redgreenbluealpha);
}

static 
void AmiglBlendEquation (GLenum mode) {
    return 
IOGLES2->glBlendEquation(mode);
}

static 
void AmiglBlendEquationSeparate (GLenum modeRGBGLenum modeAlpha) {
    return 
IOGLES2->glBlendEquationSeparate(modeRGBmodeAlpha);
}

static 
void AmiglBlendFunc (GLenum sfactorGLenum dfactor) {
    return 
IOGLES2->glBlendFunc(sfactordfactor);
}

static 
void AmiglBlendFuncSeparate (GLenum sfactorRGBGLenum dfactorRGBGLenum sfactorAlphaGLenum dfactorAlpha) {
    return 
IOGLES2->glBlendFuncSeparate(sfactorRGBdfactorRGBsfactorAlphadfactorAlpha);
}

static 
void AmiglBufferData (GLenum targetGLsizeiptr size, const void *dataGLenum usage) {
    return 
IOGLES2->glBufferData(targetsizedatausage);
}

static 
void AmiglBufferSubData (GLenum targetGLintptr offsetGLsizeiptr size, const void *data) {
    return 
IOGLES2->glBufferSubData(targetoffsetsizedata);
}

static 
GLenum AmiglCheckFramebufferStatus (GLenum target) {
    return 
IOGLES2->glCheckFramebufferStatus(target);
}

static 
void AmiglClear (GLbitfield mask) {
    return 
IOGLES2->glClear(mask);
}

static 
void AmiglClearColor (GLfloat redGLfloat greenGLfloat blueGLfloat alpha) {
    return 
IOGLES2->glClearColor(redgreenbluealpha);
}

static 
void AmiglClearDepthf (GLfloat d) {
    return 
IOGLES2->glClearDepthf(d);
}

static 
void AmiglClearStencil (GLint s) {
    return 
IOGLES2->glClearStencil(s);
}

static 
void AmiglColorMask (GLboolean redGLboolean greenGLboolean blueGLboolean alpha) {
    return 
IOGLES2->glColorMask(redgreenbluealpha);
}

static 
void AmiglCompileShader (GLuint shader) {
    return 
IOGLES2->glCompileShader(shader);
}

static 
void AmiglCompressedTexImage2D (GLenum targetGLint levelGLenum internalformatGLsizei widthGLsizei heightGLint borderGLsizei imageSize, const void *data) {
    return 
IOGLES2->glCompressedTexImage2D(targetlevelinternalformatwidthheightborderimageSizedata);
}

static 
void AmiglCompressedTexSubImage2D (GLenum targetGLint levelGLint xoffsetGLint yoffsetGLsizei widthGLsizei heightGLenum formatGLsizei imageSize, const void *data) {
    return 
IOGLES2->glCompressedTexSubImage2D(targetlevelxoffsetyoffsetwidthheightformatimageSizedata);
}

static 
void AmiglCopyTexImage2D (GLenum targetGLint levelGLenum internalformatGLint xGLint yGLsizei widthGLsizei heightGLint border) {
    return 
IOGLES2->glCopyTexImage2D(targetlevelinternalformatxywidthheightborder);
}

static 
void AmiglCopyTexSubImage2D (GLenum targetGLint levelGLint xoffsetGLint yoffsetGLint xGLint yGLsizei widthGLsizei height) {
    return 
IOGLES2->glCopyTexSubImage2D(targetlevelxoffsetyoffsetxywidthheight);
}

static 
GLuint AmiglCreateProgram (void) {
    return 
IOGLES2->glCreateProgram();
}

static 
GLuint AmiglCreateShader (GLenum type) {
    return 
IOGLES2->glCreateShader(type);
}

static 
void AmiglCullFace (GLenum mode) {
    return 
IOGLES2->glCullFace(mode);
}

static 
void AmiglDeleteBuffers (GLsizei n, const GLuint *buffers) {
    return 
IOGLES2->glDeleteBuffers(nbuffers);
}

static 
void AmiglDeleteFramebuffers (GLsizei n, const GLuint *framebuffers) {
    return 
IOGLES2->glDeleteFramebuffers(nframebuffers);
}

static 
void AmiglDeleteProgram (GLuint program) {
    return 
IOGLES2->glDeleteProgram(program);
}

static 
void AmiglDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers) {
    return 
IOGLES2->glDeleteRenderbuffers(nrenderbuffers);
}

static 
void AmiglDeleteShader (GLuint shader) {
    return 
IOGLES2->glDeleteShader(shader);
}

static 
void AmiglDeleteTextures (GLsizei n, const GLuint *textures) {
    return 
IOGLES2->glDeleteTextures(ntextures);
}

static 
void AmiglDepthFunc (GLenum func) {
    return 
IOGLES2->glDepthFunc(func);
}

static 
void AmiglDepthMask (GLboolean flag) {
    return 
IOGLES2->glDepthMask(flag);
}

static 
void AmiglDepthRangef (GLfloat nGLfloat f) {
    return 
IOGLES2->glDepthRangef(nf);
}

static 
void AmiglDetachShader (GLuint programGLuint shader) {
    return 
IOGLES2->glDetachShader(programshader);
}

static 
void AmiglDisable (GLenum cap) {
    return 
IOGLES2->glDisable(cap);
}

static 
void AmiglDisableVertexAttribArray (GLuint index) {
    return 
IOGLES2->glDisableVertexAttribArray(index);
}

static 
void AmiglDrawArrays (GLenum modeGLint firstGLsizei count) {
    return 
IOGLES2->glDrawArrays(modefirstcount);
}

static 
void AmiglDrawElements (GLenum modeGLsizei countGLenum type, const void *indices) {
    return 
IOGLES2->glDrawElements(modecounttypeindices);
}

static 
void AmiglEnable (GLenum cap) {
    return 
IOGLES2->glEnable(cap);
}

static 
void AmiglEnableVertexAttribArray (GLuint index) {
    return 
IOGLES2->glEnableVertexAttribArray(index);
}

static 
void AmiglFinish (void) {
    return 
IOGLES2->glFinish();
}

static 
void AmiglFlush (void) {
    return 
IOGLES2->glFlush();
}

static 
void AmiglFramebufferRenderbuffer (GLenum targetGLenum attachmentGLenum renderbuffertargetGLuint renderbuffer) {
    return 
IOGLES2->glFramebufferRenderbuffer(targetattachmentrenderbuffertargetrenderbuffer);
}

static 
void AmiglFramebufferTexture2D (GLenum targetGLenum attachmentGLenum textargetGLuint textureGLint level) {
    return 
IOGLES2->glFramebufferTexture2D(targetattachmenttextargettexturelevel);
}

static 
void AmiglFrontFace (GLenum mode) {
    return 
IOGLES2->glFrontFace(mode);
}

static 
void AmiglGenBuffers (GLsizei nGLuint *buffers) {
    return 
IOGLES2->glGenBuffers(nbuffers);
}

static 
void AmiglGenerateMipmap (GLenum target) {
    return 
IOGLES2->glGenerateMipmap(target);
}

static 
void AmiglGenFramebuffers (GLsizei nGLuint *framebuffers) {
    return 
IOGLES2->glGenFramebuffers(nframebuffers);
}

static 
void AmiglGenRenderbuffers (GLsizei nGLuint *renderbuffers) {
    return 
IOGLES2->glGenRenderbuffers(nrenderbuffers);
}

static 
void AmiglGenTextures (GLsizei nGLuint *textures) {
    return 
IOGLES2->glGenTextures(ntextures);
}

static 
void AmiglGetActiveAttrib (GLuint programGLuint indexGLsizei bufSizeGLsizei *lengthGLint *sizeGLenum *typeGLchar *name) {
    return 
IOGLES2->glGetActiveAttrib(programindexbufSizelengthsizetypename);
}

static 
void AmiglGetActiveUniform (GLuint programGLuint indexGLsizei bufSizeGLsizei *lengthGLint *sizeGLenum *typeGLchar *name) {
    return 
IOGLES2->glGetActiveUniform(program,  indexbufSizelengthsizetypename);
}

static 
void AmiglGetAttachedShaders (GLuint programGLsizei maxCountGLsizei *countGLuint *shaders) {
    return 
IOGLES2->glGetAttachedShaders(programmaxCountcountshaders);
}

static 
GLint AmiglGetAttribLocation (GLuint program, const GLchar *name) {
    return 
IOGLES2->glGetAttribLocation(programname);
}

static 
void AmiglGetBooleanv (GLenum pnameGLboolean *data) {
    return 
IOGLES2->glGetBooleanv(pnamedata);
}

static 
void AmiglGetBufferParameteriv (GLenum targetGLenum pnameGLint *params) {
    return 
IOGLES2->glGetBufferParameteriv(targetpnameparams);
}

static 
GLenum AmiglGetError (void) {
    return 
IOGLES2->glGetError();
}

static 
void AmiglGetFloatv (GLenum pnameGLfloat *data) {
    return 
IOGLES2->glGetFloatv(pnamedata);
}

static 
void AmiglGetFramebufferAttachmentParameteriv (GLenum targetGLenum attachmentGLenum pnameGLint *params) {
    return 
IOGLES2->glGetFramebufferAttachmentParameteriv(targetattachmentpnameparams);
}

static 
void AmiglGetIntegerv (GLenum pnameGLint *data) {
    return 
IOGLES2->glGetIntegerv(pnamedata);
}

static 
void AmiglGetProgramiv (GLuint programGLenum pnameGLint *params) {
    return 
IOGLES2->glGetProgramiv(programpnameparams);
}

static 
void AmiglGetProgramInfoLog (GLuint programGLsizei bufSizeGLsizei *lengthGLchar *infoLog) {
    return 
IOGLES2->glGetProgramInfoLog(programbufSizelengthinfoLog);
}

static 
void AmiglGetRenderbufferParameteriv (GLenum targetGLenum pnameGLint *params) {
    return 
IOGLES2->glGetRenderbufferParameteriv(targetpnameparams);
}

static 
void AmiglGetShaderiv (GLuint shaderGLenum pnameGLint *params) {
    return 
IOGLES2->glGetShaderiv(shaderpnameparams);
}

static 
void AmiglGetShaderInfoLog (GLuint shaderGLsizei bufSizeGLsizei *lengthGLchar *infoLog) {
    return 
IOGLES2->glGetShaderInfoLog(shaderbufSizelengthinfoLog);
}

static 
void AmiglGetShaderPrecisionFormat (GLenum shadertypeGLenum precisiontypeGLint *rangeGLint *precision) {
    return 
IOGLES2->glGetShaderPrecisionFormat(shadertypeprecisiontyperangeprecision);
}

static 
void AmiglGetShaderSource (GLuint shaderGLsizei bufSizeGLsizei *lengthGLchar *source) {
    return 
IOGLES2->glGetShaderSource(shaderbufSizelengthsource);
}

static const 
GLubyte *AmiglGetString (GLenum name) {
    return 
IOGLES2->glGetString(name);
}

static 
void AmiglGetTexParameterfv (GLenum targetGLenum pnameGLfloat *params) {
    return 
IOGLES2->glGetTexParameterfv(targetpnameparams);
}

static 
void AmiglGetTexParameteriv (GLenum targetGLenum pnameGLint *params) {
    return 
IOGLES2->glGetTexParameteriv(targetpnameparams);
}

static 
void AmiglGetUniformfv (GLuint programGLint locationGLfloat *params) {
    return 
IOGLES2->glGetUniformfv(programlocationparams);
}

static 
void AmiglGetUniformiv (GLuint programGLint locationGLint *params) {
    return 
IOGLES2->glGetUniformiv(programlocationparams);
}

static 
GLint AmiglGetUniformLocation (GLuint program, const GLchar *name) {
    return 
IOGLES2->glGetUniformLocation(programname);
}

static 
void AmiglGetVertexAttribfv (GLuint indexGLenum pnameGLfloat *params) {
    return 
IOGLES2->glGetVertexAttribfv(indexpnameparams);
}

static 
void AmiglGetVertexAttribiv (GLuint indexGLenum pnameGLint *params) {
    return 
IOGLES2->glGetVertexAttribiv(indexpnameparams);
}

static 
void AmiglGetVertexAttribPointerv (GLuint indexGLenum pnamevoid **pointer) {
    return 
IOGLES2->glGetVertexAttribPointerv(indexpnamepointer);
}

static 
void AmiglHint (GLenum targetGLenum mode) {
    return 
IOGLES2->glHint(targetmode);
}

static 
GLboolean AmiglIsBuffer (GLuint buffer) {
    return 
IOGLES2->glIsBuffer(buffer);
}

static 
GLboolean AmiglIsEnabled (GLenum cap) {
    return 
IOGLES2->glIsEnabled(cap);
}

static 
GLboolean AmiglIsFramebuffer (GLuint framebuffer) {
    return 
IOGLES2->glIsFramebuffer(framebuffer);
}

static 
GLboolean AmiglIsProgram (GLuint program) {
    return 
IOGLES2->glIsProgram(program);
}

static 
GLboolean AmiglIsRenderbuffer (GLuint renderbuffer) {
    return 
IOGLES2->glIsRenderbuffer(renderbuffer);
}

static 
GLboolean AmiglIsShader (GLuint shader) {
    return 
IOGLES2->glIsShader(shader);
}

static 
GLboolean AmiglIsTexture (GLuint texture) {
    return 
IOGLES2->glIsTexture(texture);
}

static 
void AmiglLineWidth (GLfloat width) {
    return 
IOGLES2->glLineWidth(width);
}

static 
void AmiglLinkProgram (GLuint program) {
    return 
IOGLES2->glLinkProgram(program);
}

static 
void AmiglPixelStorei (GLenum pnameGLint param) {
    return 
IOGLES2->glPixelStorei(pnameparam);
}

static 
void AmiglPolygonOffset (GLfloat factorGLfloat units) {
    return 
IOGLES2->glPolygonOffset(factorunits);
}

static 
void AmiglReadPixels (GLint xGLint yGLsizei widthGLsizei heightGLenum formatGLenum typevoid *pixels) {
    return 
IOGLES2->glReadPixels(xywidthheightformattypepixels);
}

static 
void AmiglReleaseShaderCompiler (void) {
    return 
IOGLES2->glReleaseShaderCompiler();
}

static 
void AmiglRenderbufferStorage (GLenum targetGLenum internalformatGLsizei widthGLsizei height) {
    return 
IOGLES2->glRenderbufferStorage(targetinternalformatwidthheight);
}

static 
void AmiglSampleCoverage (GLfloat valueGLboolean invert) {
    return 
IOGLES2->glSampleCoverage(valueinvert);
}

static 
void AmiglScissor (GLint xGLint yGLsizei widthGLsizei height) {
    return 
IOGLES2->glScissor(xywidthheight);
}

static 
void AmiglShaderBinary (GLsizei count, const GLuint *shadersGLenum binaryformat, const void *binaryGLsizei length) {
    return 
IOGLES2->glShaderBinary(countshadersbinaryformatbinarylength);
}

static 
void AmiglShaderSource (GLuint shaderGLsizei count, const GLchar *const*string, const GLint *length) {
    return 
IOGLES2->glShaderSource(shadercountstringlength);
}

static 
void AmiglStencilFunc (GLenum funcGLint refGLuint mask) {
    return 
IOGLES2->glStencilFunc(funcrefmask);
}

static 
void AmiglStencilFuncSeparate (GLenum faceGLenum funcGLint refGLuint mask) {
    return 
IOGLES2->glStencilFuncSeparate(facefuncrefmask);
}

static 
void AmiglStencilMask (GLuint mask) {
    return 
IOGLES2->glStencilMask(mask);
}

static 
void AmiglStencilMaskSeparate (GLenum faceGLuint mask) {
    return 
IOGLES2->glStencilMaskSeparate(facemask);
}

static 
void AmiglStencilOp (GLenum failGLenum zfailGLenum zpass) {
    return 
IOGLES2->glStencilOp(failzfailzpass);
}

static 
void AmiglStencilOpSeparate (GLenum faceGLenum sfailGLenum dpfailGLenum dppass) {
    return 
IOGLES2->glStencilOpSeparate(facesfaildpfaildppass);
}

static 
void AmiglTexImage2D (GLenum targetGLint levelGLint internalformatGLsizei widthGLsizei heightGLint borderGLenum formatGLenum type, const void *pixels) {
    return 
IOGLES2->glTexImage2D(targetlevelinternalformatwidthheightborderformattypepixels);
}

static 
void AmiglTexParameterf (GLenum targetGLenum pnameGLfloat param) {
    return 
IOGLES2->glTexParameterf(targetpnameparam);
}

static 
void AmiglTexParameterfv (GLenum targetGLenum pname, const GLfloat *params) {
    return 
IOGLES2->glTexParameterfv(targetpnameparams);
}

static 
void AmiglTexParameteri (GLenum targetGLenum pnameGLint param) {
    return 
IOGLES2->glTexParameteri(targetpnameparam);
}

static 
void AmiglTexParameteriv (GLenum targetGLenum pname, const GLint *params) {
    return 
IOGLES2->glTexParameteriv(targetpnameparams);
}

static 
void AmiglTexSubImage2D (GLenum targetGLint levelGLint xoffsetGLint yoffsetGLsizei widthGLsizei heightGLenum formatGLenum type, const void *pixels) {
    return 
IOGLES2->glTexSubImage2D(targetlevelxoffsetyoffsetwidthheightformattypepixels);
}

static 
void AmiglUniform1f (GLint locationGLfloat v0) {
    return 
IOGLES2->glUniform1f(locationv0);
}

static 
void AmiglUniform1fv (GLint locationGLsizei count, const GLfloat *value) {
    return 
IOGLES2->glUniform1fv(locationcountvalue);
}

static 
void AmiglUniform1i (GLint locationGLint v0) {
    return 
IOGLES2->glUniform1i(locationv0);
}

static 
void AmiglUniform1iv (GLint locationGLsizei count, const GLint *value) {
    return 
IOGLES2->glUniform1iv(locationcountvalue);
}

static 
void AmiglUniform2f (GLint locationGLfloat v0GLfloat v1) {
    return 
IOGLES2->glUniform2f(locationv0v1);
}

static 
void AmiglUniform2fv (GLint locationGLsizei count, const GLfloat *value) {
    return 
IOGLES2->glUniform2fv(locationcountvalue);
}

static 
void AmiglUniform2i (GLint locationGLint v0GLint v1) {
    return 
IOGLES2->glUniform2i(locationv0v1);
}

static 
void AmiglUniform2iv (GLint locationGLsizei count, const GLint *value) {
    return 
IOGLES2->glUniform2iv(locationcountvalue);
}

static 
void AmiglUniform3f (GLint locationGLfloat v0GLfloat v1GLfloat v2) {
    return 
IOGLES2->glUniform3f(locationv0v1v2);
}

static 
void AmiglUniform3fv (GLint locationGLsizei count, const GLfloat *value) {
    return 
IOGLES2->glUniform3fv(locationcountvalue);
}

static 
void AmiglUniform3i (GLint locationGLint v0GLint v1GLint v2) {
    return 
IOGLES2->glUniform3i(locationv0v1v2);
}

static 
void AmiglUniform3iv (GLint locationGLsizei count, const GLint *value) {
    return 
IOGLES2->glUniform3iv(locationcountvalue);
}

static 
void AmiglUniform4f (GLint locationGLfloat v0GLfloat v1GLfloat v2GLfloat v3) {
    return 
IOGLES2->glUniform4f(locationv0v1v2v3);
}

static 
void AmiglUniform4fv (GLint locationGLsizei count, const GLfloat *value) {
    return 
IOGLES2->glUniform4fv(locationcountvalue);
}

static 
void AmiglUniform4i (GLint locationGLint v0GLint v1GLint v2GLint v3) {
    return 
IOGLES2->glUniform4i(locationv0v1v2v3);
}

static 
void AmiglUniform4iv (GLint locationGLsizei count, const GLint *value) {
    return 
IOGLES2->glUniform4iv(locationcountvalue);
}

static 
void AmiglUniformMatrix2fv (GLint locationGLsizei countGLboolean transpose, const GLfloat *value) {
    return 
IOGLES2->glUniformMatrix2fv(locationcounttransposevalue);
}

static 
void AmiglUniformMatrix3fv (GLint locationGLsizei countGLboolean transpose, const GLfloat *value) {
    return 
IOGLES2->glUniformMatrix3fv(locationcounttransposevalue);
}

static 
void AmiglUniformMatrix4fv (GLint locationGLsizei countGLboolean transpose, const GLfloat *value) {
    return 
IOGLES2->glUniformMatrix4fv(locationcounttransposevalue);
}

static 
void AmiglUseProgram (GLuint program) {
    return 
IOGLES2->glUseProgram(program);
}

static 
void AmiglValidateProgram (GLuint program) {
    return 
IOGLES2->glValidateProgram(program);
}

static 
void AmiglVertexAttrib1f (GLuint indexGLfloat x) {
    return 
IOGLES2->glVertexAttrib1f(indexx);
}

static 
void AmiglVertexAttrib1fv (GLuint index, const GLfloat *v) {
    return 
IOGLES2->glVertexAttrib1fv(indexv);
}

static 
void AmiglVertexAttrib2f (GLuint indexGLfloat xGLfloat y) {
    return 
IOGLES2->glVertexAttrib2f(indexxy);
}

static 
void AmiglVertexAttrib2fv (GLuint index, const GLfloat *v) {
    return 
IOGLES2->glVertexAttrib2fv(indexv);
}

static 
void AmiglVertexAttrib3f (GLuint indexGLfloat xGLfloat yGLfloat z) {
    return 
IOGLES2->glVertexAttrib3f(indexxyz);
}

static 
void AmiglVertexAttrib3fv (GLuint index, const GLfloat *v) {
    return 
IOGLES2->glVertexAttrib3fv(indexv);
}

static 
void AmiglVertexAttrib4f (GLuint indexGLfloat xGLfloat yGLfloat zGLfloat w) {
    return 
IOGLES2->glVertexAttrib4f(indexxyzw);
}

static 
void AmiglVertexAttrib4fv (GLuint index, const GLfloat *v) {
    return 
IOGLES2->glVertexAttrib4fv(indexv);
}

static 
void AmiglVertexAttribPointer (GLuint indexGLint sizeGLenum typeGLboolean normalizedGLsizei stride, const void *pointer) {
    return 
IOGLES2->glVertexAttribPointer(indexsizetypenormalizedstridepointer);
}

static 
void AmiglViewport (GLint xGLint yGLsizei widthGLsizei height) {
    return 
IOGLES2->glViewport(xywidthheight);
}

// Using glXXX name, return the function pointer of that function in ogles2 library
#define MAP(func_name, func) 
    
if (strcmp(namefunc_name) == 0) return (void *)Ami##func;

#define EX(func_name) MAP(#func_name, func_name)

voidos4GetProcAddress(const charname)
{
    if(!
IOGLES2)
        return 
NULL;
    
// All GL functions from OGLES2 drivers
    
EX(glActiveTexture)
    
EX(glAttachShader)
    
EX(glBindAttribLocation)
    
EX(glBindBuffer)
    
EX(glBindFramebuffer)
    
EX(glBindRenderbuffer)
    
EX(glBindTexture)
    
EX(glBlendColor)
    
EX(glBlendEquation)
    
EX(glBlendEquationSeparate)
    
EX(glBlendFunc)
    
EX(glBlendFuncSeparate)
    
EX(glBufferData)
    
EX(glBufferSubData)
    
EX(glCheckFramebufferStatus)
    
EX(glClear)
    
EX(glClearColor)
    
EX(glClearDepthf)
    
EX(glClearStencil)
    
EX(glColorMask)
    
EX(glCompileShader)
    
EX(glCompressedTexImage2D)
    
EX(glCompressedTexSubImage2D)
    
EX(glCopyTexImage2D)
    
EX(glCopyTexSubImage2D)
    
EX(glCreateProgram)
    
EX(glCreateShader)
    
EX(glCullFace)
    
EX(glDeleteBuffers)
    
EX(glDeleteFramebuffers)
    
EX(glDeleteProgram)
    
EX(glDeleteRenderbuffers)
    
EX(glDeleteShader)
    
EX(glDeleteTextures)
    
EX(glDepthFunc)
    
EX(glDepthMask)
    
EX(glDepthRangef)
    
EX(glDetachShader)
    
EX(glDisable)
    
EX(glDisableVertexAttribArray)
    
EX(glDrawArrays)
    
EX(glDrawElements)
    
EX(glEnable)
    
EX(glEnableVertexAttribArray)
    
EX(glFinish)
    
EX(glFlush)
    
EX(glFramebufferRenderbuffer)
    
EX(glFramebufferTexture2D)
    
EX(glFrontFace)
    
EX(glGenBuffers)
    
EX(glGenerateMipmap)
    
EX(glGenFramebuffers)
    
EX(glGenRenderbuffers)
    
EX(glGenTextures)
    
EX(glGetActiveAttrib)
    
EX(glGetActiveUniform)
    
EX(glGetAttachedShaders)
    
EX(glGetAttribLocation)
    
EX(glGetBooleanv)
    
EX(glGetBufferParameteriv)
    
EX(glGetError)
    
EX(glGetFloatv)
    
EX(glGetFramebufferAttachmentParameteriv)
    
EX(glGetIntegerv)
    
EX(glGetProgramiv)
    
EX(glGetProgramInfoLog)
    
EX(glGetRenderbufferParameteriv)
    
EX(glGetShaderiv)
    
EX(glGetShaderInfoLog)
    
EX(glGetShaderPrecisionFormat)
    
EX(glGetShaderSource)
    
EX(glGetString)
    
EX(glGetTexParameterfv)
    
EX(glGetTexParameteriv)
    
EX(glGetUniformfv)
    
EX(glGetUniformiv)
    
EX(glGetUniformLocation)
    
EX(glGetVertexAttribfv)
    
EX(glGetVertexAttribiv)
    
EX(glGetVertexAttribPointerv)
    
EX(glHint)
    
EX(glIsBuffer)
    
EX(glIsEnabled)
    
EX(glIsFramebuffer)
    
EX(glIsProgram)
    
EX(glIsRenderbuffer)
    
EX(glIsShader)
    
EX(glIsTexture)
    
EX(glLineWidth)
    
EX(glLinkProgram)
    
EX(glPixelStorei)
    
EX(glPolygonOffset)
    
EX(glReadPixels)
    
EX(glReleaseShaderCompiler)
    
EX(glRenderbufferStorage)
    
EX(glSampleCoverage)
    
EX(glScissor)
    
EX(glShaderBinary)
    
EX(glShaderSource)
    
EX(glStencilFunc)
    
EX(glStencilFuncSeparate)
    
EX(glStencilMask)
    
EX(glStencilMaskSeparate)
    
EX(glStencilOp)
    
EX(glStencilOpSeparate)
    
EX(glTexImage2D)
    
EX(glTexParameterf)
    
EX(glTexParameterfv)
    
EX(glTexParameteri)
    
EX(glTexParameteriv)
    
EX(glTexSubImage2D)
    
EX(glUniform1f)
    
EX(glUniform1fv)
    
EX(glUniform1i)
    
EX(glUniform1iv)
    
EX(glUniform2f)
    
EX(glUniform2fv)
    
EX(glUniform2i)
    
EX(glUniform2iv)
    
EX(glUniform3f)
    
EX(glUniform3fv)
    
EX(glUniform3i)
    
EX(glUniform3iv)
    
EX(glUniform4f)
    
EX(glUniform4fv)
    
EX(glUniform4i)
    
EX(glUniform4iv)
    
EX(glUniformMatrix2fv)
    
EX(glUniformMatrix3fv)
    
EX(glUniformMatrix4fv)
    
EX(glUseProgram)
    
EX(glValidateProgram)
    
EX(glVertexAttrib1f)
    
EX(glVertexAttrib1fv)
    
EX(glVertexAttrib2f)
    
EX(glVertexAttrib2fv)
    
EX(glVertexAttrib3f)
    
EX(glVertexAttrib3fv)
    
EX(glVertexAttrib4f)
    
EX(glVertexAttrib4fv)
    
EX(glVertexAttribPointer)
    
EX(glViewport)
    
//EX(glPolygonMode) //This is a non-standard function, and gl4es will ignore it (and emulate it), even if Amiga OGLES2 driver implement it

    
return NULL;
}


So, after that little reorganization, cadog issue with title pic, always there, and does not matter if i use dprintf or will just use some tiny 1 byte's pritnf("a"); (probably trashed memory shifts as i do open library / iface before context now).

But replacing IOGLES2->aglCreateContextTags() on IOGLES2->aglCreateContext(), make issue disappear (which again mean nothing , but only that issue with trashed memory shifts differently).

Now question is, WTF ! :) gl4es guy say that he offten check gl4es with Valgrind, so he sure there hould't be trashing coming from gl4es. SDL1 to blame ? But i remember i build quake3 without usage of SDL at all, just taken some pure MiniGL version and replaced it on GL4ES one, and have same issues as with SDL/MiniGL version.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Joined:
2007/7/14 20:30
From Lothric
Posts: 446
@kas1e

I doubt he has checked any Amiga-specific code with Valgrind.

   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Joined:
2012/12/21 10:55
Posts: 27
@kas1e

I would not rule out other kind of error (= not necessarily memory trash). Maybe the vararg function call simply goes wrong, like some header trouble causing VARARGS68K being defined to nothing and then the aglCreateContextTags() goes wrong, ie. it no longer pushes all args on the stack, instead some in registers, some on stack, like in a normal (non VARARGS68K) vararg call.

Look at generated compiler output (gcc -S). Add some dummy function which does the call and nothing else. So it's easier to read the asm (PPC asm is bad enough to read already):

int dummydebugfunc(void)
{
    return (int)
IOGLES2->aglCreateContextTags(0,
                
OGLES2_CCT_WINDOW,0x12345678,
                
OGLES2_CCT_DEPTH,16,
                
OGLES2_CCT_STENCIL,8,
                
OGLES2_CCT_VSYNC,0,
                
OGLES2_CCT_SINGLE_GET_ERROR_MODE,1,
                
OGLES2_CCT_RESIZE_VIEWPORTTRUE,
            
TAG_DONE);
}



   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
@Capehill
Quote:

I doubt he has checked any Amiga-specific code with Valgrind.

Sure he didn't, but he about Gl4ES, which he think can't be cause of memory trashing, as he check it with valgrind.

In other words, he mean that we can rule out gl4es itself from being guilty for memory trashing, and so we leave with SDL1 (+ my intergration of gl4es in), ogles2 and warp3dnova.

@Georg

There is output:

.section    ".text"
.Ltext0:
    .
align 2
    
.globl dummydebugfunc
    
.type    dummydebugfunc, @function
dummydebugfunc:
.
LFB376:
    .
file 1 "src/video/amigaos4/SDL_os4gl.c"
    
.loc 1 43 0
    stwu 
%r1,-64(%r1)
.
LCFI0:
    .
loc 1 44 0
    lis 
%r11,0x1234
    
.loc 1 43 0
    mflr 
%r0
.LCFI1:
    .
loc 1 44 0
    li 
%r9,0
    ori 
%r11,%r11,22136
    li 
%r4,0
    stw 
%r11,12(%r1)
    
li %r11,3
    stw 
%r11,16(%r1)
    
li %r11,16
    stw 
%r11,20(%r1)
    
li %r11,4
    stw 
%r11,24(%r1)
    
li %r11,8
    stw 
%r11,28(%r1)
    
li %r11,5
    stw 
%r11,32(%r1)
    
li %r11,6
    
.loc 1 43 0
    stw 
%r0,68(%r1)
.
LCFI2:
    .
loc 1 44 0
    li 
%r0,1
    stw 
%r11,40(%r1)
    
li %r11,12
    stw 
%r9,56(%r1)
    
stw %r9,36(%r1)
    
lis %r9,IOGLES2@ha
    stw 
%r11,48(%r1)
    
stw %r0,52(%r1)
    
stw %r0,8(%r1)
    
stw %r0,44(%r1)
    
lwz %r9,IOGLES2@l(%r9)
    
lwz %r0,80(%r9)
    
mr %r3,%r9
    mtctr 
%r0
    bctrl
    
.loc 1 52 0
    lwz 
%r0,68(%r1)
    
addi %r1,%r1,64
    mtlr 
%r0
    blr
.LFE376:
    .
size    dummydebugfunc, .-dummydebugfunc


Should to add , that when i play with the settings of context, i.e., for example comment out OGLES2_CCT_STENCIL,8, and OGLES2_CCT_VSYNC,0, and made OGLES2_CCT_DEPTH not 16 , but 32, then background picture in Cadog back.


_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Joined:
2012/12/21 10:55
Posts: 27
@kas1e

That asm is really hard to read for me. Do I see this correctly that tags are #defined (I don't have headers)
to

OGLES2_CCT_WINDOW 1
OGLES2_CCT_DEPTH 
3


Normally tags need to be >= TAG_USER (0x80000000 + something). Does OGLES2 parse tags manually. Because otherwise there is conflict, because TAG_IGNORE = 3, and TAG_SKIP = 1, so such a taglist would be broken when used with normal tag parsing functions like NextTagItem().

I noticed

#undef __USE_INLINE__


Does other OGLES test programs/demos/games/whatever work if they do this too and they are at the same time using vararg functions like aglCreateContextTags(). Because when USE_INLINE is active the IOGLES2->aglCreateContextTags() probably never gets called as the inlines likely map it to IOGLES2->aglCreateContext().

So it could be that IOGLES2->aglCreateContextTags() itself is broken inside IOGLES2.


   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
@Georg
There is ogles2 includes: http://kas1e.mikendezign.com/aos4/gl4es/gles2_os4_includes.zip

See there in ogles2/ogles2_defs.h at top enum for tags.

Quote:

Does other OGLES test programs/demos/games/whatever work if they do this too and they are at the same time using vararg functions like aglCreateContextTags().


Never tried to be honest.

But , still, that we talk about Cadog issue only, while, if i just use pure aglCreateContext() (without Tags at end). This fix issue with Cadog, but didn't fix issues with trashed textures in the LettersFall game.

That of course can be just 2 different issues, through..

Quote:

probably never gets called as the inlines likely map it to IOGLES2->aglCreateContext().


At least in inlines of ogles2, i see that :

Quote:

#define aglCreateContext(errcode, tags) IOGLES2->aglCreateContext((errcode), (tags))
#define aglCreateContextTags(errcode, ...) IOGLES2->aglCreateContextTags((errcode), __VA_ARGS__)

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
@Georg
After checking more about: #undef __USE_INLINE__ used only in gl4es's amigaos.c / agl.c files, just so he sure that we don't use inline version here (he do so before when he use wrapper functinos with the same names, so to avoid conflicts just in case).

Now i don't use agl.c , only amigaos.c , and as it part of GL4ES, it builds separately from SDL (from where i do context creation), it builds when i build libgl4es.a. What mean, that it can't be related, as well as gcc -S on SDL file where i create ogles2 context, will show nothing wrong , as undef is only for amigaos.c which is in libgl4es.a.

At moment i trying to short as possible Cadog game by cutting off all the game's code , so to just keep loading of texture and showing menu. At moment cut off levels, music/sound loading (so on linking stage no more links with music/sound libs), and bug still there. Hope to reduce it to very minimum and bug still will be there, then it will be much easer to find out what wrong.


Edited by kas1e on 2018/3/19 11:51:54
_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
Was able to cut off from cadog as much as possible, i.e. pure loading of necessary stuff and ability to choice exit from. No music, no sounds, no leveles, no game, just first title pic, and ability to choice exit from game.

Now, when i step by step reduce code of game, bug was the same always : i.e. i just replace aglCreateContextTags() with aglCreateContext() and all works. Then, at some point when i remove quite a lot, background picture was ok in both cases, and with aglCreateContextTags(), and with aglCreateContext(), but then, i add some "printf" before aglCreateContextTags(), and bug appears again. Once a put aglCreateContext() in use, with the same printf, then all fine.

And in code which keept at moment in Cadog, even no single glDraw... function is used. Just some crap like:

glBegin(GL_QUADS);
glTexCoord2f(0,0); glVertex3f(x,y,z);
glEnd;

and co.


Dunno where to look next. Maybe trying to get rid of SDL and open ogles2 / create context / initialize gl4es from game's code itself, but then if bug will just disappear, and can't be triggered again that will mean nothing. As it now at least it reproducable (sort of).

I even can't understand what kind of bug it can be, as it all looks like depends of how big/small sections of code/data, and how they shifted, or how and where data placed. Like not like just usuall memmory trashing

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Joined:
2015/6/11 8:51
From Cologne
Posts: 121
@Georg
Quote:
Normally tags need to be >= TAG_USER (0x80000000 + something). Does OGLES2 parse tags manually.

Nice great stupidity by me indeed
But yes, I do parse those manually so as long as you only use the tags that are defined by ogles2.lib everything is good (and if you don't "comply" here then the context will not be created as you configured it (or maybe in worst case simply crash there), no matter if you use the vararg or the struct-ptr variant, which internally boil down to execute the same code). I just fixed it for the next lib release. Thanks for noting!

@kas1e
Please upload your minimal test examples (like Cadog stripped down) to my FTP. The less complex a test prog is the better.
Also note that the beforementioned fixed ogles2.lib 1.20 wip-version (also containing some other new features) is on the FTP too.


Edited by Daytona675x on 2018/3/20 6:17:24
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Joined:
2012/12/21 10:55
Posts: 27
@kas1e

Quote:

I even can't understand what kind of bug it can be


Apart from mem trashes it could be things like compiler generating wrong code. Where sometimes it may not be even 100 % compiler fault, like with this strict aliasing stuff where it could be more a fault in the sources. Ever tried compiling with -O0 and or things like -fno-strict-aliasing? Maybe have once a gain a look at disassembled function which calls aglCreateContextTags() (the real function, not the dummy one, because it can be that correct code is generated for dummy one, but not real one which does more things incl. dprintf etc.).

Or it could be inside OGLES2's aglCreateContextTags() which must ~extract/~cast/~convert the "..." correctly to a struct TagItem* before passing it on to aglCreateContext(). On the various OSes/cpus and versions of it and it's compilers there are different methods (&lastparam +1, va_start() + co., va_startlinear() + co.,)


   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4536
@Daniel
Quote:

Please upload your minimal test examples (like Cadog stripped down) to my FTP. The less complex a test prog is the better.


Uploaded reports_here/cadog_test.lha. Inside 2 binaries, one with debugprintf before aglcreatecontexttags, and another without debugprinfs before aglcreatecontexttags.

There after running you can navigate to "exit" and exit from, all other stuff removed (most of it).

Run bins like this "bin_name -w - s 640x480". That one without debugprinfs before contexttags, should show background picture, another one, with debugprinfs before contexttags, show white background.

Through when you first time run "no debug printf" one, it also may not show background, but if you run it second time, it will (which all point on those random issues).

Quote:

Also note that the beforementioned fixed ogles2.lib 1.20 wip-version (also containing some other new features) is on the FTP too.


Yeah, will test it all now with all the games.

@Georg
Quote:

Or it could be inside OGLES2's aglCreateContextTags() which must ~extract/~cast/~convert the "..." correctly to a struct TagItem* before passing it on to aglCreateContext(). On the various OSes/cpus and versions of it and it's compilers there are different methods (&lastparam +1, va_start() + co., va_startlinear() + co.,)


But then, pure aglCreateContext() should works fine. While with Cadog it is , memory trashing in LettersFall game still here.

But i will recheck with latest Daniel's ogles2.library with all those new createcontext functions, to see how it will behave now.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Just popping in
Joined:
2015/6/11 8:51
From Cologne
Posts: 121
@kas1e
Quote:
But i will recheck with latest Daniel's ogles2.library with all those new createcontext functions, to see how it will behave now.

It won't behave differently (well, if it does then it's just a sideeffect of sth. else) and it is certainly not the cause for any of our issues here.
As being said: while Georg was of course absolutely right by pointing out the tags-wrong-IDs-bug in ogles2, there is nothing more there. And unless you used TAG_SKIP or other special tags (which AFAIK you did not), it simply did what you expected it to do. Other than this now fixed incompatibility to std. tags-processing, there is / was nothing wrong here.
Don't forget to read the changelog.

   Report Go to top


« 1 ... 7 8 9 (10) 11 12 13 ... 17 »



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project