locked
Direct3D viewport problem on MS Surface

    Question

  • Hi,
    I am having some problems with D3D viewports.
    My app works fine on a PC, but I have tested on a MS Surface (ARM cpu, Windows 8 RT) and got a wrong behaviour when any part of the viewport goes offscreen.
    I use a viewport, for example, when I have a virtual keyboard on screen and want to scroll it to enter/leave the screen.

    I am using a D3D11_VIEWPORT struct and setting it with RSSetViewports().
    As I said, the app is fine on PC, but on MS Surface, when the viewport goes offscreen on the right margin I see part of the viewport appearing on the left margin.
    It also has problems when setting negative coordinates for the viewport.

    Is it some issue with D3D viewports on the Surface? Something about the video driver?
    Is it that the viewports just can't go outside the screen on the Surface?

    Thanks
    Friday, March 08, 2013 3:56 PM

Answers

  • For Feature Level 9.x devices, negative values are unsupported (and should return a failure HRESULT for your call to RSSetViewports). See the Remarks on the D3D11_VIEWPORT doc page: http://msdn.microsoft.com/en-us/library/ff476260(v=vs.85).aspx . Note also that "In all cases, Width and Height must be >= 0 and TopLeftX + Width and TopLeftY + Height must be <= D3D11_VIEWPORT_BOUNDS_MAX". If you are exceeding D3D11_VIEWPORT_BOUNDS_MAX then that could be the source of your problem.

    For behaviors that might differ in 10level9, you should generally check the entries on the 10level9 Reference page for ID3D11Device and ID3D11DeviceContext: http://msdn.microsoft.com/en-us/library/ff476148(v=vs.85).aspx . The device context page notes that negatives are unsupported in its entry for RSSetViewports.


    XNA/DirectX MVP | Website | Blog | @mikebmcl

    Tuesday, March 12, 2013 2:52 AM

All replies

  • Hi

    This is a Spanish Forum, I'm moving your thread to the correct Forum so they can help you get a response as fast as they can

    Regards


    Recuerda proponer o marcar toda respuesta que haya solucionado tu consulta, votar como útil o agradecer
    al usuario que te proporciono la mejor opción para asi apoyar a nuestra comunidad y esta siga creciendo.


    Omar Ortiz Suárez
    Microsoft Contingent Staff
    Mexico City

    Monday, March 11, 2013 7:17 PM
  • For Feature Level 9.x devices, negative values are unsupported (and should return a failure HRESULT for your call to RSSetViewports). See the Remarks on the D3D11_VIEWPORT doc page: http://msdn.microsoft.com/en-us/library/ff476260(v=vs.85).aspx . Note also that "In all cases, Width and Height must be >= 0 and TopLeftX + Width and TopLeftY + Height must be <= D3D11_VIEWPORT_BOUNDS_MAX". If you are exceeding D3D11_VIEWPORT_BOUNDS_MAX then that could be the source of your problem.

    For behaviors that might differ in 10level9, you should generally check the entries on the 10level9 Reference page for ID3D11Device and ID3D11DeviceContext: http://msdn.microsoft.com/en-us/library/ff476148(v=vs.85).aspx . The device context page notes that negatives are unsupported in its entry for RSSetViewports.


    XNA/DirectX MVP | Website | Blog | @mikebmcl

    Tuesday, March 12, 2013 2:52 AM