I am trying to create a rendertarget with a format of Bgra4444
This results in a backing Texture2D being created with a directX format of B4G4R4A4_UNorm
Which crashes on the line “return new SharpDX.Direct3D11.Texture2D(GraphicsDevice._d3dDevice, desc);”
in the method “internal override SharpDX.Direct3D11.Resource CreateTexture()”
in the “Texture2D.DirectX.cs” file.
I am using a version of monogame from about 1 week ago from the main dev branch.
I am building for windows UWP, and running on a machine with a GeForce 960.
I have created a graphics device with all the featureLevels from Level_9_1 to Level_10_1 inclusive.
The error is:
Exception thrown: ‘SharpDX.SharpDXException’ in SharpDX.dll
An exception of type ‘SharpDX.SharpDXException’ occurred in SharpDX.dll but was not handled in user code
Additional information: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.
Any help in getting this fixed would be very appreciated, any suggestions of workarounds to get this working would be great. I would rather keep these textures in memory as the 4444 format as there is about 200mb of them which is significant and due to the nature of these textures there is almost zero quality loss with using 4444, and using a DXT format makes them look horrible due to the block compression.
I have made an issue on the monogame GitHub about it below.
Not really… it works both ways, I/We/Those whom currently do not use the dev branch waste less time reading a post about dev branch, and they get people who are familiar with the dev branch… and willing to help.
I have submitted a PR (#5340) that implements the fallback to SurfaceFormat.Color for render targets if the preferredFormat is not supported, and similar for the preferredDepthFormat. This is what XNA did anyway if the requested format wasn’t supported, so we’re not losing functionality here.