locked
Can the XAML SurfaceImageSource DirectX interop sample ( Win 8 version ) work on the Win 8.1 ?

    Question

  • I use VS2012(Win 8) to yield the installed file and it is installed on Win 8.1. 

    The XAML SurfaceImageSource DirectX interop sample ( Win 8.0 version ) can't work on Win 8.1.

    I mean DirectX 3D. The result is a background and don't have a cubic. 

    Then, I use OS Win8.1 and VS2013. 

    I had tried the XAML SurfaceImageSource DirectX interop sample ( Win 8.1 version ) on Win8.1. 

    The result  have a background and a cubic. 

    Anyone know what happen ?

    Why XAML SurfaceImageSource DirectX interop sample ( Win 8.0 version ) don't have a cubic on Win 8.1 ?






    • Edited by KC-Steven Tuesday, July 22, 2014 1:11 AM
    Tuesday, July 22, 2014 1:07 AM

Answers

  • Hi,

    I think it's a bug in that sample. You should set DepthStencilView's size to be the same as RenderTargetView's size.

    // Begin drawing - returns a target surface and an offset to use as the top left origin when drawing.
        HRESULT beginDrawHR = m_sisNative->BeginDraw(updateRectNative, &surface, &offset);
    
    	DXGI_SURFACE_DESC surfaceDesc;
    
    	DX::ThrowIfFailed(
    		surface->GetDesc(&surfaceDesc)
    		);
    
    // Create depth/stencil buffer descriptor.
        CD3D11_TEXTURE2D_DESC depthStencilDesc(
            DXGI_FORMAT_D24_UNORM_S8_UINT, 
    		surfaceDesc.Width,
    		surfaceDesc.Height,
            1,
            1,
            D3D11_BIND_DEPTH_STENCIL,
    		D3D11_USAGE_DEFAULT,
    		0,
    		1,
    		0
            );


    • Edited by Bo Song Tuesday, July 29, 2014 5:28 AM
    • Marked as answer by KC-Steven Wednesday, July 30, 2014 1:51 AM
    Tuesday, July 29, 2014 4:46 AM

All replies

  • I just created a Windows 8 DirectX 3D app on my 8.1 machine and it worked fine.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, July 22, 2014 12:27 PM
    Moderator
  • This is my situation about Win8 Version.

    and below Win8.1 Version. The cubic is showed in this version.

    Monday, July 28, 2014 1:20 AM
  • I can't find the old sample on MSDN - can you post a link to it here?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, July 28, 2014 2:33 PM
    Moderator
  • This is the old sample.

    http://code.msdn.microsoft.com/windowsapps/Windows-8-app-samples-4d76cbbf

     I select the C++ sample.



    • Edited by KC-Steven Tuesday, July 29, 2014 1:21 AM
    Tuesday, July 29, 2014 12:41 AM
  • Hi,

    I think it's a bug in that sample. You should set DepthStencilView's size to be the same as RenderTargetView's size.

    // Begin drawing - returns a target surface and an offset to use as the top left origin when drawing.
        HRESULT beginDrawHR = m_sisNative->BeginDraw(updateRectNative, &surface, &offset);
    
    	DXGI_SURFACE_DESC surfaceDesc;
    
    	DX::ThrowIfFailed(
    		surface->GetDesc(&surfaceDesc)
    		);
    
    // Create depth/stencil buffer descriptor.
        CD3D11_TEXTURE2D_DESC depthStencilDesc(
            DXGI_FORMAT_D24_UNORM_S8_UINT, 
    		surfaceDesc.Width,
    		surfaceDesc.Height,
            1,
            1,
            D3D11_BIND_DEPTH_STENCIL,
    		D3D11_USAGE_DEFAULT,
    		0,
    		1,
    		0
            );


    • Edited by Bo Song Tuesday, July 29, 2014 5:28 AM
    • Marked as answer by KC-Steven Wednesday, July 30, 2014 1:51 AM
    Tuesday, July 29, 2014 4:46 AM
  • Thank you very much.

    It's my pleasure to meet you.

    Wednesday, July 30, 2014 1:57 AM