Skip to content

Commit 7474cc9

Browse files
committed
Graphics: Removed OpenGL & OpenGL ES
1 parent 7930259 commit 7474cc9

File tree

96 files changed

+80
-8915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+80
-8915
lines changed

build/Stride.Build.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,4 @@
88
<PropertyGroup Condition="'$(StridePlatform)' == 'Windows'">
99
<StrideGraphicsApis Condition="'$(StrideGraphicsApis)' == ''">Direct3D11</StrideGraphicsApis>
1010
</PropertyGroup>
11-
12-
<PropertyGroup Condition="'$(StridePlatform)' == 'Linux'">
13-
<StrideGraphicsApis Condition="'$(StrideGraphicsApis)' == ''">OpenGL</StrideGraphicsApis>
14-
</PropertyGroup>
1511
</Project>

build/Stride.UnitTests.Build.targets

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<!-- Build file pre-included by all Stride projects -->
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup Condition="'$(StridePlatform)' == 'Linux'">
4-
<StrideGraphicsApis Condition="'$(StrideGraphicsApis)' == ''">OpenGL</StrideGraphicsApis>
5-
</PropertyGroup>
63
<PropertyGroup Condition="'$(StridePlatform)' == 'Windows'">
74
<StrideGraphicsApis Condition="'$(StrideGraphicsApis)' == ''">Direct3D11</StrideGraphicsApis>
85
</PropertyGroup>

build/Stride.build

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,6 @@ Example of use:
171171
<MSBuild Targets="Build" Projects="$(StrideSolution).Runtime.sln" Properties="$(BuildProperties);StrideGraphicsApis=Direct3D12;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
172172
</Target>
173173

174-
<Target Name="BuildWindowsOpenGL">
175-
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideSolution).Runtime;StrideGraphicsApis=OpenGL"/>
176-
<MSBuild Targets="Build" Projects="$(StrideSolution).Runtime.sln" Properties="$(BuildProperties);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
177-
</Target>
178-
179-
<Target Name="BuildWindowsOpenGLES">
180-
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideSolution).Runtime;StrideGraphicsApis=OpenGLES"/>
181-
<MSBuild Targets="Build" Projects="$(StrideSolution).Runtime.sln" Properties="$(BuildProperties);StrideGraphicsApis=OpenGLES;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
182-
</Target>
183-
184174
<Target Name="BuildAndroid">
185175
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=Android;StrideSolution=$(StrideSolution).Android"/>
186176
<MSBuild Targets="Build" Projects="$(StrideSolution).Android.sln" Properties="$(BuildProperties);StridePlatforms=Android;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
@@ -211,7 +201,7 @@ Example of use:
211201
<StridePlatforms>Linux</StridePlatforms>
212202
</PropertyGroup>
213203
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideSolution);StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
214-
<MSBuild Targets="Build" Projects="$(StrideSolution).sln" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true;StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
204+
<MSBuild Targets="Build" Projects="$(StrideSolution).sln" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideGraphicsApis=Vulkan;StrideSkipAutoPack=true;StrideSkipUnitTests=true;StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
215205
</Target>
216206

217207
<Target Name="BuildLinuxVulkan">
@@ -271,13 +261,13 @@ Example of use:
271261
</ItemGroup>
272262

273263
<ItemGroup>
274-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Engine.Tests\Stride.Engine.Tests-Signed.apk"/>
275-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Physics.Tests\Stride.Physics.Tests-Signed.apk"/>
276-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Audio.Tests\Stride.Audio.Tests-Signed.apk"/>
277-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Graphics.Tests.10_0\Stride.Graphics.Tests_10_0-Signed.apk"/>
278-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Graphics.Tests\Stride.Graphics.Tests-Signed.apk"/>
279-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Input.Tests\Stride.Input.Tests-Signed.apk"/>
280-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Particles.Tests\Stride.Particles.Tests-Signed.apk"/>
264+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Engine.Tests\Stride.Engine.Tests-Signed.apk"/>
265+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Physics.Tests\Stride.Physics.Tests-Signed.apk"/>
266+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Audio.Tests\Stride.Audio.Tests-Signed.apk"/>
267+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Graphics.Tests.10_0\Stride.Graphics.Tests_10_0-Signed.apk"/>
268+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Graphics.Tests\Stride.Graphics.Tests-Signed.apk"/>
269+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Input.Tests\Stride.Input.Tests-Signed.apk"/>
270+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Particles.Tests\Stride.Particles.Tests-Signed.apk"/>
281271
</ItemGroup>
282272

