Original Post
🔒 Locked
Lock texture
Advertisement
That depends on a lot of things, mostly size of the texture vs. size of the rectangle you'd lock.
There should be no disadvantages if you only lock only as much as you need, so always do that.
There should be no disadvantages if you only lock only as much as you need, so always do that.
Depends on the driver.
What's most likely is that if you have a 256x256 texture, and you lock the top left 64x64 portion, you'll get given back a locked rect with a pitch of 256 pixels (I.e. the driver will give you back a pointer to the full texture rather than copying a region to a temporary buffer), but when you unlock that texture, the driver will only copy 64 pixels from each scanline.
So short answer is that yes, it's likely that locking only the region you need is faster, but it ultimately depends on the driver.
What's most likely is that if you have a 256x256 texture, and you lock the top left 64x64 portion, you'll get given back a locked rect with a pitch of 256 pixels (I.e. the driver will give you back a pointer to the full texture rather than copying a region to a temporary buffer), but when you unlock that texture, the driver will only copy 64 pixels from each scanline.
So short answer is that yes, it's likely that locking only the region you need is faster, but it ultimately depends on the driver.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement