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.


MikeBMcL

Member Since 06 Sep 2012
Offline Last Active Oct 29 2013 08:32 AM

Posts I've Made

In Topic: Stereoscopic 3D - how to create a swapchain

06 February 2013 - 03:01 AM

Try changing

 

    if(FAILED(m_dxgiFactory->CreateSwapChainForHwnd(
        m_device,
        p_hWnd,
        &m_swapChainDesc,
        &m_swapChainFullscreenDesc,
        m_dxgiOutput,
        m_swapChain.ptr())))
        throw "Failed to create DXGI swap chain";

 

to

 

    HRESULT hr;
    hr = m_dxgiFactory->CreateSwapChainForHwnd(
        m_device,
        p_hWnd,
        &m_swapChainDesc,
        &m_swapChainFullscreenDesc,
        m_dxgiOutput,
        m_swapChain.ptr());

    if (FAILED(hr))
    {
        std::stringstream str;
        str << "Failed to create DXGI swap chain. HR: 0x" << std::hex << std::uppercase << static_cast<unsigned long>(hr) << std::endl;
        OutputDebugStringA(str.str().c_str());
        throw str.str().c_str();
    }

 



Note that you'll need to #include <string> <sstream> <ios> and <ostream>. Also, I'd generally recommend throwing C++ standard library-based exceptions rather than raw ASCII strings and working in Unicode (e.g. L"Something" rather than "Something") along with the corresponding wide character variants of the STL functionality (e.g. std::wstringstream) and Windows API calls (OutputDebugStringW).

Once you have the HRESULT code from the swap chain failure, you'll potentially have much more information than just that the call failed.

At a guess, what's probably going on based on the code you provided you are passing in for the HWND a parameter named "p_hWnd". If that's really a pointer to an HWND, you should be passing in "*p_hWnd" since the API call is expecting an HWND, not a pointer to one.

Also, from the documentation - http://msdn.microsoft.com/en-us/library/hh768891(v=vs.85).aspx , you are calling m_dxgiFactory->IsWindowedStereoEnabled to check for stereo support but this just tells you whether or not you can render a windowed app in stereo. The proper check for a full screen app is to call IDXGIOutput1::GetDisplayModeList1 and see if any of the returned modes supports stereo. You are doing that anyway but your initial call to IsWindowedStereoEnabled is superfluous and might even improperly exclude stereo if the card didn't support windowed stereo with its current settings but would support full screen stereo.


In Topic: Deferred shading - problems with point lights

08 November 2012 - 07:31 PM

Try changing line 50 to:

float dotProduct = abs(dot(lightDirection, normalize(normal)));

In Topic: Understanding Buffer, Texture, and Sampler "registers"

08 November 2012 - 07:20 PM

You can, yes, though it's probably better to just use an include file for common structs and define the shader-specific buffers in each shader's HLSL file. Or are you planning to put all of the shaders into one file?

(Note: By "you can" I mean that I tested compiling a vertex and pixel shader with two cbuffers both assigned to register(b0) where only one of those cbuffers is used and that I received no compile errors using the built-in shader compilation with VS 2012 and the Windows 8 SDK; you might have different results if you compile using an older version of fxc even though it should in theory work fine. It's not super hard to test so if you are using an older fxc, just try it and see what happens.).

In Topic: Enter key does nothing using IE 10 (i.e. no line breaks)

08 November 2012 - 02:09 PM

The only other forums I regularly use are the forums at http://xboxforums.create.msdn.com/ and they do not suffer from this issue. Also, if I switch IE to compatibility mode then I can use the enter key in IE here. But that messes up some other alignments. I dug further and noticed that the http://public.gamedev.net/public/js/3rd_party/ckeditor/ckeditor.js file is doing version checking (rather than feature checking) and doesn't have a check for IE 10 so its possible that that is the problem (or partially it, or related to being it).

In Topic: Virtual DirectCompute

08 November 2012 - 12:01 PM

If you use a WARP device then you can run compute shaders. It's a lot faster than a ref device but still may fall flat on its face in terms of real performance. So I'd be leery of doing it without some heavy perf testing on low-end and older hardware.It could end up being a lot faster to do those calculations CPU-side using DirectXMath (or other vector math functionality) and parallelization (e.g. PPL's parallel_for and parallel_for_each) without being a huge time-sink in terms of writing and maintaining the separate code path for non-compute class hardware.

PARTNERS