Skip to content

Conversation

ggcrunchy
Copy link
Contributor

@ggcrunchy ggcrunchy commented Mar 31, 2023

Android (and maybe web, etc.) doesn't use vertex array objects, due from what I recall to some non-conforming devices. This has frustrated some of the logic behind changing vertex formats, including when to dirty them. And these are the fixes.

The implementation was admittedly a bit gnarly, and I noticed some of it also didn't benefit from living in command land, so where possible I moved logic back into Rtt_Renderer::Insert() and friends. I was also able to eliminate two commands entirely, as well as some state that was held between commands.

I'll try to do some further sanity tests tonight, but these now seem to work well both on the Android emulator and my phone:
Solar2D4.zip,
Solar2D5.zip

--

I was told that the "don't cull / hit test" flags these depend on could impact performance (although under much heavier load), so will see about doing a little restructuring, and if successful piggyback the results in another PR I have planned.

Also, Solar by default is not loading a depth buffer (confusingly, some Android drivers will anyway). I loaded one (not included in the PR) to verify these tests, but will try to set up an opt-in approach through config.lua and submit that as well.

…tching vertex formats

Moved more of the logic into the renderer and out of the command buffer

Given that, able to drop a couple commands and some cross-command state from the command buffer (vertex offset, format dirty, vertex extra)

Refined the must-reconcile logic a bit in the renderer
@ggcrunchy ggcrunchy requested a review from Shchvova as a code owner March 31, 2023 22:13
@Shchvova Shchvova merged commit 8ee048a into coronalabs:experimental Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants