0

I use Direct2D with DirectX11 via KeyedMutex. Everything works great if I am using a Hardware device. As soon as I default to Warp device I have a problem when I go to create a Texture2D object, I get the error message "Direct3D11Exception: E_OUTOFMEMORY: Ran out of memory"

These are the lines that are responsible:

    SlimDX.Direct3D11.Texture2DDescription tds = SlimDX.Direct3D11.Texture2D.FromSwapChain(swapChain, 0).Description;
    tds.BindFlags |= BindFlags.ShaderResource;
    tds.SampleDescription = new SampleDescription(1, 0);
    tds.OptionFlags |= ResourceOptionFlags.KeyedMutex;
    textureD3D11 = new SlimDX.Direct3D11.Texture2D(device, tds);

Again, everything works great using a Hardware device, just not Warp. When I run it against PIX I see this:

<0x09033390> ID3D11Device:CreateTexture2D(0x0FD1E330, NULL, 0x0FD1E32C --> NULL)

That's using the Warp driver, but when I use Hardware that last NULL is not NULL, it's an actual pointer which points to a D3D11 Texture2D object.

Any thoughts? I know I haven't included much code here but I was hoping someone would know what this was without having to post the whole DX routine. I will if required.

I do use debugging and 10.1 DX. The debug output is as follows:

DXX32: Warn: Registry value too long: MainVideo_SET in SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000\UMD
DXX32: Warn: Registry value too long: MainVideo_SET in SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000\UMD
D3D11: WARNING: ID3D11Device::SetPrivateData: Possible re-use of existing private data GUID for different data (size has changed). [ STATE_SETTING WARNING #55: SETPRIVATEDATA_CHANGINGPARAMS ]
D3D11: WARNING: ID3D11Texture2D::SetPrivateData: Existing private data of same name with different size found! [ STATE_SETTING WARNING #55: SETPRIVATEDATA_CHANGINGPARAMS ]
Unable to load D2D debug layer
First-chance exception at 0x7558d36f in nART.exe: Microsoft C++ exception: _com_error at memory location 0x068ec964..
First-chance exception at 0x7558d36f in nART.exe: Microsoft C++ exception: _com_error at memory location 0x068eccf8..
First-chance exception at 0x7558d36f in nART.exe: Microsoft C++ exception: _com_error at memory location 0x068ece3c..
First-chance exception at 0x7558d36f in nART.exe: Microsoft C++ exception: _com_error at memory location 0x068edfb4..
D3D11: ERROR: ID3D11Device::CreateTexture2D: Returning E_OUTOFMEMORY, meaning memory was exhausted. [ STATE_CREATION ERROR #105: CREATETEXTURE2D_OUTOFMEMORY_RETURN ]
D3D11: WARNING: Live Device: Name="device", Addr=0x00097D58, ExtRef=4 [ STATE_CREATION WARNING #2097297: LIVE_DEVICE ]
D3D11: WARNING: Live Device Child Summary: Device Addr=0x00097D58
Using ID3D11Debug::ReportLiveDeviceObjects with D3D11_RLDO_DETAIL will help drill into object lifetimes. Objects with ExtRef=0 and IntRef=0 will be eventually destroyed through typical Immediate Context usage. However, if the application requires these objects to be destroyed sooner, ClearState followed by Flush on the Immediate Context will realize their destruction.
Live              Context:      1
Live               Buffer:      0
Live            Texture1D:      0
Live            Texture2D:      1
Live            Texture3D:      0
Live   ShaderResourceView:      0
Live     RenderTargetView:      1
Live     DepthStencilView:      0
Live         VertexShader:      0
Live       GeometryShader:      0
Live          PixelShader:      0
Live          InputLayout:      0
Live              Sampler:      1
Live           BlendState:      1
Live    DepthStencilState:      1
Live      RasterizerState:      1
Live                Query:      1
Live            Predicate:      0
Live              Counter:      0
Live          CommandList:      0
Live           HullShader:      0
Live         DomainShader:      0
Live        ClassInstance:      0
Live         ClassLinkage:      0
Live        ComputeShader:      0
Live  UnorderedAccessView:      0
 [ STATE_CREATION WARNING #2097298: LIVE_OBJECT_SUMMARY ]
A first chance exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll
An unhandled exception of type 'SlimDX.Direct3D11.Direct3D11Exception' occurred in SlimDX.dll

Additional information: E_OUTOFMEMORY: Ran out of memory (-2147024882)
FrozT
  • 65
  • 1
  • 1
  • 8

1 Answers1

0

Warp device can only support up to feature level 10.1 in windows 7.

http://msdn.microsoft.com/en-us/library/windows/desktop/ff728764(v=vs.85).aspx

Also if you want to have proper error messages, create your devices with Debug option flag.

Then in debug tab of your project properties, tick "Enable unmanaged code debugging"

Now the you debug your will have clearer notifications in your Debug output.

mrvux
  • 8,523
  • 1
  • 27
  • 61
  • I put the entire debug output in my original question. I am using DX10.1 or 10.0 for warp via featurelevel. – FrozT Oct 03 '12 at 15:47
  • Seems strange, since doesn't seem that you have much memory taken anyway. Out of interest why do you need a warp device? :) – mrvux Oct 03 '12 at 16:22
  • Just in case the user cannot support hardware DX10, then I create a warp device instead. This is not a game, it's intended to be a low-power consuming app more for business use. – FrozT Oct 03 '12 at 16:53
  • What a wasted effort. I can never support DX11 in any way on a device which does not at least have 10.1 hardware because 10.1 is required to do the shared surfaces between D2D and DX11. Argg, I wish I never bothered to update all my code from DX10 to DX11. I think I will have to roll back to DX10 now. Very Frustrating. DX11 is kind of a joke, like Windows ME or Vista except at least in Windows ME I can write "Hello World" on the screen which I can't do with DX11. – FrozT Oct 05 '12 at 05:53
  • Yeah that's right you need DX10.1 to do the sharing. I never understood why Direct2D was not directly bound with DirectX11 as it should have been, shame. Out of interest do you use Direct2D for text rendering only of for other things? If it's for text only I can give you a pure dx11 solution. – mrvux Oct 05 '12 at 06:22
  • I would like to see your solution. I mostly use it for text at the moment, although I was considering using it for other stuff. – FrozT Oct 06 '12 at 15:56
  • I use this http://fw1.codeplex.com/ It's in c++ but wrote a little slimdx managed wrapper so i can use in c# projects. If you want code let me know – mrvux Oct 11 '12 at 14:31
  • would love to see some code. I'm not familiar with including c++ code in my project. I prefer to include directly than use a DLL if possible. Thanks! – FrozT Oct 11 '12 at 15:15