Skip to content

Commit 37fab7d

Browse files
committed
Graphics: Removed OpenGL & OpenGL ES
1 parent 85d27f6 commit 37fab7d

101 files changed

Lines changed: 161 additions & 8959 deletions

File tree

Some content is hidden

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

.github/workflows/build-windows-runtime.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ on:
3434
options:
3535
- Direct3D11
3636
- Direct3D12
37-
- OpenGL
38-
- OpenGLES
3937
- Vulkan
4038
workflow_call:
4139
inputs:

build/Stride.build

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -177,22 +177,6 @@ Example of use:
177177
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StrideGraphicsApis=Direct3D12;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
178178
</Target>
179179

180-
<Target Name="BuildWindowsOpenGL">
181-
<PropertyGroup>
182-
<StrideRuntimeSolution>$(StrideRoot)build\Stride.Runtime.slnf</StrideRuntimeSolution>
183-
</PropertyGroup>
184-
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideRuntimeSolution);StrideGraphicsApis=OpenGL"/>
185-
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
186-
</Target>
187-
188-
<Target Name="BuildWindowsOpenGLES">
189-
<PropertyGroup>
190-
<StrideRuntimeSolution>$(StrideRoot)build\Stride.Runtime.slnf</StrideRuntimeSolution>
191-
</PropertyGroup>
192-
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideRuntimeSolution);StrideGraphicsApis=OpenGLES"/>
193-
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StrideGraphicsApis=OpenGLES;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
194-
</Target>
195-
196180
<Target Name="BuildAndroid">
197181
<PropertyGroup>
198182
<StrideAndroidSolution>$(StrideRoot)build\Stride.Android.slnf</StrideAndroidSolution>
@@ -232,7 +216,7 @@ Example of use:
232216
<StridePlatforms>Linux</StridePlatforms>
233217
</PropertyGroup>
234218
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideRuntimeSolution);StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
235-
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true;StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
219+
<MSBuild Targets="Build" Projects="$(StrideSolution).sln" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true;StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
236220
</Target>
237221

238222
<Target Name="BuildLinuxVulkan">
@@ -295,13 +279,13 @@ Example of use:
295279
</ItemGroup>
296280

297281
<ItemGroup>
298-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Engine.Tests\Stride.Engine.Tests-Signed.apk"/>
299-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Physics.Tests\Stride.Physics.Tests-Signed.apk"/>
300-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Audio.Tests\Stride.Audio.Tests-Signed.apk"/>
301-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Graphics.Tests.10_0\Stride.Graphics.Tests_10_0-Signed.apk"/>
302-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Graphics.Tests\Stride.Graphics.Tests-Signed.apk"/>
303-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Input.Tests\Stride.Input.Tests-Signed.apk"/>
304-
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Particles.Tests\Stride.Particles.Tests-Signed.apk"/>
282+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Engine.Tests\Stride.Engine.Tests-Signed.apk"/>
283+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Physics.Tests\Stride.Physics.Tests-Signed.apk"/>
284+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Audio.Tests\Stride.Audio.Tests-Signed.apk"/>
285+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Graphics.Tests.10_0\Stride.Graphics.Tests_10_0-Signed.apk"/>
286+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Graphics.Tests\Stride.Graphics.Tests-Signed.apk"/>
287+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Input.Tests\Stride.Input.Tests-Signed.apk"/>
288+
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Particles.Tests\Stride.Particles.Tests-Signed.apk"/>
305289
</ItemGroup>
306290

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

build/docs/SDK-GUIDE.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Use `git` to revert the project file changes (all 125 `.csproj` files). The dire
140140

141141
**Step 5 — Re-add `BuildSdk` target to `build/Stride.build`:**
142142

