blitFromMemory problem on iPhone

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
jsding
Greenskin
Posts: 105
Joined: Tue Dec 14, 2010 9:46 am
x 1

blitFromMemory problem on iPhone

Post by jsding »

Hi,

I try update part of my texture with the following code:

Code: Select all

Ogre::Box box(dstl, dstt, dstr, dstb);
Ogre::PixelBox srcBox = dstPixelBox.getSubVolume(box);
texture->getBuffer()->blitFromMemory(srcBox, box);
This works well on Windows, but crash with

Code: Select all

Unsupported texture format
the crash code is in OgreGLESHardwarePixelBuffer.cpp

Code: Select all

if(data.getWidth() != data.rowPitch)
            {
                // TODO
                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
                            "Unsupported texture format",
                            "GLESTextureBuffer::upload");
            }

            if(data.getHeight()*data.getWidth() != data.slicePitch)
            {
                // TODO
                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
                            "Unsupported texture format",
                            "GLESTextureBuffer::upload");
            }
on iPhone

Is this a bug or GLES limitation?

Thanks.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: blitFromMemory problem on iPhone

Post by masterfalcon »

What format is the texture? What are the dimensions, etc. Which of the two exceptions is it hitting?
jsding
Greenskin
Posts: 105
Joined: Tue Dec 14, 2010 9:46 am
x 1

Re: blitFromMemory problem on iPhone

Post by jsding »

Hi, masterfalcon,

The box: (left, top, right, bottom) is (610, 142, 802, 229)
the texture size is (2048, 1024)

the texture format is PF_A8R8G8B8

and the data.getWidth() == 192
data.rowPitch == 2048

Code: Select all

            if(data.getWidth() != data.rowPitch)
            {
                // TODO
                OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
                            "Unsupported texture format",
                            "GLESTextureBuffer::upload");
            }
hitting.

Thanks for your help
masterfalcon wrote:What format is the texture? What are the dimensions, etc. Which of the two exceptions is it hitting?
Last edited by jsding on Thu Jul 05, 2012 9:01 am, edited 1 time in total.
jsding
Greenskin
Posts: 105
Joined: Tue Dec 14, 2010 9:46 am
x 1

Re: blitFromMemory problem on iPhone

Post by jsding »

BTW: blitFromMemory the whole texture pixelbox works well.
jsding
Greenskin
Posts: 105
Joined: Tue Dec 14, 2010 9:46 am
x 1

Re: blitFromMemory problem on iPhone

Post by jsding »

If I comment the first check, the second will hitting.
jsding
Greenskin
Posts: 105
Joined: Tue Dec 14, 2010 9:46 am
x 1

Re: blitFromMemory problem on iPhone

Post by jsding »

Any idea?
Thanks
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: blitFromMemory problem on iPhone

Post by masterfalcon »

At the moment only blitting the entire texture is supported, the reason being that pixel packing options are more limited on GL ES. You could file a feature request on our bug tracker, this is something that would be useful.
jsding
Greenskin
Posts: 105
Joined: Tue Dec 14, 2010 9:46 am
x 1

Re: blitFromMemory problem on iPhone

Post by jsding »

Thanks, masterfalcon. This is not a big problem for me. blitting a 2048 x 2048 texture will cost about 70ms on iPhone4. that make frame rate suddenly drop.
masterfalcon wrote:At the moment only blitting the entire texture is supported, the reason being that pixel packing options are more limited on GL ES. You could file a feature request on our bug tracker, this is something that would be useful.