Skip to main content
gamedev.net
🔒 Locked

Question about Lock

Started by Negitivefrags Oct 13, 2003 at 1:12 AM 3 replies 700+ views
Original Post
Negitivefrags
Negitivefrags
I was just wondering out of interest about Lock. Its not really important or anything, but the pointer that you get when you lock a vertex buffer, does it *really* point directly into your graphics ram as the documentation seems to imply or is there some trick that DX is using so that you can copy data there as if it was? The idea that it points directly to graphics ram sort of goes against the grain for me because I always saw pointers as a way of referenceing only your physical RAM. If you can access graphics RAM directly with a pointer, couldnt you theoreticly be able to access sound card RAM the same way? How about the small amount of RAM on your network card? Its not that I actuly want to do any of that, its more just a conceptual question then anything else. Can a pointer really point to *any* RAM in your system?
ArmitageIII87
ArmitageIII87
Sure why not, I''d think the graphics driver would handle the pointer address referenced through DX. Or in the case of the sound card; the audio driver. Microsoft has essentially provided you with a wrapper to the hardware. Generally speaking! I know that my previous comment doesn''t even scratch the surface.
TGGC
TGGC
IMHO you get just some "normal" RAM which (if no "onlywrite" flag is set) is initialized with the data from your GFX card. If you call unlock, all the data is put back to the card.

I''m not sure about it, but it would make perfect sense.

[ Games made by gamers'' minds | maxiInnovation - miniCan | mail: ChristianRoesch@gmx.de ]
beehorf
beehorf
Mostly I/O devices are accessed through "memory mapping". Some specific registers are mapped to memory and when you write to the system memory you write to the registers of the I/O devices.
But you must probably signal the device that you are doing some operation on it and then transfer data or do something.

It is a long concept and there are lots of ways. In a Computer Architecture books you can read details of it.
be yourself.
Nik02
Nik02
quote:
Original post by beehorf

But you must probably signal the device that you are doing some operation on it and then transfer data or do something.



This is exactly why the locking is necessary. The driver will know that the data in the locked region will be modified, and doesn''t attempt to do anything with it during the lock.

-Nik
Niko Suni

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.