Archived

This topic is now archived and is closed to further replies.

Question about Lock

This topic is 5175 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites