Menu

#437 OpenGL textures may never be locked

SVN head revision
closed-fixed
None
5
2019-03-16
2016-01-11
Cycy
No

In source/Irrlicht/COGLCoreTexture.h the member IsRenderTarget for COGLCoreTexture objects is set to true, unconditionally. Similarly, in the lock() method for those objects, it fails to lock and returns 0 if IsRenderTarget is true. So that means lock() fails unconditionally, in all cases, regardless of whether the hardware supports copying textures from it.

// TO-DO - this method will be improved.

I would suggest putting that at a slightly higher priority than TO-DO. minetest, at least, tries to copy hardware textures to software, to make "inventory" images, and to generate textures that are images of 3D projections. I don't exactly know how to copy from hardware to software in OpenGL, but I can definitely identify a long, complicated and potentially useful method, that fails unconditionally.

Interestingly, removing the check for IsRenderTarget in lock() does not result in a crash for me. The data copied is rather corrupted, but oddly remniscent of what it's supposed to be copying. I'm pretty sure there's no code anywhere that ever sets IsRenderTarget to false, outside of software rendered objects, so either COGLCoreTexture is always a render target, and copying while being a render target is important, or else COGLCoreTexture objects need the code for changing render targets.

Discussion

  • Cycy

    Cycy - 2016-01-11

    also in irr::video::CNullDriver::createImage() "create an image from part of a texture" if the desired position and size are ever the same as the texture size, this function will unconditionally segfault for anyone using OpenGL. (It assumes ->lock() won't return NULL). I can imagine there are other places that have a similar assumption, but this is the one I ran into.

     
  • Michael Zeilfelder

    • assigned_to: Nadro
     
  • Nadro

    Nadro - 2016-01-11

    It's related only for Render Targets, thats why a TO-DO entry was added (IsRenderTarget is false for standard textures, please look at ITexture constructor). It will be fixed before v1.9 release hovewer only for non-floating point formats (floating point formats will be not supported I think).

    I'll check CNullDriver::createImage() issue.

     
  • Michael Zeilfelder

    • status: open --> closed-fixed
    • assigned_to: Nadro --> Michael Zeilfelder
     
  • Michael Zeilfelder

    The texture lock got rewritten some time (weeks or a few months) ago and rendertarget textures can be locked now. CNullDriver::createImage got fixed now with r5790.

     

Log in to post a comment.