Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

424 Neutral

About FReY

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Don't use &MyClass::MyCallback, ie. just do this: Foo class; class.SetCallback(MyClass::MyCallback); Also, you'll need to make sure MyClass::MyCallback is a static class function. ie. class MyClass { static int MyCallback(); };
  2. This should do it: typedef int (*RenderCB)(); class Foo { public: void SetRenderCallback(RenderCB renderCB ) { m_renderCB = renderCB; } void Render() { //call the callback m_renderCB(); } private: RenderCB m_renderCB; }; // another file Foo FooClass; int MyCallback(); FooClass.SetRenderCallback(MyCallback); FooClass.Render();
  3. FReY

    Shady Drivers...

    There are a few things I can think of. Either: 1] your app is generating a lot of gpu work -or- 2] there is a genuine driver bug. You can try disable TDR's to figure out whether it's [1] or [2]. If the app runs fine with disabled TDR's it's likely the former, otherwise it'll be the latter: http://www.microsoft.com/whdc/device/display/wddm_timeout.mspx Sprinkling a few liberal flushes may help to minimize the problem if the problem was [1]. Failing that, it may be worth trying to build on one of the DXSDK samples and slowly migrate it towards your current NSE solver project.
  4. Quote: Those are good suggestions, but I'm not sure if you can do a multi-group implementation with a single pass on a single buffer - you would be writing to the same resource that you are using to calculate the update, which would be troublesome... Actually, you can still keep using 2 buffers and double-buffer the update like you're doing now. Your input will be an SRV, and your output will just be a single UAV. Basically, pseudocode for your loop will still look like this: ID3D11Buffer* buffer[2]; CreateStructuredBuffer(buffer[0]); CreateStructuredBuffer(buffer[1]); CreateStructuredBufferSRV(srv[0], buffer[0]); CreateStructuredBufferSRV(srv[1], buffer[1]); CreateStructuredBufferUAV(uav[0], buffer[0]); CreateStructuredBufferUAV(uav[1], buffer[1]); uint readBuff = 0; uint writeBuff = 1; while (running) { pDev->CsSetUnorderedAccessViews(uav[writeBuff], 1); pDev->CsSetShaderResourceViews(srv[readBuff], 1); pDev->Dispatch(numGroupsX, numGroupsY, 1); pDev->CsSetUnorderedAccessViews(NULL, 1); // swap read and write buffers writeBuff = (writeBuff) ? 0 : 1; readBuff = (readBuff) ? 0 : 1; pDev->VSSetShaderResourceViews(srv[readBuff], 1); pDev->DrawIndexed(...) } Effectively you'll be doing the following: struct GridPoint { float4 Flow; float Height; }; RWStructuredBuffer<GridPoint> Output : register(u0); StructuredBuffer<GridPoint> Input : register(t0); etc.. instead of this: Texture2D<float> InputHeight : register( t0 ); Texture2D<float4> InputFlow : register( t1 ); RWTexture2D<float> OutputHeight : register( u0 ); RWTexture2D<float4> OutputFlow : register( u1 ); etc... Funny enough I just found some info on creating structured buffer UAVs and SRVs right here on gamedev :) http://www.gamedev.net/community/forums/topic.asp?topic_id=516043
  5. Hey this looks pretty good; have you got an implementation that propagates across multiple thread group/blocks ie. a water surface greater than 32x32? Moe: to get this working on DX10 feature level Compute under DX11, you could actually do it in 1 pass if you changed this to: 1] max 768 threads in a group. Although for efficiency reasons you'd actually want less than 384 threads. 2] a single UAV - possible if one converts the Height+Flow into a single RWStructuredBuffer for output, and a single StructuredBuffer for input. 3] a single groupshared region - possible again if you make it structured. 4] no shared memory scattered writes; ie. convert the algorithm to do gather reads. 5] The output StructuredBuffer can be directly bound as an SRV to other shader stages (VS, GS, PS). 6] compile for cs_4_0 target rather than cs_5_0 target. (more info here: http://www.slideshare.net/repii/your-game-needs-direct3d-11-so-get-started-now)
  6. FReY

    Inheritance vs. Aggregation

    Some more discussion on this very subject here: http://gamearchitect.net/2008/06/01/an-anatomy-of-despair-aggregation-over-inheritance/
  7. FReY


    Glad to see you're still working on this game; I really enjoy reading your posts. I'd heard rumours that you'd moved onto more INTCeresting employment :)
  8. FReY

    Video mode switch fail?

    When you call the ChangeDisplaySettingsEx function, send it the CDS_TEST flag to test whether the mode is *really* supported. This will test the display switch without actually doing the switch. I usually add this as part of my enumeration of display settings.
  9. FReY

    Can only accept one point?

    1] Thaumaturge is probably correct here. What projection/modelview matrix are you using? Try this just before your drawing. Do you see your two points now? const float LEFT_COORD_X = -10.0f; // ortho coord for left side of the screen const float RIGHT_COORD_X = 10.0f; // ortho coord for right side of the screen const float BOTTOM_COORD_Y = -10.0f; // ortho coord for the bottom of the screen const float TOP_COORD_Y = 10.0f; // ortho coord for the top of the screen glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(LEFT_COORD_X, RIGHT_COORD_X, BOTTOM_COORD_Y, TOP_COORD_Y, -1.0f, 1.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); 2] clear colour should be specified before you do the clear. Thus, swap the order around here: glClearColor(0.0, 0.0, 0.0, 0.0); glClear (GL_COLOR_BUFFER_BIT);
  10. what do you mean by "best"? * fastest on cpu? * fastest on gpu? * easiest to implement? * most accurate?
  11. FReY

    [SOLVED] glGet() problem

    Ah, I should have checked your code more closely and indeed there is a bug. This is what you should have (according to my OpenGL reference) GLint previous[2]; glGetIntegerv( GL_POLYGON_MODE, previous ); glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); // We want wire-frame mode // Do some drawing glPolygonMode( GL_FRONT, previous[0] ); glPolygonMode( GL_BACK, previous[1] );
  12. Saving starting state (including random seeds) and subsequent player input is a great way to go. Particularly if you run-length compress your player input (it's very compressible!), you can knock it down to a couple hundred bytes for every minute of gameplay (YMMV) Some good articles on the subject: http://www.gamasutra.com/features/20010713/dickinson_pfv.htm http://www.gamasutra.com/view/feature/2029/developing_your_own_replay_system.php
  13. FReY

    [SOLVED] glGet() problem

    Quote: Isn't it just simpler to call glPolygonMode( GL_FRONT_AND_BACK, GL_FILL)? .. or use glPushAttrib(GL_POLYGON_BIT) and glPopAttrib()
  14. FReY

    AMD RV670 GPU's. Surprised?

    Quote: They were doing clever things at the transistor level that Nvidia weren't. Out of curiosity, what are you referring to?
  15. FReY

    It's Done...

    Yeah Congrats, I've been following your blog for a long time now and I'm looking forward to finally seeing the game in action ;)
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!