![]() |
|
|||||||
| Bug Reports If you've found a bug in World Wind, discuss it here. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jun 2010
Posts: 11
![]() |
I believe both the SkyGradientLayer and the GpuResource cache are both deleting the same display list when the skybox is rebuilt.
In makeSkyDome() the old display list is explictly deleted if the cache key currently exists in the GPU resource cache. This is incorrect because the GPU resource cache will also delete the display list when the cache entry is bumped, explictly removed, or replaced (using a put() operation with the same key as an existing cache entry). Since makeSkyDome() calls put() after creating a new display list, the GPU resource cache will delete the old value associated with the cache key, thus destroying the new skydome list if the OpenGL driver re-uses IDs immediately (this is what I think I'm seeing). makeSkyDome() should never explictly delete a display list. It should either call remove() on the cache key before re-creating the display list, or it should allow the GPU resource cache to delete the old list when the new list is put into the cache. The latter is preferable. Something like: GL gl = dc.getGL(); - int[] dlResource = (int[]) dc.getGpuResourceCache().get(this.displa yListCacheKey); - if (dlResource != null) - gl.glDeleteLists(dlResource[0], dlResource[1]); // delete the old list -dlResource = new int[] {gl.glGenLists(1), 1}; // the resource id and the number of ids in the group +int[] dlResource = new int[] {gl.glGenLists(1), 1}; // the resource id and the number of ids in the group int size = (8 * 4 + 6 * 8) * (slices + stacks + 1); dc.getGpuResourceCache().put(this.displa yListCacheKey, dlResource,GpuResourceCache.DISPLAY_LIST S, size); and remove the call to gl.glDeleteLists in the exception catch: catch (Exception e) { - gl.glDeleteLists(dlResource[0], dlResource[1]); // delete the old list dc.getGpuResourceCache().remove(this.dis playListCacheKey); } |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Jun 2010
Posts: 11
![]() |
It turns out that while the current SkyGradientLayer code is not strictly correct, it is not an issue for users of the standard GPU resource cache. My application has a custom GPU resource cache which does not behave exactly the same as the standard one.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|