Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

169 Neutral

About wforl

  • Rank

Recent Profile Visitors

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

  1. I'm looking into using shared surfaces (across processes) in one of my projects but the sample used to demonstrate the technique doesn't seem to be avaliable on MSDN anymore.   http://code.msdn.microsoft.com/DXGISyncSharedSurf   Has anyone come across any other samples I could refer to?   Hopefully the example code posted here will be enough to get me going, but a working example to refer to/compare against is always nice.
  2. The shader looks like this : struct VS_OUT { float4 pos : SV_POSITION; float4 col : COLOUR; }; VS_OUT VS(float2 ipos : POSITION, uint ilayer : LAYER, int icol : COLOUR) { VS_OUT vsOut; vsOut.pos = float4(ToNDC(ipos), MapLayerToDepth(ilayer), 1.0f); vsOut.col = ExtractColour(icol); return vsOut; } float4 PS(VS_OUT ips) : SV_Target { return ips.col; } technique10 Render { pass P0 { SetGeometryShader( 0 ); SetVertexShader( CompileShader( vs_4_0, VS() ) ); SetPixelShader( CompileShader( ps_4_0, PS() ) ); } }
  3. I have a large buffer of precomputed vertices(triangle list) that I want rendered as triangles. The vertex structure looks like this :   struct Vertex {     float x, y;     uint layer; }   The layer is in effect the depth, and ranges from [0 -> uint.Max], where 0 is closest and uint.Max is furthest away.   I started out by just enabling a depth buffer and converting the layer value to the appropiate depth range in the shader   i.e mapping [0, uint.Max] -> [0, 1].   but this causes issues as the increment for the [0-1] range is very small (1 / uint.Max), and so I lose precision.   I'll not be using the full [0, uint.Max] range, so I then just assumed that the layer won't be higher than 100,000   This brings the increment down to something sensible (0.00001)   but I'm wondering if I can ditch the mapping all togeather and just use straight uints for depth?   All the depth formats I can see suugest they need to be normalized, so iI'm guessing the answer is no, but thought I'd ask anyway    
  4. Upon further investigation the underlying COM pointer was indeed null due to me unintentionly releasing it earlier in the code. Having fixed that, things are now working. Thankyou
  5. I'm trying to create an application in which I render to a sampled buffer, resolve that buffer, and then pass on the resolved resource to another system. However, I seem to be having trouble with the 'ResolveSubresource' method throwing the following exception : First-chance exception at 0x761EC42D (KernelBase.dll) in DirectCanvasTest.exe: 0x0000087A (parameters: 0x00000000, 0x0036CD94, 0x0036C1CC). The output window reports the following : D3D11 CORRUPTION: ID3D10Device::ResolveSubresource: Third parameter is corrupt or NULL. [ MISCELLANEOUS CORRUPTION #15: CORRUPTED_PARAMETER3] First-chance exception at 0x761EC42D (KernelBase.dll) in DirectCanvasTest.exe: 0x0000087A (parameters: 0x00000000, 0x0036CD94, 0x0036C1CC). Not sure what I'm doing wrong, the thrid paramter isn't null, so I guess I'm creating it incorrectly. Here is the code for that as well as the resolve method: void ResizeBuffers(int _width, int _height) { if (m_renderTarget != null) { m_renderTarget.Dispose(); } if (m_renderTargetView != null) { m_renderTargetView.Dispose(); } _width = (int)_width > 0 ? (int)_width : 64; _height = (int)_height > 0 ? (int)_height : 64; var targetDesc = new Texture2DDescription() { BindFlags = BindFlags.RenderTarget | BindFlags.ShaderResource, Format = Format.B8G8R8A8_UNorm, Width = _width, Height = _height, MipLevels = 1, SampleDescription = new SampleDescription(4, 4), Usage = ResourceUsage.Default, OptionFlags = ResourceOptionFlags.None, CpuAccessFlags = CpuAccessFlags.None, ArraySize = 1 }; m_renderTarget = new Texture2D(Device, targetDesc); m_renderTargetView = new RenderTargetView(Device, m_renderTarget); targetDesc = new Texture2DDescription() { BindFlags = BindFlags.RenderTarget | BindFlags.ShaderResource, Format = Format.B8G8R8A8_UNorm, Width = _width, Height = _height, MipLevels = 1, SampleDescription = new SampleDescription(1, 0), Usage = ResourceUsage.Default, OptionFlags = ResourceOptionFlags.None, CpuAccessFlags = CpuAccessFlags.None, ArraySize = 1 }; m_resolveTarget = new Texture2D(Device, targetDesc); } void ResolveTarget() { int sourceIndex = SlimDX.Direct3D10.Resource.CalculateSubresourceIndex(0, 1, 1); int destIndex = SlimDX.Direct3D10.Resource.CalculateSubresourceIndex(0, 1, 1); Device.ResolveSubresource(m_renderTarget, sourceIndex, m_resolveTarget, destIndex, Format.B8G8R8A8_UNorm); } Anybody have any idea what I'm doing wrong?  
  6. First off, anyone managed to add the "search programs and files" text bar to the taskbar? And secondly, does anyone know how to the remove the gripper things show below? [attachment=12203:Untitled.png]
  7. If you can get your hands one Bjarne's "The C++ Programming Language" book, he explains how to create a calculator. The source code can also be found at his site.
  8. wforl

    advanced C++ books

    Some of my recommendations
  9. Try disabling language extensions. Project Properties->Config->C/C++->Language
  10. wforl


    I'm trying to introduce myself to using source control as I have no experience with any of the avaliable tools. So I've picked up Peforce and am trying to run through some of the common tasks someone might do in a general team of programmers. One task I thought would be beneficial, would be to roll back a file to a previous working version, such as in the example where a new code change was causing issues. My initial thoughts on this was to : - check out the file - roll it back - check in the file But I don't any options to do this. I can roll back a file without checking it out in my workspace or on the server, using the right click menu. But wouldn't the correct way to do this be to first check it out? Another way I thought of was to : - check out the file - Get an earlier revision - check in the file When I do this though, with the file still checked out, the server shows the earlier revision. Why is that? And secondly it doesnt allow me to submit with the error of not having the latest revision.
  11. wforl

    explicit constructors

    So you've only just stumbled upon them and you've already created a video tutorial on how to and how not to use them?
  12. wforl

    what is the .net framework?

    The best explanation I've seen was from Andrew Tolsen's book, Pro C# 2008 and the .net 3.5 Platform. Maybe try and get your hands on it.
  13. wforl

    SSE/AVX Pass by Ref or Value?

    I've had similar experiences. When ever I've tried to apply a micro optimization I've often found the compiler to have been already applying a better one Out of interest how much longer does your application take to compile with the intel optimizations turned on and off?
  14. wforl

    Wireless NAS with media player

    I don't want a streaming one because I dont want to have to leave a computer on for it to stream from.
  15. I was looking to see if there were any new books out based on C++11. I didn't find any, as its still early (Guess we'll have to give it a year or two), but I did find these coming out next year, thought I'd share. Effective Concurrency in C++ - Herb Sutter - 28 June 2012 Speaking of C++ - Herb Sutter - 28 June 2013 C++ Programming Language - Bjarne Stroustrup - 28 January 2012 C++ Templates - David Vandevoorde & Nocholai Josutti - 28 August 2012 The C++ Standard Library - Nocholai Josutti - 28 April 2012 ( Dates retrieved from www.BookDeposity.co.uk ) I'm personally looking forward to the new editions of the "The C++ Standard library" and "C++ Programming language". Going by this though, I wonder just how much code will actually compile in VS when they do come out ( assuming they are using C++ 11 )
  • 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!