We are currently developing a C# application for windows. The application uses MonoGame for the graphical output and should ideally run on a large variety of different hardware. Therefore, we try to stick to the Reach profile.
However, we would like to add some optional features, such as FXAA, which require shader level 5.0, and would require us to use the HighDef profile, potentially causing errors in older hardware.
Hence my question: Is there a way to programmatically check the hardware capability with respect to supported shader level and / or supported profile?
For XNA, there existed for example the following method:
GraphicsAdapter.IsProfileSupported.
Also, one could use
GraphicsDeviceCapabilities
to check for hardware support. So far, I have not been able to find a working solution in MonoGame and would be very happy about any hint in the right direction.
Create the GraphicsDeviceManager and then check GraphicsDeviceManager.GraphicsProfile. The GraphicsDeviceManager should automatically choose HiDef if the hardware supports it.
You could also create a GraphicsDevice directly and specify HiDef in its constructor. It should throw a NotSupportedException on Reach hardware.
I tried some combinations, but it does not seem to work. I guess my problem lies a bit deeper.
Specifically, I apparently need Shader Model 5.0 (DX11) support, which would definitely be HiDef. However, also Shader Model 3 and above all already HiDef, hence I run into trouble.
So, my initial question was not posed correctly. Instead, I would need to check for the supported shader model / directX version programmatically. Do you know of any way to do so?
Note: FXAA 3.11 (which was newest version last time I checked) runs without problem on Shader Model 4.0. On windows (directX) you are looking for Direct Feature Level/Limit. Difference here isnĀ“t only shader model but for instance maximum count of samplers and size of textures (just another note). As far as OpenGL version goes I have no clue.
I tried to compile FXAA 3.11 with ps_4_0_level_9_1, but failed. Interestingly, ps_4_0 does work. I suppose it has to do with the apparent back-compatibility of ps_4_0_level_9_1 with shader model 2?