Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


DwarvesH

Member Since 12 Jun 2013
Offline Last Active Sep 15 2014 01:19 AM

Posts I've Made

In Topic: Performance problems when loading heightmaps

14 September 2014 - 09:29 AM

I think in situations like this you should profile. And the profile some more. Then send us the numbers so we can see if the look weird.

 

I can load, render and update LOD for a 64 square kilometer map in 100% single threaded mode, with a weird behavior that sometimes causes a simple touching of a buffer to take 12-14 ms and I don't get any framerate drops.


In Topic: Porting from DirectX9 to DirectX10 questions

09 September 2014 - 03:28 PM

Still no luck. I have spent a lot of hours looking at and debugging that very short piece of code. So I thought I'd give PIX a try for the first time ever.

 

But this too did not work that well, failing to set up the device:

 

 

PIX Logfile created at: 00:10:04

 
Frame 000001 ....PRE: Frame(1)
Frame 000001 ........PRE: D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 514, 29, 0x0036FAE8, 0x0036FD74, 0x0036FD70)
Frame 000001 ............PRE: AddObject(D3D11 Device, 0x00DDFF58, 0x0048B6B4)
Frame 000001 ............POST: <TRUE> AddObject(D3D11 Device, 0x00DDFF58, 0x0048B6B4)
Frame 000001 ............PRE: AddObject(DXGI Factory, 0x03F4EF58, 0x00473330)
Frame 000001 ............POST: <TRUE> AddObject(DXGI Factory, 0x03F4EF58, 0x00473330)
Frame 000001 ............PRE: AddObject(DXGI Adapter, 0x03EF6098, 0x0047B5E0)
Frame 000001 ............POST: <TRUE> AddObject(DXGI Adapter, 0x03EF6098, 0x0047B5E0)
Frame 000001 ............PRE: AddObject(DXGI Device, 0x03EF6200, 0x0048B6B0)
Frame 000001 ............POST: <TRUE> AddObject(DXGI Device, 0x03EF6200, 0x0048B6B0)
Frame 000001 ............PRE: AddObject(DXGI Swap Chain, 0x03EF6370, 0x00497B20)
Frame 000001 ............POST: <TRUE> AddObject(DXGI Swap Chain, 0x03EF6370, 0x00497B20)
Frame 000001 ............PRE: AddObject(DXGI Surface, 0x03EF6518, 0x004782C8)
Frame 000001 ............POST: <TRUE> AddObject(DXGI Surface, 0x03EF6518, 0x004782C8)
Frame 000001 ............PRE: AddObject(D3D10 Texture2D, 0x03EF6688, 0x00478270)
Frame 000001 ............POST: <TRUE> AddObject(D3D10 Texture2D, 0x03EF6688, 0x00478270)
Frame 000001 ............PRE: AddObject(D3D11 Device Context, 0x03F4EFA8, 0x0048C420)
Frame 000001 ............POST: <TRUE> AddObject(D3D11 Device Context, 0x03F4EFA8, 0x0048C420)
Frame 000001 ........PRE: <this=0x00ddff58>ID3D11Device::QueryInterface(IID_ID3D10Device, 0x0036FD70)
Frame 000001 ........POST: <S_OK><this=0x00ddff58> ID3D11Device::QueryInterface(IID_ID3D10Device, 0x0036FD70)
Frame 000001 ........PRE: <this=0x00ddff58>ID3D11Device::Release()
Frame 000001 ........POST: <3><this=0x00ddff58> ID3D11Device::Release()
Frame 000001 ........PRE: AddObject(D3D10 Device, 0x03EE75D8, 0x0048B73C)
Frame 000001 ........POST: <TRUE> AddObject(D3D10 Device, 0x03EE75D8, 0x0048B73C)
Frame 000001 ........PRE: AddObject(DXGI Factory, 0x03F56F08, 0x00473330)
Frame 000001 ........POST: <TRUE> AddObject(DXGI Factory, 0x03F56F08, 0x00473330)
Frame 000001 ........PRE: AddObject(DXGI Adapter, 0x03F56F58, 0x0047B5E0)
Frame 000001 ........POST: <TRUE> AddObject(DXGI Adapter, 0x03F56F58, 0x0047B5E0)
Frame 000001 ........PRE: AddObject(DXGI Device, 0x03EF6C18, 0x0048B6B0)
Frame 000001 ........POST: <TRUE> AddObject(DXGI Device, 0x03EF6C18, 0x0048B6B0)
Frame 000001 ........PRE: AddObject(DXGI Swap Chain, 0x03EF6D88, 0x03EF6370)
Frame 000001 ........POST: <TRUE> AddObject(DXGI Swap Chain, 0x03EF6D88, 0x03EF6370)
Frame 000001 ........PRE: <this=0x03ef6370>IDXGISwapChain::GetDesc(0x0036F8E4)
Frame 000001 ........POST: <S_OK><this=0x03ef6370> IDXGISwapChain::GetDesc(0x0036F8E4)
Frame 000001 ........PRE: <this=0x03ef6370>IDXGISwapChain::GetBuffer(0, IID_IDXGISurface, 0x0036F8DC)
Frame 000001 ........POST: <S_OK><this=0x03ef6370> IDXGISwapChain::GetBuffer(0, IID_IDXGISurface, 0x0036F8DC)
Frame 000001 ........PRE: AddObject(DXGI Surface, 0x03EF6F30, 0x03EF6518)
Frame 000001 ........POST: <TRUE> AddObject(DXGI Surface, 0x03EF6F30, 0x03EF6518)
Frame 000001 ........PRE: <this=0x03ef6518>IDXGISurface::QueryInterface(IID_ID3D10Texture2D, 0x0036F8AC)
Frame 000001 ........POST: <S_OK><this=0x03ef6518> IDXGISurface::QueryInterface(IID_ID3D10Texture2D, 0x0036F8AC)
Frame 000001 ........PRE: AddObject(D3D10 Texture2D, 0x03EE8B48, 0x03EF6688)
Frame 000001 ............PRE: <this=0x03ef6688>ID3D10Texture2D::GetDesc(0x03EE8BA0)
Frame 000001 ............POST: <><this=0x03ef6688> ID3D10Texture2D::GetDesc(0x03EE8BA0)
Frame 000001 ........POST: <TRUE> AddObject(D3D10 Texture2D, 0x03EE8B48, 0x03EF6688)
Frame 000001 ........PRE: <this=0x03ef6688>ID3D10Texture2D::Release()
Frame 000001 ........POST: <1><this=0x03ef6688> ID3D10Texture2D::Release()
Frame 000001 ........PRE: <this=0x03ef6518>IDXGISurface::Release()
Frame 000001 ........POST: <0><this=0x03ef6518> IDXGISurface::Release()
Frame 000001 ....POST: <S_OK> D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 514, 29, 0x0036FAE8, 0x0036FD74, 0x0036FD70)
Frame 000001 ....PRE: <this=0x03ef6d88>IDXGISwapChain::GetBuffer(0, IID_ID3D10Texture2D, 0x0036FD7C)
Frame 000001 ........PRE: <this=0x03ef6370>IDXGISwapChain::GetBuffer(0, IID_ID3D10Texture2D, 0x0036FD7C)
Frame 000001 ........POST: <S_OK><this=0x03ef6370> IDXGISwapChain::GetBuffer(0, IID_ID3D10Texture2D, 0x0036FD7C)
Frame 000001 ....POST: <S_OK><this=0x03ef6d88> IDXGISwapChain::GetBuffer(0, IID_ID3D10Texture2D, 0x0036FD7C)
Frame 000001 ....PRE: <this=0x03ee75d8>ID3D10Device::CreateRenderTargetView(0x03EE8B48, NULL, 0x0036FD80)
D3D11 CORRUPTION: ID3D10Device::CreateRenderTargetView: First parameter is corrupt! [ MISCELLANEOUS CORRUPTION #13: CORRUPTED_PARAMETER1]
An unhandled exception occurred.
 

In Topic: How to implement globe style mouse only camera control?

08 September 2014 - 04:28 AM

You can also find a simple orbit/pan camera in my demos: http://dl.dropboxusercontent.com/u/45638513/sdx/Tut08.zip


In Topic: Porting from DirectX9 to DirectX10 questions

08 September 2014 - 02:56 AM

DirectX 10 is not working for me well enough. Again!

 

So I decided to step back for a minute and write a minimal C++ test, just setting up DX10 and making sure that everything is 100% stable. And it is not.

 

After about 1-2 minutes of running my application crashes the display driver. Swap chain Present fails with "device removed" error. I tried catching the error and resetting the device, only to have it crash again after 1-2 minutes, so the error is not something that happens once.

 

After further testing, I noticed that the crash only happens if FRAPS is on (not recording). Fraps is a pretty good sanity checker because improperly set up devices often crash.

 

My first tests were ran on a laptop that is notoriously lenient with bad devices. A few years ago I broke my Dx9 app and it crashed on everything except this laptop. Even on the laptop it crahed if I recorded with Fraps though :). On this laptop the crash comes after 1-2 minutes.

 

