Sprite Lag on AMD 6850

Started by Izman, November 27, 2012, 02:28:49

Previous topic - Next topic

Izman

Hello,

This is a continuation of my previous thread (http://lwjgl.org/forum/index.php/topic,4777.0.html), but I believe this is a more appropriate board and I think I've pin-pointed the issue better.

On my AMD phenom II x4 955 + AMD HD 6850 Windows 7 Home Premium 64bit machine, I've noticed a bit of lag while running a very simple moving sprite. Unlike my previous post, I've managed to re-create the issue using a very small amount of code:

Main: http://pastebin.com/kbcW30mg
Sprite: http://pastebin.com/dzmXiRDC
Player: http://pastebin.com/ikp8CA2x

To compile, make a new folder in the project directory called "game" and add the "player.png" inside it.  As a test, my "player.png" was this file:
http://www.iconki.com/icons/Emotions/Face/face-monkey.png

----------
This is pretty much 1 for 1 off of the LWJGL wiki.  Pressing the LEFT or RIGHT arrow keys moves the player, pressing V turns on/off vertical sync.

On my windows machine, moving the monkey left and right for ~30 seconds yields a 2 second lag spike, and usually happens at random.

However, on other machines (like my Mac OSX), the lag is completely gone, and even on the Windows XP bootcamp, there's no lag.

This makes me think it's a hardware issue.  My drivers on the AMD 6850 machine are updated.

Can anyone else (preferably with a 5XXX or 6XXX AMD card) confirm this? Am I just making a stupid mistake?  Some closure would be appreciated :)

Izman

Okay, so I played around with some things:

I started by removing:

GL11.glPushMatrix();
texture.bind();
GL11.glTranslatef(x, y, 0);
GL11.glPopMatrix();

from the draw() function.

I also removed polling for input.  The Sprite now moves across the screen until it hits the edges, in which it reverses the direction.

As well, through testing I couldn't find any correlation between jumps in the game's delta value and the lag I'm experiencing, which seems really odd.

Something to note is that the Mac machine is running OpenGL version 2.1, and the AMD HD 6850 is running OpenGL version 4.2.  From my knowledge, Immediate Mode was deprecated in newer versions.

--------------------------------------------------

From further simplifying my initial code, I've found that the stuttering has lessened, but hasn't disappeared entirely.  I'm starting to run out of things to remove :/

th3barri3

I have had the same problem before, Are you using the Display.Sync method?