Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


CreateTexture2D INVALID_ARG with DXGI_FORMAT_R32G32B32_FLOAT


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
3 replies to this topic

#1 Lumz   Members   -  Reputation: 124

Like
0Likes
Like

Posted 20 February 2013 - 03:53 PM

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.



Sponsor:

#2 MJP   Moderators   -  Reputation: 11781

Like
1Likes
Like

Posted 20 February 2013 - 04:20 PM

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.
 



#3 Lumz   Members   -  Reputation: 124

Like
0Likes
Like

Posted 20 February 2013 - 04:35 PM

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 ?



#4 MJP   Moderators   -  Reputation: 11781

Like
0Likes
Like

Posted 20 February 2013 - 09:14 PM

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.






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