Jump to content
  • Advertisement
Sign in to follow this  
yk_cadcg

[dx10] Texture2DArray is not MRT!?

This topic is 4061 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm confused. I want to do MRT, so I alloc a tex[nMRT]:
// tex[nMRT]
	descTex.Width = texW;
	descTex.Height = texRH;
	descTex.ArraySize = nMRT;
	descTex.SampleDesc.Count = 1;
	descTex.SampleDesc.Quality = 0;
	descTex.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;//ps: rendertarget can't DXGI_FORMAT_R32G32B32_UINT???
	descTex.Usage = D3D10_USAGE_DEFAULT;
	descTex.BindFlags = D3D10_BIND_RENDER_TARGET;
	descTex.CPUAccessFlags = 0;
	descTex.MiscFlags = 0;
	descTex.MipLevels = 1;
	V(g_pd3dDevice->CreateTexture2D( &descTex, NULL, &pTex));
//texview, depth ,depthview, omitted here
...
	//g_pd3dDevice->OMSetRenderTargets(1, &pViewTexRS, pViewTexDepth); //work???
	g_pd3dDevice->OMSetRenderTargets(nMRT, &pViewTexRS, pViewTexDepth); //fails???

Why can't I set nMRT but only 1? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
For MRT you need to generate one render target view for every sub resource you want to write too.

Share this post


Link to post
Share on other sites
Thank you very much. I get around by created n textures and n views for each, is it about the same performance than 1 textureArray and n views for each of its subresource? Thanks!
Quote:
Original post by Demirug
For MRT you need to generate one render target view for every sub resource you want to write too.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!