/* attempt to deal with prototype, bootstrap, jquery conflicts */ /* for dropdown menus */

Jump to content

Image of the Day

Today's #ScreenshotSaturday features Face Your Fears from Turtle Roc ... #virtualrealityshop #mobilevr #vrshop https://t.co/3qhSNAVNOZ
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

CreateTexture2D INVALID_ARG with DXGI_FORMAT_R32G32B32_FLOAT

4: Adsense

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   

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.



#2 MJP   Moderators   

18926
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   

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   

18926
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.