Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
25 user(s) are online (11 user(s) are browsing Forums)

Members: 1
Guests: 24

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



« 1 ... 15 16 17 (18) 19 20 21 ... 37 »


Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2223
@kas1e

Quote:
As far as i know : yes, it is fully complete, and even some functionality added from opengles3 (a little, but still).

Not quite. There are a few shader instructions/features missing still, like the uniform booleans that Raziel has hit.

Quote:
In the Warp3dnova itself missing at moment (taken from Daniel's ogles2.library readme): sample coverage, dithering, compressed textures and render-to-texture, which mean it also missing in ogles2 because of that.

Correction, render-to-texture has been in there for ages now (over a year).

@Raziel (& @kas1e)
Quote:
That would be starnge as that shader works on dozens of other platforms, just not on AmigaOS4...i highly doubt that it's an issue with the shader.

GLSLangValidator is stricter than most OpenGL implementations. As "validator" and reference compiler, it checks whether the GLSL code is fully GLSL compliant. Most OpenGL implementations relax the rules and are more tolerant of mixing code from different GLSL versions.

The shader you posted uses GLSL v1.40+ features without specifying the GLSL version. That's why GLSLangValidator is giving "not supported in this version" errors. Adding "#version 140" at the top (without the quotes) should be enough to make GLSLangValidator accept it.

That shader isn't the one giving you the "Boolean uniforms aren't supported yet" error message, though. Look for a shader that has "uniform bool" in it.

To workaround the missing uniform bool support, change the uniform bools to integers as kas1e suggested, and then you need to go through the code and cast the variable to a bool.

For example, if you had:
uniform bool someBool;

Then you'd go through the code below, replacing someBool with bool(someBool).

Boolean uniforms aren't supported yet because booleans aren't 32-bit, and will need special handling to implement.

Hans

_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Joined:
2011/6/3 12:49
Posts: 259
Hello

>boolean expression expected
I already had this error too with a boolean (converted to int) like this
if(FlatColor)
Colour=CurrentColor;
was fixed this way
if(FlatColor==1)
Colour=CurrentColor;

As kas1e said your shader is not the one that contain Bool flipY
Simply use a search tool for files containing flipY in your sources and change it from bool to int



   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2006/11/26 21:45
From a dying planet
Posts: 3632
@Hans

Quote:

Quote:

As far as i know : yes, it is fully complete, and even some functionality added from opengles3 (a little, but still).

Not quite. There are a few shader instructions/features missing still, like the uniform booleans that Raziel has hit.

Thank you for the confirmation.

Quote:

That shader isn't the one giving you the "Boolean uniforms aren't supported yet" error message, though. Look for a shader that has "uniform bool" in it.

To workaround the missing uniform bool support, change the uniform bools to integers as kas1e suggested, and then you need to go through the code and cast the variable to a bool.

For example, if you had:
uniform bool someBool;

Then you'd go through the code below, replacing someBool with bool(someBool).

I already did go through the code, but with my obvious limited (rather non-existant) coding skills, i was simply exchanging every "bool" i found with "int", which is wrong

I'll try again with your example.

Quote:

Boolean uniforms aren't supported yet because booleans aren't 32-bit, and will need special handling to implement.

Of course i know it's always pretty much impossible to give time frames, but what includes this "special handling" and how long do you think will it take to support them properly?

Thanks a lot for the feedback

_________________
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2006/11/26 21:45
From a dying planet
Posts: 3632
@thellier

I'll try that too

Thank you for the help

_________________
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2223
@Raziel

Quote:
Of course i know it's always pretty much impossible to give time frames, but what includes this "special handling" and how long do you think will it take to support them properly?

So far all shader variables are 32-bit. Booleans, are not. This complicates doing the endianness conversion when uploading the uniform variables to the GPU. From there, the GPU represents booleans as a 64-bit mask, with one bit for each thread.

No idea how long it'll take to get it working.

Hans

_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   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: 5882
@Hans
Wait, but why glslangvalidator fail in first place with Raziels example ? I mean, even if w3dnova do not support something, glslangvalidator shouldnt fail if shader is correct

_________________
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/1/26 21:48
From New Zealand
Posts: 2223
@kas1e

Because the shader isn't correct, even though many OpenGL implementations will allow it. See my previous post for details.

Hans

_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Joined:
2011/6/3 12:49
Posts: 259
@Hans
This not so important to add bool support
As we can use int as bool
As we can test bits with a AND operator
I mean slightly modifying a shader (that used bool) will allow it to works...

   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: 5882
@Hans
Yes, that whay i mean : its also shader done wrong in any case.

_________________
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:
2006/11/26 21:45
From a dying planet
Posts: 3632
@Hans

Quote:

So far all shader variables are 32-bit. Booleans, are not. This complicates doing the endianness conversion when uploading the uniform variables to the GPU. From there, the GPU represents booleans as a 64-bit mask, with one bit for each thread.


I see.

And do i understand it correctly if i assume that not all "uniforms" are boolean, but all "uniforms" are affected from this 32/64-bit conversion?

Because i tried another project and while it gives me a different error "uniform" is there again.

_________________
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2007/1/26 21:48
From New Zealand
Posts: 2223
@Raziel

Quote:
And do i understand it correctly if i assume that not all "uniforms" are boolean, but all "uniforms" are affected from this 32/64-bit conversion?

All data that's transferred to/from the GPU undergoes endianness transformation.

Quote:
Because i tried another project and while it gives me a different error "uniform" is there again.


What's the uniform variable defined as? And what error are you getting?

Hans

_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2006/11/26 21:45
From a dying planet
Posts: 3632
@Hans

Quote:

What's the uniform variable defined as? And what error are you getting?


No sure, but here is the error output

WARNINGGL ERRORGL_INVALID_VALUE on glCompileShader(handle) (backends/graphics/opengl/shader.cpp:268)!
WARNINGCould not compile shader "varying vec2 texCoord;
varying vec4 blendColor;

uniform sampler2D texture;

void main(void) {
    gl_FragColor = blendColor * texture2D(texture, texCoord);
}
"
"ERROR: 18:1: 'texture' : can't use function syntax on variable 
ERROR: 20:0: '' : compilation terminated 
ERROR: 2 compilation errors.  No code generated.

"
!
WARNINGGL ERRORGL_INVALID_VALUE on glCompileShader(handle) (backends/graphics/opengl/shader.cpp:268)!
WARNINGCould not compile shader "varying vec2 texCoord;
varying vec4 blendColor;

uniform sampler2D texture;
uniform sampler2D palette;

const float adjustFactor = 255.0 / 256.0 + 1.0 / (2.0 * 256.0);
void main(void) {
    vec4 index = texture2D(texture, texCoord);
    gl_FragColor = blendColor * texture2D(palette, vec2(index.a * adjustFactor, 0.0));
}
"
"ERROR: 20:1: 'texture' : can't use function syntax on variable 
ERROR: 20:1: '=' :  cannot convert from ' const float' to ' temp 4-component vector of float'
ERROR: 23:0: '' : compilation terminated 
ERROR: 3 compilation errors.  No code generated.

"
!
WARNINGGL ERRORGL_INVALID_ENUM on glGetUniformLocation(_programname) (backends/graphics/opengl/shader.cpp:225)!
WARNINGGL ERRORGL_INVALID_ENUM on glGetUniformLocation(_programname) (backends/graphics/opengl/shader.cpp:225)!
WARNINGGL ERRORGL_INVALID_ENUM on glGetUniformLocation(_programname) (backends/graphics/opengl/shader.cpp:225)!
WARNINGGL ERRORGL_INVALID_VALUE on glGetAttribLocation(_programname) (backends/graphics/opengl/shader.cpp:219)!
WARNINGGL ERRORGL_INVALID_VALUE on glGetAttribLocation(_programname) (backends/graphics/opengl/shader.cpp:219)!
WARNINGGL ERRORGL_INVALID_VALUE on glGetAttribLocation(_programname) (backends/graphics/opengl/shader.cpp:219)!
assertion "_vertexAttribLocation != -1" failedfile "backends/graphics/opengl/pipelines/shader.cpp"line 36

_________________
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Joined:
2011/6/3 12:49
Posts: 259
>Could not compile shader "varying vec2 texCoord;

Bad GLSL syntax for this version must be
out vec2 texCoord;

>'texture' : can't use function syntax on variable
texture seems to be a GLSL function name so rename it to (say) tex0

>cannot convert from 'const float'
very strange : I think it should works
Anyway change "const float adjustFactor" to "float adjustFactor"


   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2006/11/26 21:45
From a dying planet
Posts: 3632
@thellier

Quote:

Quote:

>Could not compile shader "varying vec2 texCoord;

Bad GLSL syntax for this version must be
out vec2 texCoord;


What does "for this version" mean?
For our version of gles2?

Thank you for the hints, will try

_________________
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Joined:
2011/6/3 12:49
Posts: 259
For example I have declared that am using this version for GLSL syntax (that is recommended one for us Amiga users):

#version 310 es

then I must use the the "in" and "out" attributes
like this

// in parameters
in layout(location = 0) vec4 gl_Vertex;
in layout(location = 1) vec3 gl_MultiTexCoord0;

// out parameters
out vec4 Colour;
out vec3 TexCoord0


   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Home away from home
Joined:
2006/11/26 21:45
From a dying planet
Posts: 3632
@thellier

I see, thank you

_________________
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
   Report Go to top

Re: GL4ES: another OpenGL over OpenGLES2 emulation - some tech. info and porting progress
Not too shy to talk
Joined:
2015/6/11 8:51
From Cologne
Posts: 303
Quote:

kas1e: "In the Warp3dnova itself missing at moment (taken from Daniel's ogles2.library readme): sample coverage, dithering, compressed textures and render-to-texture, which mean it also missing in ogles2 because of that. "

Hans: "Correction, render-to-texture has been in there for ages now (over a year)."

Sorry for this, I forgot about this readme's section... it's outdated. In the change-log there's correct information though. Of course render-to-texture exists, otherwise e.g. Spencer would have a hard time to do its shadow effects
This feature is inside Nova since version 1.37 IIRC and our OGLES2 supports it since version 1.14 (30. April 2017).

_________________
[Facebook] [YouTube Channel]
   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: 5882
@Hans,Daniel
Tested latest beta of w3d nova (1.62), where all the endian conversion of mixed datas works fine. So yeah, now, when i use daniels ogles2.library v1.22 with removed patching code he give us for tests, all looks correct.

But ! There is some really strange issue arise:

If i use warp3dnova 1.62 + public ogles2.library v1.22 (that one where patch applied), then i have in q3 let's say 100 fps in some resolution.

Now, if i put for testing ogles2.library v1.22 where patch was removed , over the same warp3dnova 1.62 , then, while everything still looks correct (so, endian conversion works from w3dnova side), q3 speed REDUCED A LOT, instead of 100fps, it give 65 !

I.e. strange thing is that when necessary conversion code have and warp3dnova and ogles2 , things is much faster, than when conversion code have only warp3dnova.

Its like .. Dunno, its like extensions stop working, while in console output i can see they found and used.

Dunno what to think, but i may think of 2 ways:

1). when patch was removed from ogles2.library for testing purposes, something else was broken

