could CCTextureCache->addImageAsync() support ".pvr" ?

hi,
I checked the function of addImageAsync and found it only support two formats, including “Jpg” and “Png”.
“addImageAsync” could support “.pvr” format in the future ?

best regards.

Oops, it seems Minggo missed it.
PVR format is already support in early versions, at least, in addImage(…)

Sorry, #889 is created for it.
You can fix it easily before the issue is resolved.

I try to fix it but found a problem. I load “.pvr.ccz” in another thread,
and used it in main thread. I found that the CCSprite will show
nothing, and I guess the root cause is load and show in different
thread. Do you have any suggestions ?

aha, you mustn’t call gl functions in another thread, which will confused opengl state machine.
New thread beyond UI thread can only parse the picture compression format, then sync with UI thread to call opengl functions and load bitmap raw data into opengl texture memory.

ok, I see now and thank a lot :slight_smile:
I have a question about performance.
To present a pvr file, we have used to 2 steps.
step 1: uncompress pvr file
step 2: call glTexImage2D to load image to memory
my question is which one is the performance higher ?
If step 2 is main battle neck for presenting a pvr file
unfortunately, the UI thread will still stick when loading
pvr. I don’t know the situation will happen or not ?

btw,do you any plan about the resolved schedule for
the issue ?

thank you for your help,
best regard

Because on platforms other than iOS, can not create opengl context in a new thread.
Even if on iOS, can’t be 2 threads creating textures at the same time.

I think this function is used in tow ways:

  1. Loading the resources at the beginning of a game, you can show a loading scene at the same time.
  2. Loading resources when you are playing a game before changing to a new scene.

Zhe Wang wrote:

aha, you mustn’t call gl functions in another thread, which will confused opengl state machine.
New thread beyond UI thread can only parse the picture compression format, then sync with UI thread to call opengl functions and load bitmap raw data into opengl texture memory.

I’m curious that why addImageAsync is not supported for pvr or pvr.ccz format in the latest version yet. It’s really a hard work or not able to be achieved?

Jarvis Lee wrote:

I’m curious that why addImageAsync is not supported for pvr or pvr.ccz format in the latest version yet. It’s really a hard work or not able to be achieved?

I’m also curious about this.

I’m also interesting in that feature.

addImageAsync() still not support “.pvr”?

which version are u using it. I try to make a demo put in github for you . and I don not support u using pvr.ccz format if u want to cross more platform. it’ll not be parser well in some android os device.
Jarvis Lee wrote:

Zhe Wang wrote:
> aha, you mustn’t call gl functions in another thread, which will confused opengl state machine.
> New thread beyond UI thread can only parse the picture compression format, then sync with UI thread to call opengl functions and load bitmap raw data into opengl texture memory.
>
I’m curious that why addImageAsync is not supported for pvr or pvr.ccz format in the latest version yet. It’s really a hard work or not able to be achieved?

Thank you very much, be sincere. I just find this feature for a long time. if you mail me (jumpchess@163.com) when you finish the demo, i will be very pleased.

yuye liu wrote:

which version are u using it. I try to make a demo put in github for you . and I don not support u using pvr.ccz format if u want to cross more platform. it’ll not be parser well in some android os device.
Jarvis Lee wrote:
> Zhe Wang wrote:
> > aha, you mustn’t call gl functions in another thread, which will confused opengl state machine.
> > New thread beyond UI thread can only parse the picture compression format, then sync with UI thread to call opengl functions and load bitmap raw data into opengl texture memory.
>
> I’m curious that why addImageAsync is not supported for pvr or pvr.ccz format in the latest version yet. It’s really a hard work or not able to be achieved?