143-
Restore the target and add `DependsOnTargets="BuildSdk"` (or `BuildSdk;` prefix where multiple dependencies exist) to: `Build`, `BuildRuntime`, `BuildWindows`, `BuildWindowsDirect3D11`, `BuildWindowsDirect3D12`, `BuildWindowsOpenGL`, `BuildWindowsOpenGLES`, `BuildAndroid`, `BuildiOS`, `BuildUWP`, `BuildWindowsVulkan`, `BuildLinux`, `BuildLinuxVulkan`, `BuildmacOS`, `BuildLauncher`, `RunTestsWindows`, `RunTestsMobile`.
143+
Restore the target and add `DependsOnTargets="BuildSdk"` (or `BuildSdk;` prefix where multiple dependencies exist) to: `Build`, `BuildRuntime`, `BuildWindows`, `BuildWindowsDirect3D11`, `BuildWindowsDirect3D12`, `BuildAndroid`, `BuildiOS`, `BuildUWP`, `BuildWindowsVulkan`, `BuildLinux`, `BuildLinuxVulkan`, `BuildmacOS`, `BuildLauncher`, `RunTestsWindows`, `RunTestsMobile`.
144144

145145
```xml
146146
<!--
@@ -354,7 +354,7 @@ Stride.Build.Sdk/Sdk/Sdk.targets (top)
354354

355355
| Property | Purpose | Set by |
356356
|----------|---------|--------|
357-
| `StrideGraphicsApi` | Current API (Direct3D11, Direct3D12, OpenGL, OpenGLES, Vulkan) | Stride.Graphics.props (platform default) |
357+
| `StrideGraphicsApi` | Current API (Direct3D11, Direct3D12, Vulkan) | Stride.Graphics.props (platform default) |
358358
| `StrideGraphicsApis` | Semicolon-separated list of target APIs | Stride.Graphics.props |
359359
| `StrideDefaultGraphicsApi` | Default/fallback API for the platform | Stride.Graphics.props |
360360
| `StrideGraphicsApiDependent` | Enable multi-API inner builds | Project (.csproj) |
@@ -364,20 +364,18 @@ Stride.Build.Sdk/Sdk/Sdk.targets (top)
364364

365365
| Platform | Default | Available |
366366
|----------|---------|-----------|
367-
| Windows | Direct3D11 | Direct3D11, Direct3D12, OpenGL, OpenGLES, Vulkan |
368-
| Linux | OpenGL | OpenGL, Vulkan |
367+
| Windows | Direct3D11 | Direct3D11, Direct3D12,Vulkan |
368+
| Linux | Vulkan | Vulkan |
369369
| macOS | Vulkan | Vulkan |
370-
| Android | OpenGLES | OpenGLES, Vulkan |
371-
| iOS | OpenGLES | OpenGLES |
370+
| Android | VUlkan | Vulkan |
371+
| iOS | Vulkan | Vulkan |
372372

373373
**Graphics API defines** (added to `DefineConstants`):
374374

375375
| API | Defines |
376376
|-----|---------|
377377
| Direct3D11 | `STRIDE_GRAPHICS_API_DIRECT3D;STRIDE_GRAPHICS_API_DIRECT3D11` |
378378
| Direct3D12 | `STRIDE_GRAPHICS_API_DIRECT3D;STRIDE_GRAPHICS_API_DIRECT3D12` |
379-
| OpenGL | `STRIDE_GRAPHICS_API_OPENGL;STRIDE_GRAPHICS_API_OPENGLCORE` |
380-
| OpenGLES | `STRIDE_GRAPHICS_API_OPENGL;STRIDE_GRAPHICS_API_OPENGLES` |
381379
| Vulkan | `STRIDE_GRAPHICS_API_VULKAN` |
382380

383381
### Build Control

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
@@ -210,8 +210,6 @@ private void ChangeMaterial(int i)
210210
[SkippableFact]
211211
public void RunTestGame()
212212
{
213-
SkipTestForGraphicPlatform(GraphicsPlatform.OpenGL);
214-
SkipTestForGraphicPlatform(GraphicsPlatform.OpenGLES);
215213
SkipTestForGraphicPlatform(GraphicsPlatform.Vulkan);
216214
// Note: D3D12 WARP tessellation is limited to first frame only (see RegisterTests)
217215

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)