DX Surface memory usage

This may seem like a silly question but I want to be certain. If I create a DirectX surface, is it required to be of the same bit depth as the primary/secondary surfaces? i.e. If I have a 32-bit primary surface and I create a 16-bit surface for something or other, will it actually take up only Width*Height*16 or will DirectX force the surface secretly to become 32-bit to be compatible with the primary?

Mainly I want to know because I have a very large bitmap I'd like to store that is only 8-bit mono and I'd rather it didnt take up as much Video Mem as it would if it were put on a 32-bit surface.

Thanks

Comments

  • : This may seem like a silly question but I want to be certain. If I create a DirectX surface, is it required to be of the same bit depth as the primary/secondary surfaces? i.e. If I have a 32-bit primary surface and I create a 16-bit surface for something or other, will it actually take up only Width*Height*16 or will DirectX force the surface secretly to become 32-bit to be compatible with the primary?
    :
    : Mainly I want to know because I have a very large bitmap I'd like to store that is only 8-bit mono and I'd rather it didnt take up as much Video Mem as it would if it were put on a 32-bit surface.
    :
    : Thanks
    :

    It is *not* required. However, DirectX Blts are just memory copies with *no* color conversion. So, you *can* load it as a paletted image, but then you have to convert it on your own - or blt it and expect almost random color, and DDERR_INVALIDPARAMS here and there.

    DirectX never does *anything* secretly. But then, if it doesn't do some things, as for these you're on your own.
  • : It is *not* required. However, DirectX Blts are just memory copies with *no* color conversion. So, you *can* load it as a paletted image, but then you have to convert it on your own - or blt it and expect almost random color, and DDERR_INVALIDPARAMS here and there.
    :
    : DirectX never does *anything* secretly. But then, if it doesn't do some things, as for these you're on your own.
    :

    Thanks. By secretly I was refering to the fact that it is possible that the format you specify you desire will not actually be the format that you get. its not DX's fault, its just that if the card doest support it or whatnot, it will give you the next closest thing. Doesnt warn you though, you have to check. Thats all I meant.

    I'm not doing blits I'm using it as a 3D texture. This would be okay?

    Thanks for the reply.
  • : : It is *not* required. However, DirectX Blts are just memory copies with *no* color conversion. So, you *can* load it as a paletted image, but then you have to convert it on your own - or blt it and expect almost random color, and DDERR_INVALIDPARAMS here and there.
    : :
    : : DirectX never does *anything* secretly. But then, if it doesn't do some things, as for these you're on your own.
    : :
    :
    : Thanks. By secretly I was refering to the fact that it is possible that the format you specify you desire will not actually be the format that you get. its not DX's fault, its just that if the card doest support it or whatnot, it will give you the next closest thing. Doesnt warn you though, you have to check. Thats all I meant.
    :
    : I'm not doing blits I'm using it as a 3D texture. This would be okay?
    :
    : Thanks for the reply.

    Oh, don't worry: DirectX surface creation will just fail, in that case.
    3D textures... uhm... well, that's just the same. After all, they are Surfaces nonentheless...
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories