Jump to content

  • Log In with Google      Sign In   
  • Create Account


ShaderResourceView w/ D3D11_TEX2D_SRV


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 vsg1990   Members   -  Reputation: 252

Like
1Likes
Like

Posted 04 October 2012 - 01:58 PM

Hi,

I'm currently trying to make my own version of Tetris using Direct3D 11 (First game Posted Image ). I have no problem putting 1 texture on the screen at a time, but I am creating a ID3D11ShaderResourceView per texture. I don't think that is very efficient. I saw that a ID3D11ShaderResourceView can have an array of 2D textures loaded into it.

Can I draw 1 texture at a time from the ID3D11ShaderResourceView?
If so, how can I specify which texture I want to draw from the ID3D11ShaderResourceView?

Sorry If I'm misunderstanding what it's supposed to be used for. Still new to graphics programming.

Thanks,
Vince

Sponsor:

#2 MJP   Moderators   -  Reputation: 10858

Like
1Likes
Like

Posted 05 October 2012 - 12:24 AM

Texture arrays are intended for cases where the shader needs to select a single texture from an array at runtime, using an index. Usually this is for the purpose of batching. For instance, if you had 5 textured meshes and you wanted to draw them all in one draw call, you could use instancing and then select the right texture from an array using the index of the instance.

In your case for a tetris game, I don't think it would be necessary. You probably won't ever need to batch with instancing, in which case texture arrays won't give you any performance advantage. You should be fine with just creating a bunch of textures, and then switching textures between each draw call.

#3 vsg1990   Members   -  Reputation: 252

Like
0Likes
Like

Posted 06 October 2012 - 02:46 AM

Thanks for the reply. I've gotten past that, now I'm just coding away waiting until it resembles a playable game. Posted Image




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