Pixel format problems with SDL 1.3

Hello,

I am beggining to test the latest SDL 1.3 SVN version. The test
programs using blits (testsprite, testsprite2, testalpha…) are
not working for me. I suppose that is some problem with the pixel
format of my screen:

  • testsprite2 fails with the message “Couldn’t create texture:
    Compatible pixel format can’t be found”. Debugging the code, it
    seems that SDL uses SDL_PIXELFORMAT_ARGB8888, but later it
    can’t continue.

  • testsprite and testalpha show incorrect blittings, maybe
    because they choose a bad pixel format.See it at
    http://img141.imageshack.us/i/testsprite.jpg/

  • testsprite and testalpha work correctly with SDL 1.2.

This is the output of testvidcard on SDL 1.2 and SDL 1.3:

Video driver: x11
Current display: 1400x1050, 32 bits-per-pixel
Red Mask = 0x00ff0000
Green Mask = 0x0000ff00
Blue Mask = 0x000000ff
Fullscreen video modes:
1400x1050x32
1280x800x32
1280x768x32
1024x768x32
800x600x32
640x480x32
A window manager is available

Built-in video drivers: x11, dummy
Video driver: x11
Number of displays: 1
Display 0:
Current mode: 1400x1050 at 0Hz, 24 bits-per-pixel
Red Mask = 0x00ff0000
Green Mask = 0x0000ff00
Blue Mask = 0x000000ff
Fullscreen video modes:
Mode 0: 1400x1050 at 0Hz, 24 bits-per-pixel
Red Mask = 0x00ff0000
Green Mask = 0x0000ff00
Blue Mask = 0x000000ff
Current resolution: 1400x1050

More info from xdpyinfo:

name of display: :0.0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 10402000
X.Org version: 1.4.2
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 7
supported pixmap formats:
depth 1, bits_per_pixel 1, scanline_pad 32
depth 4, bits_per_pixel 8, scanline_pad 32
depth 8, bits_per_pixel 8, scanline_pad 32
depth 15, bits_per_pixel 16, scanline_pad 32
depth 16, bits_per_pixel 16, scanline_pad 32
depth 24, bits_per_pixel 32, scanline_pad 32
depth 32, bits_per_pixel 32, scanline_pad 32

…and from testgl:

Screen BPP: 16

Vendor : Tungsten Graphics, Inc.
Renderer : Mesa DRI Radeon 20061018 AGP 4x x86/MMX/SSE2 TCL
Version : 1.3 Mesa 7.0.4

Should I submit a bug report about this?

Regards,

Alberto

Hello, Alberto!

AL> I am beggining to test the latest SDL 1.3 SVN version. The test
AL> programs using blits (testsprite, testsprite2, testalpha…) are
AL> not working for me. I suppose that is some problem with the pixel
AL> format of my screen:

AL> * testsprite2 fails with the message “Couldn’t create texture:
AL> Compatible pixel format can’t be found”. Debugging the code, it
AL> seems that SDL uses SDL_PIXELFORMAT_ARGB8888, but later it
AL> can’t continue.

This error is generated by my latest changes, could you post
"testsprite2 --info all" output, it can say a much more.

With best regards, Mike Gorchak. E-mail: @Mike_Gorchak

Thank you very much for your help, Mike. This is the output of the program:

Built-in video drivers: x11, dummy
Video driver: x11
Number of displays: 1
Display 0:
Current mode: 1400x1050 at 0Hz, 24 bits-per-pixel (SDL_PIXELFORMAT_RGB888)
Red Mask = 0x00ff0000
Green Mask = 0x0000ff00
Blue Mask = 0x000000ff
Fullscreen video modes:
Mode 0: 1400x1050 at 0Hz, 24 bits-per-pixel (SDL_PIXELFORMAT_RGB888)
Red Mask = 0x00ff0000
Green Mask = 0x0000ff00
Blue Mask = 0x000000ff
Built-in render drivers:
Renderer x11:
Flags: 0x0000005F (SingleBuffer | PresentCopy | PresentFlip2 | PresentFlip3 | PresentDiscard | Accelerated)
Blend: 0x00000000 ()
Scale: 0x00000000 ()
Texture formats (6): RGB888, YV12, IYUV, YUY2, UYVY, YVYU
Renderer opengl:
Flags: 0x00000071 (SingleBuffer | PresentDiscard | PresentVSync | Accelerated)
Blend: 0x0000000F (Mask | Blend | Add | Mod)
Scale: 0x00000003 (Fast | Slow)
Texture formats (15): Index1LSB, Index1MSB, Index8, RGB332, RGB444, RGB555, ARGB4444, ARGB1555, RGB565, RGB24, BGR24, RGB888, BGR888, ARGB8888, ABGR8888
Renderer software:
Flags: 0x0000003F (SingleBuffer | PresentCopy | PresentFlip2 | PresentFlip3 | PresentDiscard | PresentVSync)
Blend: 0x0000000F (Mask | Blend | Add | Mod)
Scale: 0x00000001 (Fast)
Texture formats (14): Index8, RGB555, RGB565, RGB888, BGR888, ARGB8888, RGBA8888, ABGR8888, BGRA8888, YV12, IYUV, YUY2, UYVY, YVYU
Current renderer:
Renderer x11:
Flags: 0x00000042 (PresentCopy | Accelerated)
Blend: 0x00000000 ()
Scale: 0x00000000 ()
Texture formats (6): RGB888, YV12, IYUV, YUY2, UYVY, YVYU
Couldn’t create texture: Compatible pixel format can’t be found

