Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
183 user(s) are online (162 user(s) are browsing Forums)

Members: 3
Guests: 180

NinjaCyborg, amigait, emeck, more...

Support us!

Headlines

 
  Register To Post  

Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@All
Since some years Irrliht engine do have OGLES2 branch, which once things finalized will be released as Irrlicht 1.9.

So far for us it mean that we can try to make it to work directly over ogles2.library, and get rid of GL4ES layer in between.

The problem is that OGLES2 in Irrlich use EGL for context creation, activation, swapbuffers, etc. For us of course it will be better to not have any additional layers, and did the same as it happens to be with pure OpenGL : through SDL.

Why Irrlicht devs going EGL route with context creation , while they still use SDL to create a window, handle events, etc: is unkonwn, maybe for compatibility reassons for win32/x11/android/emscripten/etc. But what we can do for sure it's get rid of it for us and ourself create ogles2 context and use SDL window to render to it.


So to go futher there is relevant files:

EGL Manager (so you can see it just for context creation/destroying/swapbuffers/etc, i.e. minimal stuff with no events and co):

https://sourceforge.net/p/irrlicht/cod ... /Irrlicht/CEGLManager.cpp
https://sourceforge.net/p/irrlicht/cod ... ce/Irrlicht/CEGLManager.h

And there are relevant CIrrDeviceSDL files (i.e. where we init SDL, create a window, etc).:

https://sourceforge.net/p/irrlicht/cod ... rrlicht/CIrrDeviceSDL.cpp
https://sourceforge.net/p/irrlicht/cod ... /Irrlicht/CIrrDeviceSDL.h


As can be seen, since line 483 we have that:

case video::EDT_OGLES2:
#if defined(_IRR_COMPILE_WITH_OGLES2_) && defined(_IRR_EMSCRIPTEN_PLATFORM_)
        
{
            
video::SExposedVideoData data;

            
ContextManager = new video::CEGLManager();
            
ContextManager->initialize(CreationParamsdata);

            
VideoDriver video::createOGLES2Driver(CreationParamsFileSystemContextManager);
        }
#else
        
os::Printer::log("No OpenGL-ES2 support compiled in."ELL_ERROR);
#endif
        
break;


So, createOGLES2Driver is called with passing CreationParams, FileSystem and, our ContextManager, which is EGL one there and we need to replace it on SDL one.

For that, i go the same route as it was with pure OpenGL: comment there all out, and put just one line:

VideoDriver video::createOGLES2Driver(CreationParamsFileSystemthis);


Now, we have COGLES2Driver itself:

https://sourceforge.net/p/irrlicht/cod ... rrlicht/COGLES2Driver.cpp
https://sourceforge.net/p/irrlicht/cod ... /Irrlicht/COGLES2Driver.h

There we also change context manager as it done in case with pure OpenGL. Like it was:

COGLES2Driver::COGLES2Driver(const SIrrlichtCreationParametersparamsio::IFileSystemioIContextManagercontextManager) :
    
CNullDriver(ioparams.WindowSize), COGLES2ExtensionHandler(), CacheHandler(0),
    
Params(params), ResetRenderStates(true), LockRenderStateMode(false), AntiAlias(params.AntiAlias),
    
MaterialRenderer2DActive(0), MaterialRenderer2DTexture(0), MaterialRenderer2DNoTexture(0),
    
CurrentRenderMode(ERM_NONE), Transformation3DChanged(true),
    
OGLES2ShaderPath(params.OGLES2ShaderPath),
    
ColorFormat(ECF_R8G8B8), ContextManager(contextManager)


Which one we change that instead of IContextManager* contextManager we do have CIrrDeviceSDL* device, and at the end instead of ContextManager(contextManager) do ContextManager(0) (as in case with pure OpenGL).

And same for createOGLES2Driver:

//IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)
IVideoDrivercreateOGLES2Driver(const SIrrlichtCreationParametersparamsio::IFileSystemio,CIrrDeviceSDLdevice)
{
#ifdef _IRR_COMPILE_WITH_OGLES2_
    //COGLES2Driver* driver = new COGLES2Driver(params, io, contextManager);
    
COGLES2Driverdriver = new COGLES2Driver(paramsiodevice);
    
driver->genericDriverInit(params.WindowSizeparams.Stencilbuffer);    // don't call in constructor, it uses virtual function calls of driver
    
return driver;
#else
    
return 0;
#endif //  _IRR_COMPILE_WITH_OGLES2_



Now, with SDL we can go 2 ways:

1). Use the same hack as in GL4ES (so instead of MiniGL, we do use OGLES2, but SDL think about it as OpenGL). That also mean that we should call SetVideoModes() with SDL_OPENGL flag being enabled.


2). Second way is that we didn't touch SDL itself, but instead create sdl window via SetVideoModes _without_ SDL_OPENGL flag, so SDL will not involve MiniGL, but instead we in Irrlicht's SDL openwindow() open OGLES2 library, create context, take the intuition window pointer, and call aglMakeCurrent() on it, like this:

bool CIrrDeviceSDL::createWindow()
{
....

    
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;
    }

.... 
SetVideoMode call...

    
ULONG errCode 0

    
// get intuition window pointer
    
SDL_SysWMinfo wmi = { };
    
SDL_GetWMInfo(&wmi);
                
    
struct TagItem contextparams[] =
    {
            {
OGLES2_CCT_WINDOW,(ULONG)wmi.window},
            {
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,0}
    };
        
    
void *ogles_context IOGLES2->aglCreateContext2(&errCode,contextparams);

      if (
ogles_context)
    {
        
IOGLES2->aglMakeCurrent(ogles_context);
        
    }



So i tried both ways, and have at the moment result of "nothing renders on screen" by the very simple test case.

Through, when i run exampe after those changes, i do have in the shell lots of:

Quote:

GLSL shader programm failed to link
GLSL shader programm failed to link
GLSL shader programm failed to link
GLSL shader programm failed to link
GLSL shader programm failed to link
GLSL shader programm failed to link
GL_INVALID_OPERATION: 176


So firstly what i do is delete fully media/shaders/ directory, and start to run it to see what shaders it want to use as necessary basis, and there just 3 shaders for:

1 fragment one - COGLES2Renderer2D.fsh :

precision mediump float;

/* Uniforms */

uniform int uTextureUsage;
uniform sampler2D uTextureUnit;

/* Varyings */

varying vec2 vTextureCoord;
varying vec4 vVertexColor;

void main()
{
    
vec4 Color vVertexColor;

    if (
bool(uTextureUsage))
        
Color *= texture2D(uTextureUnitvTextureCoord);

    
gl_FragColor Color;
}


2 fragment one: COGLES2Renderer2D_noTex.fsh:

precision mediump float;

/* Varyings */
varying vec4 vVertexColor;

void main()
{
    
gl_FragColor vVertexColor;
}


And , 3st one, vertex one, called COGLES2Renderer2D.vsh and there this are:

/* Attributes */

attribute vec4 inVertexPosition;
attribute vec4 inVertexColor;
attribute vec2 inTexCoord0;

/* Uniforms */

uniform float uThickness;

/* Varyings */

varying vec2 vTextureCoord;
varying vec4 vVertexColor;

void main()
{
    
gl_Position inVertexPosition;
    
gl_PointSize uThickness;
    
vTextureCoord inTexCoord0;
    
vVertexColor inVertexColor.bgra;
}


So with only just those 3 shaders in the media/shaders directory, i run the example, and while have lots of "could not open" for other shaders, i didn't have error that i must to have some shader to make fixed pipeline working, and , have now just one single

"GLSL shader program failed to link.".


So, i give it ago all 3 through glslangvalidator (to made SPIRV from them) and then W3DShaderInfo, to see if they compiles by Nova : and they all compiles fine..


I also checked via glSnoop what happens now , and that what i have in output:

