Sign in to follow this  

DirectX 10, 8k texture maps

This topic is 3483 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 there, I'm trying to create a texture map with 8192x4096 pixels. I'm getting the following debug spew: [2160] D3D10: ERROR: ID3D10Device::CreateTexture2D: Returning E_OUTOFMEMORY, meaning memory was exhausted. [ STATE_CREATION ERROR #105: CREATETEXTURE2D_OUTOFMEMORY_RETURN ] This is the code I'm using (SlimDX and C#): D3D10.Texture2DDescription dataTextureDescription = new D3D10.Texture2DDescription(); dataTextureDescription.Width = 8192; dataTextureDescription.Height = 4096; dataTextureDescription.ArraySize = 1; dataTextureDescription.MipLevels = 1; dataTextureDescription.SampleDescription = sampleDescription; dataTextureDescription.Format = DXGI.Format.R32_Float; dataTextureDescription.CpuAccessFlags = D3D10.CpuAccessFlags.Write; dataTextureDescription.BindFlags = D3D10.BindFlags.ShaderResource; dataTextureDescription.Usage = D3D10.ResourceUsage.Dynamic; _texture = new D3D10.Texture2D(device, dataTextureDescription); As you can see, I'm using R32_Float format for my texture maps as they don't contain RGB data but instead float values. This is the first texture map I'm creating and I should have enough resources available at this point. I am using a 8800GTS512. In addition, does anyone know how Vista determines how much video memory are available to the application? Thanks Marcel

Share this post


Link to post
Share on other sites
Out of curiousity, have you done a Direct3D Capabilities test (look in the docs for something along the lines of GetDeviceCaps) on your hardware to see if the video card supports that resolution of a texture with that pixel format? At 8192 x 4096 (R32 Float, I'm assuming it's 4 bytes) is 134mb of video ram, not including any mipmaps, which might push you over the card limits of contigious memory allocation in VRam. Hope this helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by GoodFun
DX 10 doesn't have capabilities anymore, and the 8800GTS 512 is supposed to support 8k texture maps...


Yikes, didn't know that. I'm still working with Dx9, until my next upgrade, and figured Dx10 would be the same. Thanks for the info and good luck with the issue.

Share this post


Link to post
Share on other sites
You are right that there are no caps but there are requirements. While supporting 8K texture widths and heights there is another requirement that limits the size of any resource to 128 MB. Therefore every Direct3D 10 driver can deny creating a resource that is larger than 128 MB. They are free to support larger once but if your application needs this are not longer “pure” Direct3D 10 as it may not run on every Direct3D 10 hardware.

Share this post


Link to post
Share on other sites
your best bet (and probably more cache friendly) is to have 4x 4096x4096 maps, you can use a texture array to do this with D3D10 so that essentially you will only be handling/binding 1 resource, the only thing that will change is in your shaders you have to use the texture-array enabled tex/sampler methods.

Share this post


Link to post
Share on other sites
Demirug, I've read about the 128meg limit... but a 8192x4096x4(bytes) texture map should be within the 128meg limit... unless the limit counts the overhead of texture definition as well...

silvermace, I have to look into texture arrays... maybe that would allow me to use texture maps that are a bit closer to the actual texture sizes I need...

Thanks for your help

Share this post


Link to post
Share on other sites
Quote:
Original post by GoodFun
a 8192x4096x4(bytes) texture map should be within the 128meg limit...
it is exactly 128mb for a single mip level at that resolution. I just had a check of the 10.0 specification and it just states "128MB" which could potentially be (albeit unlikely) ambiguous on the whole MB versus MiB circus...

Quote:
Original post by GoodFun
unless the limit counts the overhead of texture definition as well
Nope, that shouldn't factor into the calculations. The part that people forget is the mip-chain, but you've stated that you don't want one thus its a moot point here.


hth
Jack

Share this post


Link to post
Share on other sites
yeah, I am not using MIP mapping. I did create the same texture with an unsigned 8bit int and it worked ok, just the 32bit float gives the out of memory error.

I've decided to rewrite some of the texture map creation to compress the data value ranges to fit into smaller data types for those maps that need to be that big.

Share this post


Link to post
Share on other sites
Quote:
Original post by GoodFun
yeah, I am not using MIP mapping. I did create the same texture with an unsigned 8bit int and it worked ok, just the 32bit float gives the out of memory error.

I've decided to rewrite some of the texture map creation to compress the data value ranges to fit into smaller data types for those maps that need to be that big.

you could go for a format like float 16 or pack 3 elements 21 Bits per component into a R32G32 texture?

[EDIT: i guess methods like these are not optimal because they require some logic to index into/convert..) have you tried enabling Texture compression, im not sure but I seem to recal Float formats having at least 1 compression mode, 3DC or something like that?]

Share this post


Link to post
Share on other sites
From what I've read, texture compression is a lossy compression... for my application, that wouldn't work... I'll look into that though...

I'm currently trying to see if I can reduce some maps to R16_Float or R8_Uint. The good part is that I need to create texture maps only every 5 minutes, so if it takes a bit more effort to convert the values, that shouldn't be a problem as long as I can decode the value efficiently in the Shader.

Share this post


Link to post
Share on other sites
Quote:
Original post by GoodFun
From what I've read, texture compression is a lossy compression...
This is correct - there are more 'block compressed' formats in D3D10 and extended utilities in D3D10.1, but so far no standard lossless compression schemes.

Quote:
Original post by GoodFun
I'm currently trying to see if I can reduce some maps to R16_Float or R8_Uint.
Without more intimate knowledge of your application it seems that either this, some sort of custom encoding or some sort of paging/splitting of data are your only options.


Jack

Share this post


Link to post
Share on other sites

This topic is 3483 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this