1
votes

I'm using SharpDX but this is really a general DirectX question. I have a D3D10 Texture2D. How do I create a D3D11 Texture2D that points to the same pixel data but specifies a different pixel format?

To put it another way:

// These two textures need to share the same pixel data
D3D10.Texture2D tex10; // Description.Format = B8G8R8A8_UNorm
D3D11.Texture2D tex11; // Description.Format = R32_UInt

I know how to get a DXGI Resource interface and then call OpenSharedResource() to get textures with the same format. How can I create the textures with different formats?

1
The textures themselves must be of the same data type. However, you can create a typeless texture and use specific views to access the data.Nico Schertler
@NicoSchertler Thanks for the comment. I didn't understand the typeless texture bit at first, but after a bunch of reading and experimenting I see that you are exactly right.shoelzer

1 Answers

0
votes

It's not possible. The textures themselves must be of the same data type.

You can create a typeless texture, however, and use specific views to access the data as if it had specific formats. See Strong vs Weak Typing.