CreateTexture2D fails for GeForce GTX 280 user

Started by
15 comments, last by captain_crunch 7 years, 3 months ago

Seasonal greetings,

My game uses MonoGame for Windows desktop and one Windows 7 user gets an error every time when creating a 2D rendertarget:


HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.

Line: 0

at SharpDX.Result.CheckError()
at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut)
at Microsoft.Xna.Framework.Graphics.Texture2D.CreateTexture()
at Microsoft.Xna.Framework.Graphics.RenderTarget2D.GenerateIfRequired()

The user has Win7 SP1 and also this patch:

https://support.microsoft.com/da-dk/kb/2670838

which is supposed to help, but doesn't.

I found the patch in this thread: https://steamcommunity.com/app/498240/discussions/0/360671352681600886/

Chip type: GeForce GTX 280

Any ideas??

Advertisement

Can you post the texture description struct please?

In all likelihood this is absolutely nothing to do with the OS version and absolutely everything to do with hardware capabilities. The GeForce GTX 280 is a very old GPU, and you may be trying to create a texture that is too large for it, for example.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Thanks, I will look into the capabilities of that card, I didn't realize it was that old.

I think the texture size in the call is equal to the resolution, 1440 * 900. In the method that crashes I am creating all the rendertargets that the game needs for its various processing, about 10.



DiffuseMSRenderTarget = new RenderTarget2D(device,
                 width, height, false,
                  pp.BackBufferFormat, pp.DepthStencilFormat, pp.MultiSampleCount, RenderTargetUsage.PreserveContents);


            // resolve target - not needed?
            diffuseRenderTarget = new RenderTarget2D(device, width, height, false,
                pp.BackBufferFormat, pp.DepthStencilFormat, 0, RenderTargetUsage.PreserveContents);
            
            


            edgeDetectNormalDepthRenderTarget = new RenderTarget2D(device,
                                                         width, height, false,
                                                         pp.BackBufferFormat, pp.DepthStencilFormat, 0, RenderTargetUsage.PreserveContents);




            // no depth buffer, no multisampling!
            shadowRenderTarget = new RenderTarget2D(device,
                width, height, false,
                pp.BackBufferFormat, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);


            // no depth buffer, no multisampling!
            diffuseFinalRenderTarget = new RenderTarget2D(device,
                width, height, false,
                pp.BackBufferFormat, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);


            emissiveModelLightRenderTarget = new RenderTarget2D(device,
                width, height, false,
                pp.BackBufferFormat, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);


            emissiveModelLightDistanceRenderTarget = new RenderTarget2D(device,
                width, height, false, SurfaceFormat.Rg32
                , DepthFormat.None, 0, RenderTargetUsage.DiscardContents);


            DistanceHeightAndBillboardAlphaRenderTarget = new RenderTarget2D(device,
                   width, height, false, SurfaceFormat.Rgba1010102, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);

I suspect it's one of the SurfaceFormats, or the multisampling that is causing the error. However I cannot find the specs with supported formats anywhere.

The GeForce 200 series dates to 2008/2009 and is desupported since April 2016. It's a 7/8 year old GPU and is Direct3D 10/10.1 capable, not 11, so if using 11 you will need to use feature levels to access the downlevel functionality.

So in other words, you should restrict your code to Direct3D 10/10.1 capabilities. Try to do something that's only available in Direct3D 11 or higher and it will fail.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Thanks. I used the XNA/MonoGame HiDef profile to try to avoid these issues...

I wrote on the store page, under requirements: DirectX 10 capable graphics card

I guess that isn't accurate enough. However, I don't want to recode the graphics now. Perhaps it is best to require DirectX 11 then..?

Message: The parameter is incorrect
What are the parameters?

Message: The parameter is incorrect
What are the parameters?

I only have the callstack and the code that causes it, I cannot repro the error.

I'm guessing width is 1440, height is 900 and the other parameters are constant as seen in the code snippet.

Even if you can't reproduce the error, you should still be able to pin down the call that works on every other PC but this one. What we're all interested in this is part:


SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, .....

E_INVALIDARG means that one or more of the members of descRef is not valid on that PC, but without seeing what those members are, it's difficult to say any more.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement