Thread with 19 posts

jump to expanded post

WAIT

sdl2's opengl context sharing maybe actually works, i was just using it wrong?

oh my god 😭

i need to verify that i can actually do something useful with this, not just that sdl2 says the context was created successfully, but… 🤞🤞🤞

Open thread at this post

this is of course about touchHLE, which really needs the ability to share framebuffers between opengl contexts in some form, but which i've never been able to get working until now, so i've had to resort to incredibly horrible workarounds that'll only get worse in future

Open thread at this post

hell yeah I can share a texture between contexts!!

wait… wait why is the texture fucked up the first time it's rendered… in both contexts… what the fuck

i didn't realise the drivers were this buggy 😱

Open thread at this post
  1. first frame, drawn with first context, which creates the “GL” texture
  2. second frame, drawn with the second context, which uses the same texture
  3. third frame, drawn with the first context, same texture again
  4. fourth frame, drawn with the second context, same texture again
Open thread at this post

hmm, could this just be a bug related to GL_QUADS and not actually a problem with the shared texture? 🤔

(yes I know that's legacy, but so is my whole stack and this is a prototype in any case)

Open thread at this post

no wait lol it's my fault, I was calling glVertex() before glTexCoord() rather than after, phew

(yes I know, I'd never use glBegin()/glEnd() normally but they're extremely convenient for prototyping)

Open thread at this post

well, I prototyped it in touchHLE, and GL context sharing does work for presenting frames…

…but I have to call glFinish(), so I may as well use glReadPixels(), the thing I had been dreading…

Open thread at this post

I mean. maybe using glReadPixels() is fine. these are ancient games, surely they can finish rendering in well under 16ms…? I'm not doing major rendering after that, just compositing. OTOH I shudder at the thought of sending a 4K framebuffer from VRAM to system RAM and back…

Open thread at this post

Event handling <1ms
ARMv6 emulation 5ms
Emulation overhead 5ms
Waiting for vsync 5ms
Unavoidable OpenGL pipeline flush 15ms

someone who is good at the graphics please help me budget this. my emulator is dying

Open thread at this post

ok so my options are

  1. require opengl context sharing and introduce at least 16.67ms of latency to frame presentation
  2. use glReadPixels() and cause a pipeline flush every single frame, and potentially send a 4K framebuffer from VRAM to system RAM and back
Open thread at this post

@leftpaddotpy I think ANGLE has some support for OpenGL ES 1.x? not sure how complete it is. unfortunately ANGLE is probably a nightmare to integrate into my project because it's so huge and uses Google's weird build system. I really should try it though.

Open thread at this post