   bytes per pixel in dx9 texture
  is there an existing method to retrieve the number of bytes per pixel of a dx9 texture?the only method i could think of is lock the texture and divide the pitch by the texture width but i don't know if thats a reliable way to do it. other than that i could write a long switch statement with all the formats. so i'm wondering what you would do.   
  Pretty sure that when you Lock a texture; you just get an array of D3DCOLOR, which are DWORDs encoded in RRGGBBAA (or AARRGGBB. Not sure at all.) format, so each pixel would be 4 bytes.   ;  actually some formats use more than one byte per channel, like 64 bit textureshere, if anyone ever needs the switch statement. i think it covers most (except D3DFMT_A1)switch(_format){case D3DFMT_S8_LOCKABLE:case D3DFMT_R3G3B2:case D3DFMT_A8:case D3DFMT_P8:case D3DFMT_L8:case D3DFMT_A4L4:return 1;break;case D3DFMT_D16_LOCKABLE:case D3DFMT_D15S1:case D3DFMT_D16:case D3DFMT_A8P8:case D3DFMT_INDEX16:case D3DFMT_R16F:case D3DFMT_G8R8_G8B8:case D3DFMT_R8G8_B8G8:case D3DFMT_L6V5U5:case D3DFMT_R5G6B5:case D3DFMT_X1R5G5B5:case D3DFMT_A1R5G5B5:case D3DFMT_A4R4G4B4:case D3DFMT_A8R3G3B2:case D3DFMT_X4R4G4B4:case D3DFMT_L16:case D3DFMT_A8L8:return 2;break;case D3DFMT_R8G8B8:return 3;break;case D3DFMT_D32:case D3DFMT_D24S8:case D3DFMT_D24FS8:case D3DFMT_D24X8:case D3DFMT_D24X4S4:case D3DFMT_D32F_LOCKABLE:case D3DFMT_INDEX32:case D3DFMT_G16R16F:case D3DFMT_R32F:case D3DFMT_X8L8V8U8:case D3DFMT_A2W10V10U10:case D3DFMT_Q8W8V8U8:case D3DFMT_V16U16:case D3DFMT_A8R8G8B8:case D3DFMT_X8R8G8B8:case D3DFMT_A2B10G10R10:case D3DFMT_A8B8G8R8:case D3DFMT_X8B8G8R8:case D3DFMT_G16R16:case D3DFMT_A2R10G10B10:return 4;break;case D3DFMT_A16B16G16R16F:case D3DFMT_G32R32F:case D3DFMT_Q16W16V16U16:case D3DFMT_A16B16G16R16:return 8;break;case D3DFMT_A32B32G32R32F:return 16;break;default://unknown formatbreak;}