Issue with viewports using negative coordinates

Hi everyone,
I’m coding a game that uses viewports on Windows 10. Everything works perfectly, except that I tested it on a PC with Windows 7 and I found that everything that is drawn on a viewport with negative coordinates does not appear on the screen.
I created a new project from scratch to make sure there is no mistake who knows where and I only changed the Draw method like this:

    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.CornflowerBlue);

        Viewport defaultViewport = GraphicsDevice.Viewport;
        GraphicsDevice.Viewport = new Viewport(50, 50, 1000, 500);
        if (Keyboard.GetState().IsKeyDown(Keys.Space))
        {
            GraphicsDevice.Viewport = new Viewport(-50, 50, 1000, 500);
        }

        spriteBatch.Begin();
        spriteBatch.Draw(tex, new Vector2(0, 0), Color.White);
        spriteBatch.End();

        GraphicsDevice.Viewport = defaultViewport;

        base.Draw(gameTime);
    }

On Windows 10 there are no problems: the viewport is moved horizontally by 50 and vertically by 50 or horizontally by -50 by pressing Space and the image appears normally. While on Windows 7 the image appears if I press nothing but disappears completely when I press space.
Some idea?

I discovered another thing: the same code works perfectly on a Cross Platform Desktop project instead of a Windows project…

Hi Luca,

To offset your vertices/sprites by -50 pixels move the camera/View by +50 pixels.

Setting a viewport outside the backbuffer was never supposed to work.

Ok. I’ll avoid using it that way then.
Thanks

It looks like it dependents on the DX featureLevel - or the OpenGL version - and of course on the video card capabilities.

I assume the win7 drivers doesn’t support higher than DX9 level - or the GL equivalent.

You can try setting the profile to HiDef , if you haven’t already tried that to see what happens, this will create a device of featurelevel 10 or higher.
Although that’s not exactly right either as the HiDef actually should correspond to 9_3 and not 10.
Or it could be that simply DX11 or the card driver is buggy on win7.