[0Patching task Shell Process '01.hello' OGLES2IFace 0x4dde7758
Shell Process 
'01.hello'my_W3DN_CreateContexttags 0x597b1888 ([W3DNTag_GPU0x4DDE84A8])
[
0Patching task Shell Process '01.hello' NOVA context 0x4dde7ab0
Shell Process 
'01.hello'OGLES2_glShaderSourceshader 384count 1string 0x597b14a0 length 0x0
Line 0
'/* Attributes */

attribute vec4 inVertexPosition;
attribute vec4 inVertexColor;
attribute vec2 inTexCoord0;

/* Uniforms */

uniform float uThickness;

/* Varyings */

varying vec2 vTextureCoord;
varying vec4 vVertexColor;

void main()
{
        gl_Position = inVertexPosition;
        gl_PointSize = uThickness;
        vTextureCoord = inTexCoord0;
        vVertexColor = inVertexColor.bgra;
}
'
Shell Process '01.hello'GL error 1282 (GL_INVALID_OPERATIONdetected after ShaderSource
Shell Process 
'01.hello'OGLES2_glCompileShadershader 384
Shell Process 
'01.hello'W3DN_CompileShadererrCode 0x597b13a4tags 0x597b1378 ([W3DNTag_DataBuffer0x484CD018][W3DNTag_DataSize948][W3DNTag_Log0x597B13A0][W3DNTag_LogLevel0])
Shell Process '01.hello'W3DN_CompileShader: <- errCode 0 (W3DNEC_SUCCESS). Shader address 0x5a956908
Shell Process 
'01.hello'OGLES2_glShaderSourceshader 385count 1string 0x597b14a0 length 0x0
Line 0
'precision mediump float;

/* Uniforms */

uniform int uTextureUsage;
uniform sampler2D uTextureUnit;

/* Varyings */

varying vec2 vTextureCoord;
varying vec4 vVertexColor;

void main()
{
        vec4 Color = vVertexColor;

        if (bool(uTextureUsage))
                Color *= texture2D(uTextureUnit, vTextureCoord);

        gl_FragColor = Color;
}
'
Shell Process '01.hello'OGLES2_glCompileShadershader 385
Shell Process 
'01.hello'W3DN_CompileShadererrCode 0x597b13a4tags 0x597b1378 ([W3DNTag_DataBuffer0x484CD018][W3DNTag_DataSize960][W3DNTag_Log0x597B13A0][W3DNTag_LogLevel0])
Shell Process '01.hello'W3DN_CompileShader: <- errCode 0 (W3DNEC_SUCCESS). Shader address 0x5a956728
Shell Process 
'01.hello'OGLES2_glShaderSourceshader 386count 1string 0x597b14a0 length 0x0
Line 0
'/* Attributes */

attribute vec4 inVertexPosition;
attribute vec4 inVertexColor;
attribute vec2 inTexCoord0;

/* Uniforms */

uniform float uThickness;

/* Varyings */

varying vec2 vTextureCoord;
varying vec4 vVertexColor;

void main()
{
        gl_Position = inVertexPosition;
        gl_PointSize = uThickness;
        vTextureCoord = inTexCoord0;
        vVertexColor = inVertexColor.bgra;
}
'
Shell Process '01.hello'OGLES2_glCompileShadershader 386
Shell Process 
'01.hello'W3DN_CompileShadererrCode 0x597b13a4tags 0x597b1378 ([W3DNTag_DataBuffer0x484CD018][W3DNTag_DataSize948][W3DNTag_Log0x597B13A0][W3DNTag_LogLevel0])
Shell Process '01.hello'W3DN_CompileShader: <- errCode 0 (W3DNEC_SUCCESS). Shader address 0x5a9569a8
Shell Process 
'01.hello'OGLES2_glShaderSourceshader 387count 1string 0x597b14a0 length 0x0
Line 0
'precision mediump float;

/* Varyings */
varying vec4 vVertexColor;

void main()
{
        gl_FragColor = vVertexColor;
}
'
Shell Process '01.hello'OGLES2_glCompileShadershader 387
Shell Process 
'01.hello'W3DN_CompileShadererrCode 0x597b13a4tags 0x597b1378 ([W3DNTag_DataBuffer0x484CD018][W3DNTag_DataSize388][W3DNTag_Log0x597B13A0][W3DNTag_LogLevel0])
Shell Process '01.hello'W3DN_CompileShader: <- errCode 0 (W3DNEC_SUCCESS). Shader address 0x5a956a48
Warp3D Nova profiling results 
for Shell Process '01.hello':
  Function 
calls used 4.968742 ms0.02 of context life-time 31981.111178 ms
  Draw calls
/s 0.0
                      
function | call count |     errors |        duration (ms) |  avgcall dur. (us) |         % of 4.968742 ms |        % of CPU time
                 CompileShader 
|          |          |             4.968742 |             1242.185 |                   100.00 |                 0.02
  Primitive statistics
:
    
Nothing was drawnvertex count 0

OpenGL ES 2.0 profiling results 
for Shell Process '01.hello':
  Function 
calls used 113.412411 ms0.35 of context life-time 32099.858206 ms
  Frames
/s 0.0
                      
function | call count |     errors |        duration (ms) |  avgcall dur. (us) |       % of 113.412411 ms |        % of CPU time
                 CompileShader 
|          |          |           113.400742 |            28350.185 |                    99.99 |                 0.35
                  ShaderSource 
|          |          |             0.011669 |                2.917 |                     0.01 |                 0.00
  
*) Please note that the above time measurements include time spent inside Warp3D Nova functions
  Primitive statistics
:
    
Nothing was drawnvertex count 0
Wait 1 s before quit
...
...
waiting over
warp3dnova_free
ogles2_free
glSnoop exiting



So seems we compile there 4 shaders, 2 fragment ones and 2 time strying to compile this vertex one.


And this part make me curious wtf:

Shell Process '01.hello'GL error 1282 (GL_INVALID_OPERATIONdetected after ShaderSource
Shell Process 
'01.hello'OGLES2_glCompileShadershader 384
Shell Process 
'01.hello'W3DN_CompileShadererrCode 0x597b13a4tags 0x597b1378 ([W3DNTag_DataBuffer0x484CD018][W3DNTag_DataSize948][W3DNTag_Log0x597B13A0][W3DNTag_LogLevel0])
Shell Process '01.hello'W3DN_CompileShader: <- errCode 0 (W3DNEC_SUCCESS). Shader address 0x5a956908
Shell Process 
'01.hello'OGLES2_glShaderSourceshader 385count 1string 0x597b14a0 length 0x0


It says GL error 1282 (GL_INVALID_OPERATION) firstly, but then says that shader compiles fine ?

I do check also in whole irrlicht sources on "GLSL shader programm failed to link" and found that it come from

https://sourceforge.net/p/irrlicht/cod ... GLES2MaterialRenderer.cpp

in the LinkProgram().

So that there i stuck for now. Any ideas and help are welcome ! Thanks !

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Just can't stay away
Just can't stay away


See User information
@kas1e

Where is glCreateShader?

https://registry.khronos.org/OpenGL-Re ... html/glShaderSource.xhtml -> "GL_INVALID_OPERATION is generated if shader is not a shader object."

Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@Capehill
In the same COGLES2MaterialRenderer.cpp line 218:

https://sourceforge.net/p/irrlicht/cod ... GLES2MaterialRenderer.cpp

Intersting that i do not have error about "GLSL shader failed to compile", but only about failing to link.

I even put printf("%s\n", shader); , right before glAttachShader(Program, shaderHandle);, at the end of createShader(), and it prinfs 4 shaders fine.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Just can't stay away
Just can't stay away


See User information
@kas1e

Was glSnoop log filtered in some way? I am just wondering why there were only 2 GL calls shown.

glCreateShader can return 0 on error (line 222) so this should be checked: https://sourceforge.net/p/irrlicht/cod ... MaterialRenderer.cpp#l222

Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@Capehill

Yeah, it was filters on shaders call only, there is full non-filtered log (2.5mb of size):

https://kas1e.mikendezign.com/aos4/irr ... whole_irrlicht_ogles2.txt

And there is the simple test case which you may try yourself too:

https://kas1e.mikendezign.com/aos4/irr ... _ogles2_irrlicht_test.lha

You can see that for first after 3 failed attempt to link it crash in nova, then ignore DSI helps, and another 3 failed link. All the shaders used by ogles2 renderer in media/shaders/.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Just can't stay away
Just can't stay away


See User information
Okay, full log shows that shader pipeline creation failed:

Quote:

Shell Process '01.HelloWorld': OGLES2_glLinkProgram: program 273
Shell Process '01.HelloWorld': W3DN_CreateShaderPipeline: errCode 0x618ec698, tags 0x618ec678 ([W3DNTag_Offset: 0x601C92C8][W3DNTag_Offset: 0x601C9368])
W3DN_GCN.library (0): Previous pipeline stage's (null) output is incompatible with the fragment shader's input of the same name
Shell Process '01.HelloWorld': W3DN_CreateShaderPipeline: <- errCode 18 (W3DNEC_SHADERSINCOMPATIBLE). Shader pipeline address 0x0
Shell Process '01.HelloWorld': Warning: NULL pointer detected
Shell Process '01.HelloWorld': Warning: unsuccessful operation detected
Shell Process '01.HelloWorld': GL error 1282 (GL_INVALID_OPERATION) detected after LinkProgram


So, we need to investigate related shaders.

Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@Capehill
Not that i understand error well .. Did it mean that some shaders cant be compiled ? Or they are, just fail to link ?

Or, they still can't compiles, just in this part Irrliht didn't have proper checking on return code ?

For now i will try to glslanvalidator/w3dshaderinfo on all of them, to see which ones can't compiles.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@Capehill

Checked all the shaders coming with Irrliht, and that the results we have:

COGLES2DetailMap.fsh                    OK
COGLES2LightmapAdd
.fsh                    OK
COGLES2LightmapModulate
.fsh-            - OK
COGLES2OneTextureBlend
.fsh                OK
COGLES2Renderer2D
.fsh                    OK
COGLES2Renderer2D
.vsh                    OK
COGLES2Renderer2D_noTex
.fsh                OK
COGLES2TransparentAlphaChannel
.fsh        OK
COGLES2TransparentAlphaChannelRef
.fsh    OK
COGLES2TransparentVertexAlpha
.fsh        OK

COGLES2SphereMap
.fsh        OK
COGLES2SphereMap
.vsh
                            DRIVER ERROR
uLightCount's offset was: 116 via ShaderGetObjectInfoTags(), but 632 via ShaderGetOffset().
                            DRIVER ERROR: uWVMatrix'
s offset was120 via ShaderGetObjectInfoTags(), but 636 via ShaderGetOffset().
                            
DRIVER ERRORuNMatrix's offset was: 184 via ShaderGetObjectInfoTags(), but 764 via ShaderGetOffset().
                            DRIVER ERROR: uWVPMatrix'
s offset was248 via ShaderGetObjectInfoTags(), but 892 via ShaderGetOffset().
                            
DRIVER ERRORuLightAttenuation's offset was: 312 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uLightPosition'
s offset was408 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightSpecular's offset was: 504 via ShaderGetObjectInfoTags(), but 1622576820 via ShaderGetOffset().
                            DRIVER ERROR: uMaterialShininess'
s offset was632 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightDiffuse's offset was: 636 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uLightAmbient'
s offset was764 via ShaderGetObjectInfoTags(), but 1597163844 via ShaderGetOffset().
                            
DRIVER ERRORuLightDirection's offset was: 892 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
 
 
COGLES2Solid.fsh            - OK
COGLES2Solid.vsh
                            DRIVER ERROR: uLightCount'
s offset was116 via ShaderGetObjectInfoTags(), but 568 via ShaderGetOffset().
                            
DRIVER ERRORuWVMatrix's offset was: 120 via ShaderGetObjectInfoTags(), but 696 via ShaderGetOffset().
                            DRIVER ERROR: uTMatrix0'
s offset was184 via ShaderGetObjectInfoTags(), but 700 via ShaderGetOffset().
                            
DRIVER ERRORuNMatrix's offset was: 248 via ShaderGetObjectInfoTags(), but 828 via ShaderGetOffset().
                            DRIVER ERROR: uWVPMatrix'
s offset was312 via ShaderGetObjectInfoTags(), but 956 via ShaderGetOffset().
                            
DRIVER ERRORuLightAttenuation's offset was: 376 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uLightPosition'
s offset was472 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightSpecular's offset was: 568 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uMaterialShininess'
s offset was696 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightDiffuse's offset was: 700 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uLightAmbient'
s offset was828 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightDirection's offset was: 956 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().

COGLES2Solud2.vsh

                            DRIVER ERROR: uLightCount'
s offset was176 via ShaderGetObjectInfoTags(), but 536 via ShaderGetOffset().
                            
DRIVER ERRORuWVMatrix's offset was: 180 via ShaderGetObjectInfoTags(), but 632 via ShaderGetOffset().
                            DRIVER ERROR: uTMatrix1'
s offset was244 via ShaderGetObjectInfoTags(), but 760 via ShaderGetOffset().
                            
DRIVER ERRORuNMatrix's offset was: 308 via ShaderGetObjectInfoTags(), but 764 via ShaderGetOffset().
                            DRIVER ERROR: uThickness'
s offset was372 via ShaderGetObjectInfoTags(), but 892 via ShaderGetOffset().
                            
DRIVER ERRORuWVPMatrix's offset was: 376 via ShaderGetObjectInfoTags(), but 1020 via ShaderGetOffset().
                            DRIVER ERROR: uLightAttenuation'
s offset was440 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightPosition's offset was: 536 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uLightSpecular'
s offset was632 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuMaterialShininess's offset was: 760 via ShaderGetObjectInfoTags(), but 1620725244 via ShaderGetOffset().
                            DRIVER ERROR: uLightDiffuse'
s offset was764 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightAmbient's offset was: 892 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uLightDirection'
s offset was1020 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().

 

COGLES2Reflection2Layer.fsh OK
COGLES2Reflection2Layer
.vsh 

                            
DRIVER ERRORuLightCount's offset was: 116 via ShaderGetObjectInfoTags(), but 568 via ShaderGetOffset().
                            DRIVER ERROR: uWVMatrix'
s offset was120 via ShaderGetObjectInfoTags(), but 696 via ShaderGetOffset().
                            
DRIVER ERRORuTMatrix0's offset was: 184 via ShaderGetObjectInfoTags(), but 700 via ShaderGetOffset().
                            DRIVER ERROR: uNMatrix'
s offset was248 via ShaderGetObjectInfoTags(), but 828 via ShaderGetOffset().
                            
DRIVER ERRORuWVPMatrix's offset was: 312 via ShaderGetObjectInfoTags(), but 956 via ShaderGetOffset().
                            DRIVER ERROR: uLightAttenuation'
s offset was376 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightPosition's offset was: 472 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uLightSpecular'
s offset was568 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuMaterialShininess's offset was: 696 via ShaderGetObjectInfoTags(), but 1623859200 via ShaderGetOffset().
                            DRIVER ERROR: uLightDiffuse'
s offset was700 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            
DRIVER ERRORuLightAmbient's offset was: 828 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
                            DRIVER ERROR: uLightDirection'
s offset was956 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().
 
 
COGLES2NormalMap.fsh        DRIVER ERRORvLightColor's offset was: 3 via ShaderGetObjectInfoTags(), but 4 via ShaderGetOffset().
COGLES2NormalMap.vsh        
                            DRIVER ERROR: vLightColor'
s offset was2 via ShaderGetObjectInfoTags(), but 4 via ShaderGetOffset().
                            
DRIVER ERRORvFogCoord's offset was: 3 via ShaderGetObjectInfoTags(), but 5 via ShaderGetOffset().
                            DRIVER ERROR: uLightColor'
s offset was88 via ShaderGetObjectInfoTags(), but 120 via ShaderGetOffset().
                            
DRIVER ERRORuWVMatrix's offset was: 120 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().

COGLES2ParallaxMap.fsh        DRIVER ERROR: vLightColor'
s offset was4 via ShaderGetObjectInfoTags(), but 5 via ShaderGetOffset().
COGLES2ParallaxMap.vsh    
                            DRIVER ERROR
vLightColor's offset was: 3 via ShaderGetObjectInfoTags(), but 4 via ShaderGetOffset().
                            DRIVER ERROR: vFogCoord'
s offset was4 via ShaderGetObjectInfoTags(), but 6 via ShaderGetOffset().
                            
DRIVER ERRORuLightColor's offset was: 100 via ShaderGetObjectInfoTags(), but 132 via ShaderGetOffset().
                            DRIVER ERROR: uWVMatrix'
s offset was132 via ShaderGetObjectInfoTags(), but 0 via ShaderGetOffset().


So, we can't compile 8 shaders , all of which share the same issue different values used via ShaderGetObjectInfoTags() and via ShaderGetOffset().

Have a clue wtf ?:) I checked shaders itself, and seems that all errors about coming from uniforms, be it ones whih mat4 , or which have arrays like [MAX_LIGHTS], or ones which even pure "uniform int uLightCount". But maybe some of them is just sideeffect of previous uniform errors..



Also interseting, if they can't compiles, why we do not have those errors from Irrlicht, but only on Linking ? Maybe because OGLES2 do compile them fine to spirv, but it's then spirv which fails, maybe that the reasson why irrlicht didn't throw an error before linking. Or maybe irrliht need more checks inside ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@Capehill
Ok so simple test case with arrays fail easy under nova:

varying vec3 vLightVector[2];
varying vec4 vLightColor[2];

void main()
{
     
gl_FragColor vec4(0.00.00.00.0);
}


And this one already have DRIVER ERROR about vLightColor's offset was: 1 via ShaderGetObjectInfoTags(), but 2 via ShaderGetOffset().

I do not remember, don't we have support for arrays already in Nova ? I know we do miss support of arrays in structs, etc, but are we in troubles with _any_ arrays ?

Anyway, is there any easy was how we can get rid of arrays in shaders to make them works as expected just without arrays ?:)

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Just can't stay away
Just can't stay away


See User information
@kas1e

Interesting bug. After some testing (glslangvalidator + Nova only), it seems to me that the minimum condition for crashing W3DN_CreateShaderPipeline is to define 2 "out" arrays of size 2 in vertex shader and similarly 2 "in" arrays of size 2 in fragment shader, like

out vec2 foo[2];
out vec2 bar[2];

and

in vec2 foo[2];
in vec2 bar[2];

Removing the other array, or using size 1 doesn't seem to crash. I suppose we need Hans here.

Quote:

is there any easy was how we can get rid of arrays in shaders to make them works as expected just without arrays


You can unroll the light loops and use separate variables as a workaround.

Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@Capehill

Btw, remain Irrlicht's author says that OGLES2 support in Irrlicht mean to have those shaders all the time used, because they simulate the old fixed function pipeline - bit horrible, but allows to have old Irrlicht code mostly work on ES2 without changes.

So basically OGLES2 there is also emulate the fixing pipeline, so that to be seen if this faster than GL4ES or not (which also emulate fixed pipeline). But at least we can see if removing of GL4ES giving any perfomance boost or not.

But we firstly need to fix shaders..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@kas1e

Looks like there's a bug in ShaderGetObjectInfoTags(). ShaderGetOffset() is returning the correct value. Please submit a bug report, and I'll fix it when I get a chance.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@Hans,Capehill

Done :
http://www.amiga.org/developer/bugreports/view.php?id=918

@Capehill

Quote:

glCreateShader can return 0 on error (line 222) so this should be checked


I asked them to add error checking there for both glCreateShader() and glCompileShader(), so to have proper error instead of "GLSL shader programm failed to link"


Edited by kas1e on 2022/9/24 9:42:48
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Not too shy to talk
Not too shy to talk


See User information
@kas1eQuote:

how can i get a user on mantis? any idea? i tried so severeal weeks ago.
i tried to create one (userid + password) but cannot log in.

I retry to create a user and it tells me that my email address is in use.
ok - so i tried the "forget password" thing - but that does not send my any email...

i also contracted the admin. and also did not receive an answer.

any idea?

thanks and regards
michael

Go to top
Re: Irrlicht Engine 1.9 for OpenGLES2 : in progress
Home away from home
Home away from home


See User information
@Michael
Quote:

how can i get a user on mantis? any idea? i tried so severeal weeks ago.

Imho you need to wrote to Mattew about

@Capehill
Good news, Hans fixed this bug, so i tested in with new beta of nova: all shaders from ogles2 version of Irrlicht compiles fine now and my small test case too. So, will continue now to works on.


Edited by kas1e on 2022/10/27 14:31:16
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project