setRamMipmapPointerFromInt does not work unless makeRamImage also called

Bug #990089 reported by Andrew Wason
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
Fix Released
Undecided
rdb

Bug Description

Ubuntu 11.10 64bit, using panda CVS

I'm using Texture.setRamMipmapPointerFromInt(). I set a breakpoint in Texture::set_ram_mipmap_pointer() and confirmed the data pointer is correct and contains my RGB data.

However, in GLGraphicsStateGuardian::upload_texture_image() it seems like my pointer is not used because the CPTA_uchar from tex->get_ram_mipmap_image() is_null(). I set a breakpoint in Texture::get_ram_mipmap_pointer() and it is never called. So upload_texture_image() seems to need a non-empty RamImage before it will attempt to use the pointer.

If in my Python code I call Texture.makeRamImage(), then everything works. But it seems like a waste to allocate a full RAM image when my pointer will end up being used instead.

Attached is a sample code that loads raw RGB data into a ctypes buffer, then passes the address to setRamMipmapPointerFromInt. This displays garbage or black. If the call to makeRamImage is uncommented, it works.

Revision history for this message
Andrew Wason (rectalogic) wrote :
Revision history for this message
rdb (rdb) wrote :

Fixed in 64a7fbab873dedf8aaa6fb1993bc16ed12f0f0bd on master branch.

Changed in panda3d:
assignee: nobody → rdb (rdb)
status: New → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.