283273
<Target Name="RunTestsMobile" DependsOnTargets="DownloadXunitRunnerConsole" Outputs="%(MobileUnitTestProject.Identity)">

sources/Directory.Packages.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
<PackageVersion Include="Silk.NET.Direct3D11" Version="2.22.0" />
2929
<PackageVersion Include="Silk.NET.Direct3D12" Version="2.22.0" />
3030
<PackageVersion Include="Silk.NET.Direct3D.Compilers" Version="2.22.0" />
31-
<PackageVersion Include="Silk.NET.OpenGL" Version="2.22.0" />
32-
<PackageVersion Include="Silk.NET.OpenGLES" Version="2.22.0" />
33-
<PackageVersion Include="Silk.NET.OpenGLES.Extensions.EXT" Version="2.22.0" />
3431
<PackageVersion Include="Silk.NET.OpenXR" Version="2.22.0" />
3532
<PackageVersion Include="Silk.NET.OpenXR.Extensions.FB" Version="2.22.0" />
3633
<PackageVersion Include="Silk.NET.Sdl" Version="2.22.0" />

sources/engine/Stride.Assets/AssetCompilerContextExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ public static GraphicsPlatform GetDefaultGraphicsPlatform(this PlatformType plat
4949
return GraphicsPlatform.Direct3D11;
5050
case PlatformType.Android:
5151
case PlatformType.iOS:
52-
return GraphicsPlatform.OpenGLES;
5352
case PlatformType.Linux:
54-
return GraphicsPlatform.OpenGL;
5553
case PlatformType.macOS:
5654
return GraphicsPlatform.Vulkan;
5755
default:

sources/engine/Stride.Assets/Effect/EffectBytecodeToSourceCodeWriter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ public static void Write(string name, CompilerParameters parameters, EffectBytec
6565
{
6666
GraphicsPlatform.Direct3D11 or
6767
GraphicsPlatform.Direct3D12 => "STRIDE_GRAPHICS_API_DIRECT3D",
68-
GraphicsPlatform.OpenGL => "STRIDE_GRAPHICS_API_OPENGLCORE",
69-
GraphicsPlatform.OpenGLES => "STRIDE_GRAPHICS_API_OPENGLES",
7068
GraphicsPlatform.Vulkan => "STRIDE_GRAPHICS_API_VULKAN",
7169

7270
_ => "undefined"

sources/engine/Stride.Assets/Textures/TextureHelper.cs

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
257257
{
258258
case GraphicsPlatform.Direct3D11:
259259
case GraphicsPlatform.Direct3D12:
260-
case GraphicsPlatform.OpenGL:
261260
case GraphicsPlatform.Vulkan:
262261

263262
// https://msdn.microsoft.com/en-us/library/windows/desktop/hh308955%28v=vs.85%29.aspx
@@ -296,11 +295,11 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
296295
// Support some specific optimized formats based on the hint or input type
297296
if (parameters.GraphicsProfile >= GraphicsProfile.Level_10_0)
298297
{
299-
if (parameters.GraphicsPlatform != GraphicsPlatform.OpenGL && hint == TextureHint.NormalMap)
298+
if (hint == TextureHint.NormalMap)
300299
{
301300
outputFormat = PixelFormat.BC5_UNorm;
302301
}
303-
else if (parameters.GraphicsPlatform != GraphicsPlatform.OpenGL && hint == TextureHint.Grayscale)
302+
else if (hint == TextureHint.Grayscale)
304303
{
305304
outputFormat = PixelFormat.BC4_UNorm;
306305
}
@@ -313,40 +312,8 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
313312
// TODO support the BC6/BC7 but they are so slow to compile that we can't use them right now
314313
}
315314
break;
316-
case GraphicsPlatform.OpenGLES: // OpenGLES on Windows
317-
if (inputImageFormat.IsHDR)
318-
{
319-
outputFormat = inputImageFormat;
320-
}
321-
else if (parameters.IsSRgb)
322-
{
323-
outputFormat = PixelFormat.R8G8B8A8_UNorm_SRgb;
324-
}
325-
else
326-
{
327-
switch (parameters.GraphicsProfile)
328-
{
329-
case GraphicsProfile.Level_9_1:
330-
case GraphicsProfile.Level_9_2:
331-
case GraphicsProfile.Level_9_3:
332-
outputFormat = alphaMode == AlphaFormat.None ? PixelFormat.ETC1 : PixelFormat.R8G8B8A8_UNorm;
333-
break;
334-
case GraphicsProfile.Level_10_0:
335-
case GraphicsProfile.Level_10_1:
336-
case GraphicsProfile.Level_11_0:
337-
case GraphicsProfile.Level_11_1:
338-
case GraphicsProfile.Level_11_2:
339-
// GLES3.0 starting from Level_10_0, this profile enables ETC2 compression on Android
340-
outputFormat = alphaMode == AlphaFormat.None ? PixelFormat.ETC1 : PixelFormat.ETC2_RGBA;
341-
break;
342-
default:
343-
throw new ArgumentOutOfRangeException("GraphicsProfile");
344-
}
345-
}
346-
break;
347315
default:
348-
// OpenGL on Windows
349-
// TODO: Need to handle OpenGL Desktop compression
316+
// Null platform
350317
outputFormat = parameters.IsSRgb ? PixelFormat.R8G8B8A8_UNorm_SRgb : PixelFormat.R8G8B8A8_UNorm;
351318
break;
352319
}
@@ -363,32 +330,6 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
363330
throw new ArgumentOutOfRangeException();
364331
}
365332

366-
// OpenGLES: avoid BGRA (optional extension)
367-
if (parameters.GraphicsPlatform == GraphicsPlatform.OpenGLES)
368-
{
369-
switch (outputFormat)
370-
{
371-
case PixelFormat.B8G8R8A8_UNorm:
372-
outputFormat = PixelFormat.R8G8B8A8_UNorm;
373-
break;
374-
case PixelFormat.B8G8R8A8_UNorm_SRgb:
375-
outputFormat = PixelFormat.R8G8B8A8_UNorm_SRgb;
376-
break;
377-
}
378-
}
379-
380-
// OpenGL and OpenGLES: avoid R5G6B5 (not implemented)
381-
if (parameters.GraphicsPlatform == GraphicsPlatform.OpenGLES || parameters.GraphicsPlatform == GraphicsPlatform.OpenGL)
382-
{
383-
switch (outputFormat)
384-
{
385-
case PixelFormat.B5G5R5A1_UNorm:
386-
case PixelFormat.B5G6R5_UNorm:
387-
outputFormat = PixelFormat.R8G8B8A8_UNorm;
388-
break;
389-
}
390-
}
391-
392333
return outputFormat;
393334
}
394335

sources/engine/Stride.Assets/WindowsGameSettingsProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public WindowsGameSettingsProfile()
2121

2222
public override IEnumerable<GraphicsPlatform> GetSupportedGraphicsPlatforms()
2323
{
24-
return new[] { GraphicsPlatform.Direct3D11, GraphicsPlatform.OpenGL, GraphicsPlatform.OpenGLES, };
24+
return [GraphicsPlatform.Direct3D11];
2525
}
2626
}
2727
}

