Jump to content

  • Log In with Google      Sign In   
  • Create Account


[D3D11] Initialize all mip-levels at once


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 stoneMcClane   Members   -  Reputation: 114

Like
0Likes
Like

Posted 15 February 2013 - 02:18 PM

Hi,

 

I've written my own file format in which I store mip-level slices of a texture in the order highest to lowest (the data is compressed with BC1).

 

Now I'm trying to initialize a D3D11 texture with the binary data from my file format.

Updating only the first mip-level of the texture works without any problems, but what I'd like to do is to upload all mip-levels from the file to the GPU in one go.

 

Is this even possible ? Currently I'm using UpdateSubresource to upload the binary data. Is this maybe possible with a staging buffer and CopySubresourceRegion ?

 

 

Thanks for any hints



Sponsor:

#2 Erik Rufelt   Crossbones+   -  Reputation: 2768

Like
0Likes
Like

Posted 15 February 2013 - 03:09 PM

Call UpdateSubresource multiple times specifying different subresources (mip-levels).

Or when calling CreateTexture2D you can specify an array of D3D11_SUBRESOURCE_DATA to do them all in a single call. (That way you can also create your textures with D3D11_USAGE_IMMUTABLE if you know you won't be changing them again later).


Edited by Erik Rufelt, 15 February 2013 - 03:10 PM.


#3 Erik Rufelt   Crossbones+   -  Reputation: 2768

Like
0Likes
Like

Posted 15 February 2013 - 03:25 PM

Also, the DDSWithoutD3DX11 sample in the DirectX SDK has example code for doing this for compressed formats.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS