Accelerate Kindle Fire and Texture Damage at 60 frames per second

This is apparently a problem with the Fire-specific GPU, and I will be grateful for any help or suggestions.

For the most part, my tower defense game is capable of launching 60 frames per second, even with dozens of enemies and towers of all firing in each direction. However, in seemingly random times (even though nothing happens - for example, sitting in the main menu), very evenly spaced 400 ฮผs pauses pause the game at intervals of about 2-3 seconds. Then, the nuts suddenly disappear, and 16x16 pixel texture blocks will randomly display.

These two glitches seem mutually exclusive, and, as I already said, this can be caused simply by the start of the game and the transition from the main menu to the level selection screen, where minimal resources are loaded and a little logic of the game occurs. I use OpenSL for sound effects, and I noticed that disabling sfx changed the autofocus duration to 280 ms.

Then I manually forced the frame rate from 60 frames per second to 30 frames per second (by inserting sleep into the frame cycle loop), and both glitches completely disappeared.

Here is a screen caption showing the texture, not the rendering. This error occurs on all 32-bit rendering surfaces, regardless of the depth / stencil values โ€‹โ€‹and whether color backlighting is turned on.

Thanks!

EDIT: Actually, the flicker of the texture appears to occur at any frame rate, however, somewhere between 40 and 45 frames per second, the 400-meter auto-stop leaves.

level select screen

main menu

+6
source share
1 answer

Well, this is a very subtle driver error, which is not necessarily specific to the Kindle Fire. I hope to help someone avoid this pain in the future. I have clearly stated the symptoms, but the source of the error comes from installing scissor rect.

In fact, we have many animated user interface elements that zoom in and out of the screen, so we get pretty scared with scissor rect. The trigger, apparently, adjusts the scissor rectangle behind the frame, and then displays it out of the horizontal line. This leads to the fact that the graphics processor is in some thin screwed state, which does not seem to appear immediately, but gradually worsens.

In addition, this, apparently, corrected the error that the Droid RAZR had, which has a graphics processor in conjunction with Fire. An error in the 5 second freeze in the game, where we will see in logcat:

W/SharedBufferStack(14208): waitForCondition(LockCondition) timed out (identity=173, status=0). CPU may be pegged. trying again. 

Obviously, these types of errors are difficult to track and accurately determine the exact conditions, but this is definitely related to visualization outside the out-of-second scissor rects.

+2
source

Source: https://habr.com/ru/post/916963/


All Articles