sources/engine/Stride.Engine.Tests/TesselationTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ private void ChangeMaterial(int i)
201201
[SkippableFact]
202202
public void RunTestGame()
203203
{
204-
SkipTestForGraphicPlatform(GraphicsPlatform.OpenGL);
205-
SkipTestForGraphicPlatform(GraphicsPlatform.OpenGLES);
206204
SkipTestForGraphicPlatform(GraphicsPlatform.Vulkan);
207205

208206
RunGameTest(new TesselationTest());

sources/engine/Stride.Engine/Rendering/Compositing/ForwardRenderer.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,8 @@ protected override void InitializeCore()
138138
actualMultisampleCount = (MultisampleCount)Math.Min((int)actualMultisampleCount, (int)GraphicsDevice.Features[DepthBufferFormat].MultisampleCountMax);
139139

140140
// Note: we cannot support MSAA on DX10 now
141-
if (GraphicsDevice.Features.HasMultiSampleDepthAsSRV == false && // TODO: Try enabling MSAA on DX9!
142-
GraphicsDevice.Platform != GraphicsPlatform.OpenGL &&
143-
GraphicsDevice.Platform != GraphicsPlatform.OpenGLES)
141+
if (GraphicsDevice.Features.HasMultiSampleDepthAsSRV == false)
144142
{
145-
// OpenGL has MSAA support on every version.
146-
// OpenGL ES has MSAA support starting from version 3.0.
147143
// Direct3D has MSAA support starting from version 11 because it requires multisample depth buffers as shader resource views.
148144
// Therefore we force-disable MSAA on any platform that doesn't support MSAA.
149145

0 commit comments

Comments
 (0)