samv

Members
  • Content count

    207
  • Joined

  • Last visited

Community Reputation

312 Neutral

About samv

  • Rank
    Member
  1. Hm, I guess using SwapChains does not make much sense with D3DImage anyway. So, I'm just using RenderTarget surfaces, not the device's back buffer and no swap chains. I still need to call IDirect3DDevice9::Present. Does anyone know why?
  2. Hey, thanks a ton for the detailed tips! By the way, looks like I can avoid the crashes by calling Device.Present(). (Maybe this sounds obvious, but in .NET 3.5 this was not needed. Actually many people explicitly mentioned it shouldn't be called with D3DImage. And I don't really see why it should...) Now I'm back to "just" dealing with the things Maesse mentioned. I'm not sure yet but it feels like frame skipping has become worse in .NET 4. [crying] I'll try recompiling SlimDX though, maybe that does help a bit. Cheers!
  3. Does anyone know how the WPF D3DImage class influences the need for Present calls? Should I still call IDirect3DDevice9::Present on my own D3D device myself before calling D3DImage.SetBackBuffer? What if I'm using SwapChains? Should I call IDirect3DSwapChain9::Present instead? Both? As mentioned in another thread I have some problems with switching a D3DImage application to .NET 4. The SlimDX WPF samples calls Device.Present. I didn't. This worked fine in .NET 3.5. In .NET 4.0 adding that call seems to help a lot. Why could that be the case? Thanks for any advice!
  4. I another thread someone mentioned recompiling SlimDX for .NET 4. I wondered if this has a specific advantage over using the useLegacyV2RuntimeActivationPolicy flag. (This was tangentially touched in an old thread, but not fully resolved.) Does anyone know any downsides to using useLegacyV2RuntimeActivationPolicy? (I'm having some issues with SlimDX on .NET 4 and wonder if it could be related to this and I should recompile SlimDX instead.) [Edited by - samv on May 20, 2010 1:56:36 AM]
  5. Thanks a lot for your input! It's very much appreciated. I'm also working on an application where not using WPF is not viable, not a game. tgrand, I assume you still use D3DImage for your SlimDX/WPF interop? Quote:I built SlimDX to target .NET 4.0. You recompiled the SlimDX DLL yourself, targetting .NET 4.0? Very interesting. Was there a specific reason for doing this (as opposed to using useLegacyV2RuntimeActivationPolicy)? Is it just a simple recompile or is anything non-trivial required? Quote:a million API calls at it per frame (is that really a good idea?) Probably not. The actual application doesn't do that either. (just shaders on a <10k triangle mesh.) I was just testing if the SlimDX sample app had the same problem. This was the simplest way to increase the complexity, so I pushed it until it triggered a TDR. Now I'm starting to think that this is not actually the same problem at all. (Just similar symptoms.) Cheers!
  6. By "the display driver crashes" I mean it gets reset by Windows. Apparently this is called TDR (Timeout Detection and Recovery), a feature of the new Windows Display Driver Model which restarts the display driver after 2 seconds. NVIDIA Statement on TDR Errors Timeout Detection and Recovery of GPUs through WDDM According to NVIDIA the most common cause is faulty hardware, overheating, overclocking etc. However this happens on all 3 computers I tried, none are overclocked and all are supposed to be quite fast. (Geforce GTX 280, GTS 250, ... ) Is drawing a bunch of poylgons like this really too much? Does using WPF D3DImage slow this down so much? Is the .NET 4 D3DImage different in some way?
  7. Hi, I'm having problems with using SlimDX with WPF's D3DImage. When a non-trivial amount of triangles is rendered the Display Driver crashes. I reproduced the problem in the SlimDX WPF sample application (Direct3D9\WPF Interop\WpfSample) with just a small change that makes it render more triangles. My changes: 1. Draw some more triangles than before in MyRenderEngine.cs: public void OnMainLoop(object sender, EventArgs e) { _sprite.Begin(SpriteFlags.AlphaBlend); _sprite.Draw(_texture, Vector3.Zero, Vector3.Zero, _dataModel.Color4); int n = 1024 * 1024; for (int i = 0; i < n; i++) { _sprite.Transform = Matrix.RotationZ(i / (float)n) * Matrix.Translation(500, 500, 0); _sprite.Draw(_texture, Vector3.Zero, Vector3.Zero, _dataModel.Color4); } _sprite.Transform = Matrix.Identity; _sprite.End(); } Make the window a bit larger and force redrawing on mouse move in WpfWindow.xaml(.cs): Height="800" Width="1024" SizeChanged="Window_SizeChanged"> <Grid> <ii:SlimDXControl x:Name="m_slimDXControl" MouseDown="MouseDownHandler" MouseMove="MouseMoveHandler"/> private void MouseMoveHandler(object sender, System.Windows.Input.MouseEventArgs e) { m_slimDXControl.ForceRendering(); } To reproduce start the sample and move the mouse for maybe 3 seconds. If it doesn't happen after a few frames it will usually not happen at all. Restart the application again. Sometimes it does not happen for quite some time, other times it quickly crashes every time. I'm using the latest SlimDX release (Feb 2010, 9.42), the latest NVidia drivers (197.45 WHQL). It happens on both Vista (x86) and Win7 (x64). In my real application it happens much more often (only?) when targeting .NET 4. But in the modified WpfSample above (with a high enough triangle count) it happens about equally often when targeting .NET 3.5. Thanks for any help!
  8. Many thanks to Mike.Popoloski for implementing this. Cheers!
  9. Quote:Original post by Hazard_X Effect.FromMemory doesn't seem to take uncompiled data... or maybe something else is wrong. The "An undetermined error occurred" message isn't very helpful on this. A MiniTri11 example would help alot to get started with DX11. This might solve your problem.
  10. Hi I'm trying to use SlimDX for compiling shaders. There is the SlimDX.Direct3D9.Include.Open interface method that I can supposedly implement to handle relative paths. Now it unfortunately seems to me that this interface doesn't provide all the needed information. Its unmanaged counterpart (ID3DXInclude::Open) also provides the parameter: pParentData [in] Pointer to the container that includes the #include file. As far as I understand, I could use this parameter to look up the path of the parent include file and create an absolute path from there (assuming I store all include file paths in a map, using as key the pointer handed out in ppData.) But how do I do this in SlimDX? Thanks!
  11. Oh teh nos! Where's a doctor!?!

    I can't believe it's not lupus.
  12. Any progress? I again see this same problem when trying to create D3DEx. The constructor is supposed to fail on XP and throw Direct3D9Exception, but that is hidden by a false positive ObjectDisposedException when using the DetectDoubleDispose feature. BTW should I post such issues here or on the SlimDX google code site or both or ...?
  13. The same applies to the Reset and ResetEx methods. (Just FYI; I guess I don't need this flag after all...)
  14. Oh, I guess that makes sense. Too bad. Thanks anyway!