Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sorry if this has been answered elsewhere - I'm rather new to DX. My question concerns conservation of resources - specifically textures in VRAM. I assume that upon returning from a call to CreateTexture2D, a copy of any textures data supplied has been copied elsewhere, likely VRAM. Does DX11 have any facility for having multiple ID3D11Texture2D objects which point to the same data?

This might at first seem silly, but imagine a ID3D11Texture2D which is an array of textures. In one material, an artist has chosen to blend three identically sized maps, saved on disk as,, and Then imagine they have another material which also uses three maps, but this time,, and

The shader code knows the diffuse texture is a texture array, and also has the number of layers baked (three in each case). I would essentially like to set up just two ID3D11Texture2D objects, one for each material, but I don't want to waste VRAM for two identical copies of and

I could use explicit texture arrays, of course, but this reduces the number of resources available to the shader and can complicate code somewhat more than would otherwise be needed.

share|improve this question

I don't think that this is possible. What I would do in this case is have either 4 different textures sourced from A, B, C and D, or else a single array with 4 slices (A, B, C and D again) and include the array slices to use in the material definition.

share|improve this answer

I'm pretty sure D3D11 does not allow multiple ID3D11Texture2D objects to point to the same pixel data in memory. However, you can certainly have multiple ID3D11ShaderResourceView objects point to the same ID3D11Texture2D object, which addresses the same core concern. Using your example above, you could have six unique ShaderResourceView objects and four unique Textures set up as follows:

  • Material1.pSRV1 points to Texture A
  • Material1.pSRV2 points to Texture B
  • Material1.pSRV3 points to Texture C
  • Material2.pSRV1 points to Texture A
  • Material2.pSRV2 points to Texture B
  • Material2.pSRV3 points to Texture D

Memory-wise, SRVs are relatively lightweight objects compared to the Textures they refer to.

share|improve this answer

Your Answer


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.