Regards,

Alberto----- Mensaje original -----
De: “Mike Gorchak”
Para: sdl at libsdl.org
Enviados: Martes, 30 de Junio 2009 13:49:52 GMT +01:00 Amsterdam / Berl?n / Berna / Roma / Estocolmo / Viena
Asunto: Re: [SDL] Pixel format problems with SDL 1.3

Hello, Alberto!

AL> I am beggining to test the latest SDL 1.3 SVN version. The test
AL> programs using blits (testsprite, testsprite2, testalpha…) are
AL> not working for me. I suppose that is some problem with the pixel
AL> format of my screen:

AL> * testsprite2 fails with the message “Couldn’t create texture:
AL> Compatible pixel format can’t be found”. Debugging the code, it
AL> seems that SDL uses SDL_PIXELFORMAT_ARGB8888, but later it
AL> can’t continue.

This error is generated by my latest changes, could you post
"testsprite2 --info all" output, it can say a much more.

With best regards, Mike Gorchak.

Hey,

I have the same problem, so here is my output, under Ubuntu Netbook Remic 9.04, on an Acer AspireOne AOA150.

$ ./testsprite2 --renderer opengl
get fences failed: -1
param: 6, val: 0
211.56 frames per second

OpenGL works properly

$ ./testsprite2
Couldn’t create texture: Compatible pixel format can’t be found

$ ./testsprite2 --info all
Built-in video drivers: x11, dummy
Video driver: x11
Number of displays: 1
Display 0:
Current mode: 1024x600 at 0Hz, 24 bits-per-pixel (SDL_PIXELFORMAT_RGB888)
Red Mask = 0x00ff0000
Green Mask = 0x0000ff00
Blue Mask = 0x000000ff
Fullscreen video modes:
Mode 0: 1024x600 at 0Hz, 24 bits-per-pixel (SDL_PIXELFORMAT_RGB888)
Red Mask = 0x00ff0000
Green Mask = 0x0000ff00
Blue Mask = 0x000000ff
Built-in render drivers:
Renderer x11:
Flags: 0x0000005F (SingleBuffer | PresentCopy | PresentFlip2 | PresentFlip3 | PresentDiscard | Accelerated)
Blend: 0x00000000 ()
Scale: 0x00000000 ()
Texture formats (6): RGB888, YV12, IYUV, YUY2, UYVY, YVYU
Renderer opengl:
Flags: 0x00000071 (SingleBuffer | PresentDiscard | PresentVSync | Accelerated)
Blend: 0x0000000F (Mask | Blend | Add | Mod)
Scale: 0x00000003 (Fast | Slow)
Texture formats (15): Index1LSB, Index1MSB, Index8, RGB332, RGB444, RGB555, ARGB4444, ARGB1555, RGB565, RGB24, BGR24, RGB888, BGR888, ARGB8888, ABGR8888
Renderer software:
Flags: 0x0000003F (SingleBuffer | PresentCopy | PresentFlip2 | PresentFlip3 | PresentDiscard | PresentVSync)
Blend: 0x0000000F (Mask | Blend | Add | Mod)
Scale: 0x00000001 (Fast)
Texture formats (14): Index8, RGB555, RGB565, RGB888, BGR888, ARGB8888, RGBA8888, ABGR8888, BGRA8888, YV12, IYUV, YUY2, UYVY, YVYU
Current renderer:
Renderer x11:
Flags: 0x00000042 (PresentCopy | Accelerated)
Blend: 0x00000000 ()
Scale: 0x00000000 ()
Texture formats (6): RGB888, YV12, IYUV, YUY2, UYVY, YVYU
Couldn’t create texture: Compatible pixel format can’t be found

Let me know if you need anything else,
Pat> ----- Original Message -----

From: Mike Gorchak
To: sdl at libsdl.org
Sent: Tuesday, June 30, 2009 6:49:52 AM
Subject: Re: [SDL] Pixel format problems with SDL 1.3

Hello, Alberto!

AL> I am beggining to test the latest SDL 1.3 SVN version. The test
AL> programs using blits (testsprite, testsprite2, testalpha…) are
AL> not working for me. I suppose that is some problem with the pixel
AL> format of my screen:

AL> * testsprite2 fails with the message “Couldn’t create texture:
AL> Compatible pixel format can’t be found”. Debugging the code, it
AL> seems that SDL uses SDL_PIXELFORMAT_ARGB8888, but later it
AL> can’t continue.

This error is generated by my latest changes, could you post
"testsprite2 --info all" output, it can say a much more.

With best regards, Mike Gorchak. E-mail: lestat at i.com.ua


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello, Patryk!

