Bug 24016 - Shadowgrounds: menu fades completely black (or white)
Summary: Shadowgrounds: menu fades completely black (or white)
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL: http://demofiles.linuxgamepublishing....
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-18 06:11 UTC by Sven Arvidsson
Modified: 2011-03-01 18:39 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Backtrace from break (16.26 KB, text/plain)
2009-09-18 12:07 UTC, Sven Arvidsson
Details
Call _mesa_unpack_dudv_span_byte with the base internal format (1.23 KB, patch)
2009-09-18 15:29 UTC, Ian Romanick
Details | Splinter Review
backtrace from crash with i965 (4.37 KB, text/plain)
2009-09-21 09:21 UTC, Sven Arvidsson
Details
screenshot when software rendering is forced (29.82 KB, image/png)
2009-09-21 09:22 UTC, Sven Arvidsson
Details
proposed patch to fix the warning/problem report (679 bytes, patch)
2010-01-04 11:40 UTC, Brian Paul
Details | Splinter Review
screenshot of the menu faded to black (47.57 KB, image/png)
2010-01-04 13:42 UTC, Sven Arvidsson
Details

Description Sven Arvidsson 2009-09-18 06:11:26 UTC
The newly released demo of the game Shadowgrounds gives this error:

 Mesa 7.7-devel implementation error: bad srcFormat in extract float data
 Please report at bugzilla.freedesktop.org

The game menu isn't drawn properly, with black parts hiding a lot of the options. 

It's possible to start the game, but with the i965 driver the game segfaults (backtrace seems to indicate a problem with the game?) and with the software rasterizer the game is almost completely black (except for the HUD).


System environment:
-- chipset: G45 / ICH10R
-- system architecture: 32-bit
-- Linux distribution: Debian unstable
-- Machine or mobo model: Asus P5Q-EM
-- Display connector: DVI
-- KMS: enabled
-- xf86-video-intel: efbcf29dd1a1ca058b7a2a93f0685102c06c9369
-- xserver: 1.6.3.901
-- mesa: 5ce72c559c027ea03513ed9c0038706733b0586e
-- drm: 67e4172394a88d4922fb8d9c7c3d96ce7e02c5a6
-- kernel: 2.6.31-rc9
Comment 1 Ian Romanick 2009-09-18 11:20:55 UTC
Can you set a breakpoint at line 3715 of extract_float_rgba (in src/mesa/main/image.c).  I'd be interested to see the value of srcFormat and a backtrace.
Comment 2 Sven Arvidsson 2009-09-18 12:07:47 UTC
Created attachment 29674 [details]
Backtrace from break

Sure, I hope this is correct:

Breakpoint 1, extract_float_rgba (n=512, rgba=0xbffee83c, srcFormat=34682, 
    srcType=5121, src=0xb5f99008, swapBytes=0 '\0') at main/image.c:3717
3717	main/image.c: No such file or directory.
	in main/image.c
Comment 3 Ian Romanick 2009-09-18 15:29:06 UTC
Created attachment 29676 [details] [review]
Call _mesa_unpack_dudv_span_byte with the base internal format

I think this patch should fix the issue that you encountered.

Brian and Roland,

Could one or both of you review this patch please?
Comment 4 Sven Arvidsson 2009-09-19 05:27:19 UTC
The "implementation error" message is gone now, but the problems with the game are the same.
Comment 5 Roland Scheidegger 2009-09-20 17:56:00 UTC
(In reply to comment #3)
> Created an attachment (id=29676) [details]
> Call _mesa_unpack_dudv_span_byte with the base internal format
> 
> I think this patch should fix the issue that you encountered.
> 
> Brian and Roland,
> 
> Could one or both of you review this patch please?
This looks good to me. I'm not sure what the game is doing makes a whole lot of sense though as it's submitting unsigned byte data. I guess if it's only needing positive offsets that's ok (but wouldn't make any sense with shaders).

(In reply to comment #4)
> The "implementation error" message is gone now, but the problems with the game
> are the same.
If that's a problem related to that texture format, you could try setting the env var MESA_EXTENSION_OVERRIDE=-GL_ATI_envmap_bumpmap in this case the game should never try to use that texture format.
Comment 6 Sven Arvidsson 2009-09-21 05:14:23 UTC
(In reply to comment #5)
> If that's a problem related to that texture format, you could try setting the
> env var MESA_EXTENSION_OVERRIDE=-GL_ATI_envmap_bumpmap in this case the game
> should never try to use that texture format.

Thanks, I tried this but it makes no difference. 
Comment 7 Sven Arvidsson 2009-09-21 09:21:03 UTC
Created attachment 29719 [details]
backtrace from crash with i965

Forgot to attach this earlier, this is the backtrace from the crash which happens with the i965 driver.
Comment 8 Sven Arvidsson 2009-09-21 09:22:02 UTC
Created attachment 29720 [details]
screenshot when software rendering is forced
Comment 9 Sven Arvidsson 2010-01-04 10:14:19 UTC
The rendering errors in the menu are still there (and the warning about an implementation error) but the actual game no longer crashes and seems to be playable.

I'm using git master, a3abb9d1cc4698e45e5d794919e8c27a3d7e5908
Comment 10 Brian Paul 2010-01-04 10:28:34 UTC
Can you update your git tree and run again?  I just committed a patch that'll give more info in the "bad srcFormat" warning.

Comment 11 Sven Arvidsson 2010-01-04 11:28:36 UTC
Sure, the warning is now:

Mesa 7.8-devel implementation error: bad srcFormat GL_DU8DV8_ATI in extract float data
Comment 12 Brian Paul 2010-01-04 11:40:13 UTC
Created attachment 32441 [details] [review]
proposed patch to fix the warning/problem report

Can you try this patch?

It looks like the GL_ATI_envmap_bumpmap spec allows GL_DU8DV8_ATI as a <format> parameter to glTexImage2D.  It should probably only be allowed as an <internalFormat> parameter.  Oh well.
Comment 13 Sven Arvidsson 2010-01-04 12:17:46 UTC
The warning is gone now, thanks! 

The problems with the menu are still there though, so I guess that's an unrelated bug.
Comment 14 Brian Paul 2010-01-04 13:04:32 UTC
I've committed the patch to the 7.7 branch.

I don't know what the problem is with the menu.
Comment 15 Sven Arvidsson 2010-01-04 13:42:42 UTC
Created attachment 32445 [details]
screenshot of the menu faded to black

The menu problem seems to have somthing to do with S3TC?

With libtxc_dxtn.so the menu will slowly fade almost completely black, without it, it fades to white.

I have attached a screenshot of the menu, black and unreadable.
Comment 16 Sven Arvidsson 2010-08-09 07:39:42 UTC
I can work around the fade-to-black problem by always setting haveAlpha = GL_TRUE in encodedxtcolorblockfaster() in libtxc_dxtn, 

I have no idea how to fix this properly, but I thought it worth mentioning in case it can help somebody track it down.
Comment 17 Sven Arvidsson 2011-02-27 14:41:52 UTC
Hey cool! 

Marek's fixes in http://cgit.freedesktop.org/~cbrill/libtxc_dxtn/commit/?id=32772908bc9b759a6b285e77af96419b4c9c8feb solves this problem. Do I dare hope for a new release of libtxc_dxtn?
Comment 18 Marek Olšák 2011-03-01 18:39:15 UTC
(In reply to comment #17)
> Hey cool! 
> 
> Marek's fixes in
> http://cgit.freedesktop.org/~cbrill/libtxc_dxtn/commit/?id=32772908bc9b759a6b285e77af96419b4c9c8feb
> solves this problem. Do I dare hope for a new release of libtxc_dxtn?

I announced new libtxc_dxtn on mesa-dev. Closing..


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.