3 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGL
25 using System.Collections.Generic;
26 using OpenTK.Graphics;
27 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGLES
28 using OpenTK.Graphics.ES30;
30 using OpenTK.Graphics.OpenGL;
33 namespace SiliconStudio.
Paradox.Graphics
41 public partial
struct GraphicsDeviceFeatures
43 internal string Vendor;
44 internal string Renderer;
45 internal IList<string> SupportedExtensions;
47 internal GraphicsDeviceFeatures(GraphicsDevice deviceRoot)
50 if (deviceRoot.versionMajor > 4)
51 Profile = GraphicsProfile.Level_11_0;
52 else if (deviceRoot.versionMajor > 3 && deviceRoot.versionMinor > 3)
53 Profile = GraphicsProfile.Level_10_0;
55 Profile = GraphicsProfile.Level_9_1;
57 mapFeaturesPerFormat =
new FeaturesPerFormat[256];
61 using (deviceRoot.UseOpenGLCreationContext())
63 Vendor = GL.GetString(StringName.Vendor);
64 Renderer = GL.GetString(StringName.Renderer);
65 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGLES
66 SupportedExtensions = GL.GetString(StringName.Extensions).Split(
' ');
69 GL.GetInteger(GetPName.NumExtensions, out numExtensions);
70 SupportedExtensions =
new string[numExtensions];
71 for (
int extensionIndex = 0; extensionIndex < numExtensions; ++extensionIndex)
73 SupportedExtensions[extensionIndex] = GL.GetString(StringName.Extensions, extensionIndex);
78 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_OPENGLES
79 deviceRoot.HasDepth24 = SupportedExtensions.Contains(
"GL_OES_depth24");
80 deviceRoot.HasPackedDepthStencilExtension = SupportedExtensions.Contains(
"GL_OES_packed_depth_stencil");
81 deviceRoot.HasExtTextureFormatBGRA8888 = SupportedExtensions.Contains(
"GL_EXT_texture_format_BGRA8888")
82 || SupportedExtensions.Contains(
"GL_APPLE_texture_format_BGRA8888");
83 deviceRoot.HasVAO = SupportedExtensions.Contains(
"GL_OES_vertex_array_object");
85 deviceRoot.HasVAO =
true;
89 HasComputeShaders = deviceRoot.versionMajor > 4 && deviceRoot.versionMinor > 3;
90 HasDoublePrecision = SupportedExtensions.Contains(
"GL_ARB_vertex_attrib_64bit");
91 HasDriverCommandLists =
false;
92 HasMultiThreadingConcurrentResources =
false;