Bug 13324 - Alpha channel bug: transparent parts are opaque
Summary: Alpha channel bug: transparent parts are opaque
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/r200 (show other bugs)
Version: unspecified
Hardware: PowerPC Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2007-11-20 14:58 UTC by pochini
Modified: 2007-11-28 01:30 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Possible fix (1.39 KB, patch)
2007-11-27 02:35 UTC, Michel Dänzer
Details | Splinter Review

Description pochini 2007-11-20 14:58:18 UTC
This problem shows up in Scorched3D. All non-3D parts (smoke, labels, menus) are drawn with opaque black in place of transparency. It happens with Mesa 7.0.x, while 6.5.2 is fine.

Example (52K): http://www.webalice.it/g_pochini/s3d.jpg

Disabling dri fixes the problem.

I'm using:

xorg-7.3
xf86-video-ati-6.6.3
0000:00:10.0 VGA compatible controller: ATI Technologies Inc Radeon RV250 If [Radeon 9000] (rev 01)
Linux Jay 2.6.23.1 #1 SMP Thu Nov 1 18:47:52 CET 2007 ppc 7455, altivec supported PowerMac3,6 GNU/Linux

$ glxinfo 
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_OML_swap_method, GLX_SGI_swap_control, GLX_SGIS_multisample, 
    GLX_SGIX_fbconfig, GLX_SGIX_visual_select_group
client glx vendor string: SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory, 
    GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control, 
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.2
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory, 
    GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control, 
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_SGI_swap_control, 
    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
    GLX_SGIX_visual_select_group
OpenGL vendor string: Tungsten Graphics, Inc.
OpenGL renderer string: Mesa DRI R200 20060602 AGP 4x PowerPC/Altivec TCL
OpenGL version string: 1.3 Mesa 6.5.1
OpenGL extensions:
    GL_ARB_imaging, GL_ARB_multisample, GL_ARB_multitexture, 
    GL_ARB_texture_border_clamp, GL_ARB_texture_compression, 
    GL_ARB_texture_cube_map, GL_ARB_texture_env_add, 
    GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, 
    GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat, 
    GL_ARB_texture_rectangle, GL_ARB_transpose_matrix, 
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_window_pos, 
    GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, 
    GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, 
    GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_clip_volume_hint, 
    GL_EXT_compiled_vertex_array, GL_EXT_convolution, GL_EXT_copy_texture, 
    GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_histogram, 
    GL_EXT_packed_pixels, GL_EXT_polygon_offset, GL_EXT_rescale_normal, 
    GL_EXT_secondary_color, GL_EXT_separate_specular_color, 
    GL_EXT_stencil_wrap, GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D, 
    GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add, 
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias, 
    GL_EXT_texture_mirror_clamp, GL_EXT_texture_object, 
    GL_EXT_texture_rectangle, GL_EXT_vertex_array, GL_APPLE_packed_pixels, 
    GL_ATI_blend_equation_separate, GL_ATI_texture_env_combine3, 
    GL_ATI_texture_mirror_once, GL_ATI_fragment_shader, GL_IBM_rasterpos_clip, 
    GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate, 
    GL_MESA_pack_invert, GL_MESA_window_pos, GL_NV_blend_square, 
    GL_NV_light_max_exponent, GL_NV_texture_rectangle, 
    GL_NV_texgen_reflection, GL_OES_read_format, GL_SGI_color_matrix, 
    GL_SGI_color_table, GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp, 
    GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod

   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
 id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------
