DirectX 10, 8k texture maps

Started by
10 comments, last by jollyjeffers 15 years, 10 months ago
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
Advertisement
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.
DX 10 doesn't have capabilities anymore, and the 8800GTS 512 is supposed to support 8k texture maps...
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.
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.
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.
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
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
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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.
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?]
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website

This topic is closed to new replies.

Advertisement