Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying to create multiple textures, and only several of them change every few frames. I don't want to have to copy in the whole array via SetResourceArray for just a few textures that change, which brings me to my quesiton: Does SetResourceArray copy the data into the GPU?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

It will most likely call a flush and then copy the stuff to the gpu since you are updating textures. I Cant say that IT IS like this, since DX never gives details about what their drivers do. But since it is the Effect framework it might also do so that it calls the PSSetShaderResourcer(), and then sets all of them at the same time.

But if you want to update a pair of textures each frame, consider having a smaller buffer for those explicitly. Otherwise calling UpdateResource per each might give you a desired effect for less performance loss.

share|improve this answer
    
What do you mean by UpdateResource? –  bluejamesbond Jan 9 '14 at 9:15
    
Sorry, i meant UpdateSubresource. Here is a link to the call. msdn.microsoft.com/en-us/library/windows/desktop/… –  Tordin Jan 9 '14 at 10:14
1  
And as you see on the page, it do copy stuff to the gpu ( which it has to do ( –  Tordin Jan 9 '14 at 10:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.