0x23 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x24 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0x25 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0x26 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 Slow
0x27 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x28 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0x29 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0x2a 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 Slow
0x2b 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x2c 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0x2d 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0x2e 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 Slow
0x2f 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x30 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0x31 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0x32 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 Slow
0x4c 32 tc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 Ncon
Comment 1 Roland Scheidegger 2007-11-20 16:41:12 UTC
Looks rather like a r200 dri driver bug to me.
Could you clarify which mesa version you really used? You say 6.5.2 worked but your log shows 6.5.1. There were a couple of texture format fixes / optimizations going into 6.5.2 for r200, which could be the culprit. Can't reproduce that here, might be specific to big-endian platforms.
Comment 2 pochini 2007-11-22 15:53:47 UTC
(In reply to comment #1)
> Looks rather like a r200 dri driver bug to me.
> Could you clarify which mesa version you really used? You say 6.5.2 worked but
> your log shows 6.5.1. There were a couple of texture format fixes /
> optimizations going into 6.5.2 for r200, which could be the culprit. Can't
> reproduce that here, might be specific to big-endian platforms.

You are right, I did a mess with the libraries |-6
I reinstalled Mesa and r200 and now it works somewhat better. It still doesn't render trasparency properly though. I also tried to compile with -fsigned-char (it's the first source for problems on ppc) but it didn't change anything.

If it may help, I'll try (tomorrow) to recompile removing -DPPC_ASM in the makefile, or with "make linux-dri".


The new 7.0.2 funny colors :)

http://www.webalice.it/g_pochini/game_dri.jpg
http://www.webalice.it/g_pochini/game_nodri.jpg
http://www.webalice.it/g_pochini/loading_dri.jpg
http://www.webalice.it/g_pochini/loading_nodri.jpg
http://www.webalice.it/g_pochini/glxinfo.txt
Comment 3 Michel Dänzer 2007-11-23 00:42:18 UTC
(In reply to comment #2)
> I also tried to compile with -fsigned-char (it's the first source for 
> problems on ppc) [...]

Hardly; endianness issues are much more widespread IME. Mesa certainly has never required -fsigned-char here.


> The new 7.0.2 funny colors :)
> 
> http://www.webalice.it/g_pochini/game_dri.jpg

This indeed looks like texture endianness issues, I'd start by looking at the texture format changes Roland mentioned.
Comment 4 Roland Scheidegger 2007-11-24 02:56:27 UTC
Could you run packedpixels from mesa's tests directory? If this is some issue with texture formats, it may show up there.
Comment 5 pochini 2007-11-25 07:51:50 UTC
(In reply to comment #3)
> Hardly; endianness issues are much more widespread IME. Mesa certainly
> has never required -fsigned-char here.

Many programs break because they do things like char c=fgetc(). Other miscompile in more subtle ways and without warnings (e.g. the gimp).


(In reply to comment #4)
> Could you run packedpixels from mesa's tests directory? If this is some issue
> with texture formats, it may show up there.

Sure: http://www.webalice.it/g_pochini/packedpixels.png

All UNSIGNED_INT_8_8_8_8* are wrong.
Comment 6 Roland Scheidegger 2007-11-26 18:07:39 UTC
(In reply to comment #5)
> > Could you run packedpixels from mesa's tests directory? If this is some issue
> > with texture formats, it may show up there.
> 
> Sure: http://www.webalice.it/g_pochini/packedpixels.png
> 
> All UNSIGNED_INT_8_8_8_8* are wrong.
Not quite all. Only those which cause the rgba8888 or rgba8888_rev formats to be selected (so it works with the bgra/UI_8888 combinations).
Considering the driver now doesn't seem to use the big endian table for texture format selection at all I'm not surprised... Looks like it got optimized away when the SetTexOffset hook was implemented though I don't understand quite why...
If you use mesa_7_0_1 does it work (and did you test the other 15 internalFormats? The same issue should happen with some other internalFormats probably but hopefully not additional src types/formats should be wrong)?
Comment 7 Michel Dänzer 2007-11-27 02:35:32 UTC
Created attachment 12735 [details] [review]
Possible fix

Dang, how could I miss that when reviewing the r200 SetTexOffset patch. :(

Does this patch fix it?
Comment 8 pochini 2007-11-27 12:48:35 UTC
(In reply to comment #7)
> Created an attachment (id=12735) [details]
> Possible fix
> 
> Dang, how could I miss that when reviewing the r200 SetTexOffset patch. :(
> 
> Does this patch fix it?

Yes, both packedpixels and Scorched3D work fine. Thank you !
Comment 9 Michel Dänzer 2007-11-28 01:30:17 UTC
Fix pushed to master and mesa_7_0_branch.


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.