2). conversion code of warp3dnova take care of some datas sizes, while didn't about others, and patch from daniel make it faster, even when it ot top of conversion code in warp3d nova.

@Hans
For others, in terms of cube2 3 issues from 4 are fixed, thanks ! Only remain one is that OpImageSampleProjImplicitLod unimplemented.. Maybe for time being just made it as some empty stub ?

_________________
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/1/26 21:48
From New Zealand
Posts: 2223
@kas1e

Quote:
If i use warp3dnova 1.62 + public ogles2.library v1.22 (that one where patch applied), then i have in q3 let's say 100 fps in some resolution.

Now, if i put for testing ogles2.library v1.22 where patch was removed , over the same warp3dnova 1.62 , then, while everything still looks correct (so, endian conversion works from w3dnova side), q3 speed REDUCED A LOT, instead of 100fps, it give 65 !

I.e. strange thing is that when necessary conversion code have and warp3dnova and ogles2 , things is much faster, than when conversion code have only warp3dnova.

Sounds like Daniel's workaround code is more efficient than the new Warp3D Nova "complex endian convert" code. Maybe it's using the caches more efficiently, somehow. Daniel knows a thing or two about that...

EDIT: On what hardware is this? I'm converting the endianness and copying 16 KiB at a time, which I thought was small enough to fit in all of the L1 caches. No cache prefetch instructions used, unlike the functions used when copying and endianness converting a buffer with a single data size.

