PDA

View Full Version : pixel_data_range problem



epajarre
03-25-2003, 01:51 PM
(My setup: GeForce (1), Windows XP, Athlon processor, 41.09 drivers)

I tried pixel_data_range extension in my application, which was already using VAR. I set my write_data_range to be equal to my VAR (AGP) allocation, and used my existing memory allocator for creating buffers which I use for uploading my (pre)compressed textures. The problem is that I am seeing corrupted textures.

If I remove the EnableClientState, the problem disappears, so it looks like it is directly related to the PDR. Also if I add PDR flush immediatelly after the glCompressedTex(Sub)Image2ARB the problem does NOT disappear, so maybe I am not reusing
the memory too soon. (I use Fences so that should not happen anyways)

I have started to suspect that maybe I have too little memory on my card? It is possible that all the textures don't fit on the card so the driver should move them from the main memory to the video memory as needed. I would have expected this to work, but maybe not? Also if I increase my small GL window to full screen more textures suddenly appear corrupted, which might be related to memory shortage. GeForce (1) has only 32M memory.

Has anybody had similar problems?

Eero

roffe
03-25-2003, 03:16 PM
I also had problems with PDR and 41.09 drivers. I switched to 43.00 and the problem went away.


[This message has been edited by roffe (edited 03-25-2003).]

epajarre
03-26-2003, 02:16 AM
I just tried 43.00 drivers, they did not fix the problem for me (possible made it happen less often ?).

Eero

epajarre
05-21-2003, 10:01 PM
I suspect that I finally found the reason for my problems, sort of embarasing that I found it by reading the extension spec more carefully.

Quoting from the NV_Pixel_Data_Range spec:
The following additional restrictions apply to glTex[Sub]Image2D:
- The texture must fit in video memory.

(actually the spec does not mention this limitation for compressed textures?)

Continuing this issue -- We all know the OpenGL beginner question "How do I know if my textures fits on the Card memory", and the answer "You don't, and you shouldn't really care too much". Now the extension spec requires that the texture fits on video memory!

The following is my best quess how this extension can be actually used for texture uploads.

1) Use a reasonably sized texture, and HOPE it fits into video memory.

2) Only use the texture for rendering immediatelly after you have uploaded it. Don't even think binding an other texture between the upload and the rendering.

3) You can of course reuse the texture, but always glTex[Sub]Image it before using it in rendering.

Can any body confirm/reject my guess?

Eero

Madoc
05-21-2003, 10:12 PM
Is there any reason to use this extension over CopyTexSubImage? I've always supposed that CopyTexSubImage would copy directly to video mem (this may not be your purpose, I realise).