• Advertisement
Sign in to follow this  

CreateTexture2D INVALID_ARG with DXGI_FORMAT_R32G32B32_FLOAT

This topic is 1891 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

Hi, 

 

I've been trying to change my render target format from DXGI_FORMAT_R32G32B32A32_FLOAT (working) to DXGI_FORMAT_R32G32B32_FLOAT (not working) but i'm getting INVALID_ARG on CreateTexture2D().

 

I can't find anything about it on MSDN. Maybe it's unrelated but i may rather post the whole description.

 

m_tex2d_desc.Width = 1280;
m_tex2d_desc.Height = 720;
m_tex2d_desc.MipLevels = 0; 
m_tex2d_desc.ArraySize = 1;
m_tex2d_desc.Format = DXGI_FORMAT_R32G32B32_FLOAT;
m_tex2d_desc.SampleDesc.Count = 1;
m_tex2d_desc.Usage = D3D11_USAGE_DEFAULT;
m_tex2d_desc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
m_tex2d_desc.CPUAccessFlags = 0;
m_tex2d_desc.MiscFlags = 0;

 

Regards.

Share this post


Link to post
Share on other sites
Advertisement

R32G32B32_FLOAT is actually an optional format for FEATURE_LEVEL_11_0. Before using a format you need to check this table to see if it's supported for your feature level. In the case of optional formats, you need to check at runtime using ID3D11Device::CheckFormatSupport.  In this particular case, I don't think there's any hardware that actually supports that format.

In general you should also create your device with D3D11_CREATE_DEVICE_DEBUG so that you get detailed error messages in these kinds of situations.
 

Share this post


Link to post
Share on other sites

Thank you, very helpful. It's my first time with Direct X and i've done this deferred rendering engine. The problem is that it's actually quite slow compared to forward MPML. So i thought maybe i could use a better format for my gbuffer. I'm currently using DXGI_FORMAT_R32G32B32A32_FLOAT and only storing float3 for each pixel. What do you recommend ?

Share this post


Link to post
Share on other sites

What do you need to store in your G-Buffer? There's all kinds of ways to compress the data for your G-Buffer...for most things you do not need full 32-bit float precision.

Share this post


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

  • Advertisement