Quote:
Only remain one is that OpImageSampleProjImplicitLod unimplemented.. Maybe for time being just made it as some empty stub ?

Having an unimplemented stub won't help anyone because the rendered image will be wrong. I prefer that anything that's not implemented yet will trigger an error. That way we know exactly why something doesn't work.

IIRC, you can emulate the shader's textureProj() function with texture() by dividing the texture coordinates by their last element.

Hans


Edited by Hans on 2018/11/28 4:30:53
_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
   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: 5882
@Hans
Quote:

EDIT: On what hardware is this? I'm converting the endianness and copying 16 KiB at a time, which I thought was small enough to fit in all of the L1 caches. No cache prefetch instructions used, unlike the functions used when copying and endianness converting a buffer with a single data size.


That on x5k with some RadeonHD verde (250 or 250x is it).
Strange that is _that_ slow things down .. You may try that test q3 archive i send you before, as well as those ogles2.libraries (public and with removed workoround) to see how it behave on your hardware (and probabaly will be easer to debug if it need any debugging).

Probably when Daniels patch sitting on top of wap3dnova conversion code, ogles2 send already patched data to warp3dnova, so conversion code in nova skips as nothing to convert, and because of this we have same fps as in case with previous nova versions.

@Daniel
Is that test ogles2.library with removed patching code compiled as usual, and nothing else disabled ?


Edited by kas1e on 2018/11/28 9:58:19
Edited by kas1e on 2018/11/28 10:03:20
_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top


« 1 ... 15 16 17 (18) 19 20 21 ... 37 »



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project