On another desktop computer, FRAPS completely refuses to display the frame counter, but there is no crash. It fails to record (records blank screens). But something happened and without changing display initialization the application fails to show up lately.

 

On a third computer, the app runs fine, no crashes with or without Fraps.

 

My bet is on the device not being set up correctly though, but I have no idea why?

 

Here is my code: https://dl.dropboxusercontent.com/u/45638513/CTut01.zip

 

If anyone has an idea what is wrong, it would be greatly appreciated.

 

Thank you!


In Topic: Porting from DirectX9 to DirectX10 questions

05 September 2014 - 08:41 AM

Thanks for the answers!

 

It is SharpDX, so if something fails one of two things happen: I get an exception or application continues but it does not behave correctly. If I debug this I get some stray jumps like with memory corruption.

 

1. OK, so then I'll keep the swap chain with a buffer size of 1 and resize my additional render targets when needed by disposing them and recreating them.

 

I found out how to recreate the swap chain without a crash. The solution was very anticlimactic: 

swapChain = new SwapChain(factory, device, pp);

 

where the parameters are the one from the original creation of the swap chain.

 

One caveat is that I must switch off fullscreen mode when doing this to avoid a crash. This is a bit problematic because when switching MSAA in fullscreen mode you get nasty flickers, but I can live with that.

 

2. There are quite a few. Shaders must be rewritten to remove device context changes from effect files and leave raw shaders, doing the rest in code. Is this worth it going forward? DX11 and 12 I believe do not rely on the effects framework.

 

3. It means that after the first DrawText, nothing renders anymore. It get the first frame rendered correctly, then the first DrawText changes the device somehow and I was wondering if someone has a complete list of changes so I can start the frame by undoing them.

 

4. In DX9 the default format is X8R8G8B8/A8R8G8B8 which is a BGRA format apparently. In DX10 I believe the default is R8G8B8A8_UNorm, which is a RGBA format. DX10 can render in BGRA but it fails on my device at device creation.

 

And I have an additional question:

5. Are random MSAA sample values theoretically supported in DX10?

In DX9 to make my code complete I test support for all MultisampleType values, even weird ones like MultisampleType.FiveSamples and MultisampleType.SevenSamples. I don't thing there is any GPU out there that supports these...

 

In DX10 I just test 1, 2, 4, 8 and 16. Did they clean up the spec to avoid odd values or should I test 1 though 16 just to be safe? Maybe someone with a 5000 dollar GPU out there can render with 13 samples MSAA :).


PARTNERS