PB> Built-in render drivers:
PB> Renderer x11:
PB> Flags: 0x0000005F (SingleBuffer | PresentCopy | PresentFlip2 |
PB> PresentFlip3 | PresentDiscard | Accelerated)
PB> Blend: 0x00000000 ()
PB> Scale: 0x00000000 ()
PB> Texture formats (6): RGB888, YV12, IYUV, YUY2, UYVY, YVYU

The problem in the supported texture formats, you have no any of "alpha"
formats, and testsprite2 requires texture format with alpha to run properly.
Before my patch, the old code just tried to setup RGBA8888 texture format
only… but my new code searches any suitable texture format with given
requirements, but you haven’t any of required texture formats.

With best regards, Mike Gorchak. E-mail: mike at malva.ua

Hello, Alberto!

ALF> Thank you very much for your help, Mike. This is the output of the
program: Built-in
ALF> video drivers: x11, dummy Video driver: x11

Looks like it is the same problem as I described in my reply to Patryk.

With best regards, Mike Gorchak. E-mail: mike at malva.ua

Hey Mike,

do you know how I can enable Alpha textures in X11?

I have tried the software renderer and it also works, although at 45 FPS and it doesn’t seem to work properly. There is a black stripe on about a 1/4 of the window, and the right side in the background.

OpenGL works perfectly, as it has the proper texture support.

Thanks,
Pat> ----- Original Message -----

From: Mike Gorchak
To: sdl at libsdl.org
Sent: Tuesday, June 30, 2009 11:10:17 AM
Subject: Re: [SDL] Pixel format problems with SDL 1.3

Hello, Patryk!

PB> Built-in render drivers:
PB> Renderer x11:
PB> Flags: 0x0000005F (SingleBuffer | PresentCopy | PresentFlip2 |
PB> PresentFlip3 | PresentDiscard | Accelerated)
PB> Blend: 0x00000000 ()
PB> Scale: 0x00000000 ()
PB> Texture formats (6): RGB888, YV12, IYUV, YUY2, UYVY, YVYU

The problem in the supported texture formats, you have no any of "alpha"
formats, and testsprite2 requires texture format with alpha to run properly.
Before my patch, the old code just tried to setup RGBA8888 texture format
only… but my new code searches any suitable texture format with given
requirements, but you haven’t any of required texture formats.

With best regards, Mike Gorchak. E-mail: mike at malva.ua


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

do you know how I can enable Alpha textures in X11?

Core X11 doesn’t have alpha of any kind, for anything, so you need to
go to software rendering for that, as you found out. Xrender support
adds that, so that’s why some of us are pretty excited about that
(although on a few video cards still, this just means that the X
server gets to do the software rendering instead of SDL, which is no
faster).

I have tried the software renderer and it also works, although at 45 FPS and it doesn’t seem to work properly. There is a black stripe on about a 1/4 of the window, and the right side in the background.

It should work properly, though…On Tue, Jun 30, 2009 at 12:41 PM, Patryk Bratkowski wrote:


This is what it looks like:
http://img39.imageshack.us/img39/3635/softrendbug.png

Part of the window is black, and the sprites that travel diagonally leave a trail.> ----- Original Message -----

From: Pierre Phaneuf
To: A list for developers using the SDL library. (includes SDL-announce)
Sent: Tuesday, June 30, 2009 11:49:21 AM
Subject: Re: [SDL] Pixel format problems with SDL 1.3

On Tue, Jun 30, 2009 at 12:41 PM, Patryk Bratkowskiwrote:

do you know how I can enable Alpha textures in X11?

Core X11 doesn’t have alpha of any kind, for anything, so you need to
go to software rendering for that, as you found out. Xrender support
adds that, so that’s why some of us are pretty excited about that
(although on a few video cards still, this just means that the X
server gets to do the software rendering instead of SDL, which is no
faster).

I have tried the software renderer and it also works, although at 45 FPS and
it doesn’t seem to work properly. There is a black stripe on about a 1/4 of the
window, and the right side in the background.

It should work properly, though…


http://www.google.com/profiles/pphaneuf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello, Patryk!

PB> do you know how I can enable Alpha textures in X11?

Sorry, but I’m not familiar with X11…

PB> I have tried the software renderer and it also works, although at 45
PB> FPS and it doesn’t seem to work properly. There is a black stripe on
PB> about a 1/4 of the window, and the right side in the background.

Seems to be a real bug, please fill a bugreport.

With best regards, Mike Gorchak. E-mail: mike at malva.ua

Hello Mike,

El Martes 30 Junio 2009ES 18:11:13 Mike Gorchak escribi?:

Hello, Alberto!

ALF> Thank you very much for your help, Mike. This is the output of the
program: Built-in
ALF> video drivers: x11, dummy Video driver: x11

Looks like it is the same problem as I described in my reply to Patryk.

Yes, I agree. I didn’t know that you could use other renderers in the
commandline. “software” and “opengl” renderers work well.

I think there is hovewer another unrelated issue, because I also have the same
problem as Patryk when using the software renderer: that black quarter of
screen.

Patryk, can you run testsprite and tell if you see the same thing as I posted
first? http://img141.imageshack.us/i/testsprite.jpg/ Then we could file a bug
report for this.

Regards,

Alberto