hendu wrote:Hm, this patch would force two GL contexts? Bad idea, it should be left up to the user. Some drivers are not happy with multiple contexts.
The patch is not forcing 2 gl contexts. If you want to do texture compression in a second thread like Nadros sad. You'll need 2 gl context. There is nothing you can do about that. My example was specific to show to Nadro that my patch has no issues with MT. If you just need streaming for HD then you don't need 2 gl contexts.
Your summary is not good:
both solutions:
-If you want decompression to happen in a 2nd thread YOU NEED a 2nd gl context. That's a issue specific to GL and probably to DX design.
-If you want to load data from hard disk in a second thread you can. And YOU DON'T NEED a 2nd gl context.
-PBO and streaming can be added or not. That's not a problem for now and is not a hard problem.
REDDemon's solution:
1) is faster. If users create the texture, there's even no need for creating a IImage object. So my solution is extremly faster when creating textures
2) If users want a IImage, then users want that IIMage DECOMPRESSED. otherwise he can't do nothing with that image. So i decompress the image immediatly ( this can seem slow but you should note that else data is useless, and there also the fact that data is already cached saving few cache misses)
3) no api changes
Nadro's solution:
1) You create a IImage with compressed data.. Wich is useless. because users have to decompress that data if they want to use that data.
2) Users have to decompress the image manually. When users do that then your IImage loading is fast exactly the same of my IImage loading. (a bit slower in real)
3) api changes (always bad if they can be avoided in a consistent way)
Why should users want to access a IImage wich has compressed data? If they want a IImage they necessary want that image uncompressed, else they just need to create a texture (my solution). If they want texture streaming the ITexture->lock is 100 times better and faster.
IN your solution all users are likely to do that
Code: Select all
IImage* image = createImageFromFile( file)
if(!image)
return ErrorCode;
if (image ->isCompressed())
image->decompress();
Code: Select all
IImage* image = createImageFromFile( file)
if(!image)
return ErrorCode;
http://irrlicht.sourceforge.net/forum/v ... =2&t=46041