Mon 22 Feb 2010 08:01:48 PM UTC, comment #2:
Some observations about the "totally incorrect rendering" (screen shot attached) with this patch (file #19543):
- It happens also without this patch.
- It happens with this patch even if I define LIBGL_ALWAYS_INDIRECT=1.
- It does not happen with this patch if I unload and hide the "drm" Linux kernel module.
Thus, I now think this patch is safe to apply; the bug is not in the patch but rather in Mesa or in the Linux driver for ATI Mobility Radeon HD 4570, and the patch does not make it worse.
However, I added some more assertions to DrawTexture while trying to find bugs in it, so I'm also attaching a new version (v2) of the patch.
(file #19774, file #19775)
|
Sun 24 Jan 2010 10:19:41 PM UTC, comment #1:
Here is my attempt to rewrite DrawTexture. It does fix this bug and is better commented than the original but I am not sure it doesn't cause new bugs. In particular, I've been seeing mysterious slowdowns and totally incorrect rendering at some scrolling positions. My attempts to debug that have repeatedly locked up the computer (or at least X11). I suppose this should be debugged over the network, but I don't think I'll have time for that before the next weekend, so I'm posting the patch as it is now.
(file #19543)
|
Sun 24 Jan 2010 09:35:38 PM UTC, original submission:
In https://savannah.nongnu.org/bugs/?28727 I suggest changing Bos Wars to split graphics into smaller OpenGL textures than it does now. Unfortunately, this change reveals a bug in DrawTexture. That function takes a CGraphic, which may consist of multiple OpenGL textures, and draws the specified part of it to the screen. Normally, DrawTexture should copy the pixels of the textures as they are and not stretch them. However, in some circumstances, it apparently does stretch the textures. This manifests in Bos Wars drawing the background of the map incorrectly when the map is scrolled to some positions. A typical effect is that, as you scroll the map up and down, some part of the background image remains attached to the bottom of the viewport and does not move with the map; the rest of the image then stretches to cover the viewport.
To reproduce:
- Patch InitOpenGL to set GLMaxTextureSize = 1024 if it's larger.
- Select 640x480 in the video options and enable OpenGL. Restart Bos Wars if necessary.
- Start the map editor and load bridge.map.
- Use the arrow keys to scroll from any edge of the map to the opposite one. The stretching will be plainly visible.
I have reproduced the bug with both software and hardware OpenGL rendering. Because DrawTexture is specific to OpenGL, the bug does not happen if OpenGL is disabled in the Bos Wars video options.
Debian testing, Bos Wars trunk r9623 debug, libsdl1.2debian 1.2.13-5, xserver-xorg 1:7.4+4, xserver-xorg-video-ati 1:6.12.3-1, xserver-xorg-video-radeon 1:6.12.3-1, xserver-xorg-video-radeonhd 1.2.5-1, libgl1-mesa-dri 7.6.1-1, linux-image-2.6.32-trunk-amd64 2.6.32-5, Acer Aspire 5536G, ATI Mobility Radeon HD 4570, 512 MB video memory of which 256 MB visible to CPU.
|