Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
79 user(s) are online (66 user(s) are browsing Forums)

Members: 1
Guests: 78

skynet, more...

Support us!

Headlines

 
  Register To Post  

OpenGL ES 2 and glDrawArrays
Just can't stay away
Just can't stay away


See User information
Trying to fix SDL2 renderer OpenGL ES 2 backend but got stuck. There are some GL errors reported during frame.

For example, when trying to render a rectangle, it seems that glDrawArrays(GL_TRIANGLE_STRIP, 0, 4) triggers GL error 1281. Code alternates between 8 VBOs and problem might be related to VBOs somehow, since after disabling (read: hacking!) VBO usage GL errors went away.

I wonder if there exists a debug build for ogles2.library that might help to sort out these problems?

Shaders compile and program links without errors.

Reference: https://github.com/AmigaPorts/SDL/tree/master/src/render/opengles2

Go to top
Re: OpenGL ES 2 and glDrawArrays
Not too shy to talk
Not too shy to talk


See User information
@Capehill
1281 is GL_INVALID_VALUE. glDrawArrays itself only issues that if the count parameter is negative. This is obviously not the case with your glDrawArrays(GL_TRIANGLE_STRIP, 0, 4).

That's why I asume that the error is set earlier, namely during VBO setup, because as you say the error goes away if you're not using VBOs.

There are multiple conditions on which GL_INVALID_VALUE can be triggered during VBO creation, e.g. a negative count in glGenBuffers, invalid size / offset when dealing with glBufferSubData. Or maybe you got a bug when calling glVertexAttribPointer during your VBO setup (invalid attrib size, invalid stride or invalid index).

Go to top
Re: OpenGL ES 2 and glDrawArrays
Just can't stay away
Just can't stay away


See User information
@Daytona675x

I'm checking errors before and after glDrawArrays: if something goes wrong in VBO setup, is it possible that error is only triggered during glDrawArrays instead of glBufferSubData, for example?

glGenBuffers should be OK. It's hard coded with 8. I also tried to call 8 times glGenBuffers with parameter 1.

Go to top
Re: OpenGL ES 2 and glDrawArrays
Home away from home
Home away from home


See User information
@Daniel
Btw, talking about debug version of ogles2.library, maybe it possible (i.e. if you have time), to create some sort of build which will printf a lot of stuff to serial ? I mean, most of necessary things, vbos, VAs, attribs , what-where, etc, etc (can be controlled via ENV's or something). So with that debug library we can do more better checks when found bugs. + that one may have also -gstabs vesion (as one you send me), so will be all in one debug vesion of library which will help to detect stuff.

If have that kind of build, i for example will have no needs to ask you about special ogles2.library build with printing VA (that what we need to go futher with that bug in fricking-shark when f4 pressed and we have 0xfffffff coming from somewhere, but not from gl4es as we test).

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: OpenGL ES 2 and glDrawArrays
Just can't stay away
Just can't stay away


See User information
@Daytona675x

Also error 1282 (GL_INVALID_OPERATION) is set during same glDrawArray() call.

- VBOs created:

https://github.com/AmigaPorts/SDL/blob ... /SDL_render_gles2.c#L2049

- position enabled:

https://github.com/AmigaPorts/SDL/blob ... /SDL_render_gles2.c#L2093

- VBO bound and data buffered: vertsize in this test is either 0 (clear command) or 32 (rectangle command) bytes:

https://github.com/AmigaPorts/SDL/blob ... /SDL_render_gles2.c#L1216

- vertex attribute pointer (stride and offset are 0):

https://github.com/AmigaPorts/SDL/blob ... /SDL_render_gles2.c#L1061

- attempt to draw:

https://github.com/AmigaPorts/SDL/blob ... /SDL_render_gles2.c#L1316


Go to top
Re: OpenGL ES 2 and glDrawArrays
Not too shy to talk
Not too shy to talk


See User information
@Capehill
Sorry, but it's easier if you simply compile an example of your stuff which is failing. Unfortunately I really don't have the time to check out your source and your information is too vague. Now we suddenly also got GL_INVALID_OPERATION. And glDrawArrays cannot even generate that However, a not bound VBO could provoke that e.g. when doing the glBuffer call (which would probably also explain everything else, including why it suddenly works if you don't use VBOs).

Please build the most minimal example you can come up with and put a download link here.

Go to top
Re: OpenGL ES 2 and glDrawArrays
Just can't stay away
Just can't stay away


See User information
@Daytona675x

Sorry about unclear report: there was a bug in error macro, it had "if" instead of "while" so I didn't see both errors at first.

There is a test SDL2 test binary now on your FTP. It runs in a loop which basically clears the background (seems to work) and then draws a smaller black rectangle (should trigger GL errors).

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