Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .github/workflows/build-linux-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,14 @@ on:
options:
- Debug
- Release
graphics-api:
description: Graphics API
default: OpenGL
type: choice
options:
- OpenGL
- Vulkan
workflow_call:
inputs:
build-type:
default: Debug
type: string
graphics-api:
default: OpenGL
type: string

concurrency:
group: build-linux-runtime-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}-${{ github.event.inputs.graphics-api || inputs.graphics-api || 'OpenGL' }}
group: build-linux-runtime-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
cancel-in-progress: true

jobs:
Expand All @@ -53,7 +43,7 @@ jobs:
#
Linux-Runtime:
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event.pull_request.draft == false }}
name: Build (${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}, ${{ github.event.inputs.graphics-api || inputs.graphics-api || 'OpenGL' }})
name: Build (${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }})
runs-on: windows-2025-vs2026
steps:
- uses: actions/checkout@v4
Expand All @@ -70,6 +60,5 @@ jobs:
-v:m -p:WarningLevel=0 `
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} `
-p:StridePlatforms=Linux `
-p:StrideGraphicsApis=${{ github.event.inputs.graphics-api || inputs.graphics-api || 'OpenGL' }} `
-p:StrideSkipUnitTests=true `
-p:StrideSkipAutoPack=true
2 changes: 0 additions & 2 deletions .github/workflows/build-windows-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ on:
options:
- Direct3D11
- Direct3D12
- OpenGL
- OpenGLES
- Vulkan
workflow_call:
inputs:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,16 @@ jobs:
strategy:
matrix:
build-type: [Release]
graphics-api: [OpenGL, Vulkan]
uses: ./.github/workflows/build-linux-runtime.yml
secrets: inherit
with:
build-type: ${{ matrix.build-type }}
graphics-api: ${{ matrix.graphics-api }}

Windows-Runtime:
strategy:
matrix:
build-type: [Release]
graphics-api: [Direct3D11, Direct3D12, OpenGL, OpenGLES, Vulkan]
graphics-api: [Direct3D11, Direct3D12, Vulkan]
uses: ./.github/workflows/build-windows-runtime.yml
secrets: inherit
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ jobs:
-restore -m:1 -nr:false \
-v:m -p:WarningLevel=0 \
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type }} \
-p:StridePlatforms=Linux \
-p:StrideGraphicsApis=OpenGL \
-p:StridePlatforms=Linux
# This step isn't needed, it lists the NuGet sources again
# - name: Inspect NuGet Local Sources (always)
# if: always()
Expand Down
41 changes: 8 additions & 33 deletions build/Stride.build
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,6 @@ Example of use:
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StrideGraphicsApis=Direct3D12;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
</Target>

<Target Name="BuildWindowsOpenGL">
<PropertyGroup>
<StrideRuntimeSolution>$(StrideRoot)build\Stride.Runtime.slnf</StrideRuntimeSolution>
</PropertyGroup>
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideRuntimeSolution);StrideGraphicsApis=OpenGL"/>
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
</Target>

<Target Name="BuildWindowsOpenGLES">
<PropertyGroup>
<StrideRuntimeSolution>$(StrideRoot)build\Stride.Runtime.slnf</StrideRuntimeSolution>
</PropertyGroup>
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideRuntimeSolution);StrideGraphicsApis=OpenGLES"/>
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StrideGraphicsApis=OpenGLES;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
</Target>

<Target Name="BuildAndroid">
<PropertyGroup>
<StrideAndroidSolution>$(StrideRoot)build\Stride.Android.slnf</StrideAndroidSolution>
Expand Down Expand Up @@ -232,16 +216,7 @@ Example of use:
<StridePlatforms>Linux</StridePlatforms>
</PropertyGroup>
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideRuntimeSolution);StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true;StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
</Target>

<Target Name="BuildLinuxVulkan">
<PropertyGroup>
<StrideRuntimeSolution>$(StrideRoot)build\Stride.Runtime.slnf</StrideRuntimeSolution>
<StridePlatforms>Linux</StridePlatforms>
</PropertyGroup>
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideRuntimeSolution);StrideGraphicsApis=Vulkan"/>
<MSBuild Targets="Build" Projects="$(StrideRuntimeSolution)" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideGraphicsApis=Vulkan;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
<MSBuild Targets="Build" Projects="$(StrideSolution).sln" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideSkipAutoPack=true;StrideSkipUnitTests=true;StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
</Target>

<Target Name="BuildmacOS">
Expand Down Expand Up @@ -295,13 +270,13 @@ Example of use:
</ItemGroup>

<ItemGroup>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Engine.Tests\Stride.Engine.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Physics.Tests\Stride.Physics.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Audio.Tests\Stride.Audio.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Graphics.Tests.10_0\Stride.Graphics.Tests_10_0-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Graphics.Tests\Stride.Graphics.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Input.Tests\Stride.Input.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\OpenGLES\Stride.Particles.Tests\Stride.Particles.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Engine.Tests\Stride.Engine.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Physics.Tests\Stride.Physics.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Audio.Tests\Stride.Audio.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Graphics.Tests.10_0\Stride.Graphics.Tests_10_0-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Graphics.Tests\Stride.Graphics.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Input.Tests\Stride.Input.Tests-Signed.apk"/>
<MobileUnitTestApk Include="$(StrideRoot)\Bin\Android\Tests\Vulkan\Stride.Particles.Tests\Stride.Particles.Tests-Signed.apk"/>
</ItemGroup>

<Target Name="RunTestsMobile" DependsOnTargets="DownloadXunitRunnerConsole" Outputs="%(MobileUnitTestProject.Identity)">
Expand Down
14 changes: 6 additions & 8 deletions build/docs/SDK-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Use `git` to revert the project file changes (all 125 `.csproj` files). The dire

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

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`.
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`, `BuildmacOS`, `BuildLauncher`, `RunTestsWindows`, `RunTestsMobile`.

```xml
<!--
Expand Down Expand Up @@ -354,7 +354,7 @@ Stride.Build.Sdk/Sdk/Sdk.targets (top)

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

| Platform | Default | Available |
|----------|---------|-----------|
| Windows | Direct3D11 | Direct3D11, Direct3D12, OpenGL, OpenGLES, Vulkan |
| Linux | OpenGL | OpenGL, Vulkan |
| Windows | Direct3D11 | Direct3D11, Direct3D12,Vulkan |
| Linux | Vulkan | Vulkan |
| macOS | Vulkan | Vulkan |
| Android | OpenGLES | OpenGLES, Vulkan |
| iOS | OpenGLES | OpenGLES |
| Android | VUlkan | Vulkan |
| iOS | Vulkan | Vulkan |

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

| API | Defines |
|-----|---------|
| Direct3D11 | `STRIDE_GRAPHICS_API_DIRECT3D;STRIDE_GRAPHICS_API_DIRECT3D11` |
| Direct3D12 | `STRIDE_GRAPHICS_API_DIRECT3D;STRIDE_GRAPHICS_API_DIRECT3D12` |
| OpenGL | `STRIDE_GRAPHICS_API_OPENGL;STRIDE_GRAPHICS_API_OPENGLCORE` |
| OpenGLES | `STRIDE_GRAPHICS_API_OPENGL;STRIDE_GRAPHICS_API_OPENGLES` |
| Vulkan | `STRIDE_GRAPHICS_API_VULKAN` |

### Build Control
Expand Down
3 changes: 0 additions & 3 deletions sources/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
<PackageVersion Include="Silk.NET.Direct3D11" Version="2.22.0" />
<PackageVersion Include="Silk.NET.Direct3D12" Version="2.22.0" />
<PackageVersion Include="Silk.NET.Direct3D.Compilers" Version="2.22.0" />
<PackageVersion Include="Silk.NET.OpenGL" Version="2.22.0" />
<PackageVersion Include="Silk.NET.OpenGLES" Version="2.22.0" />
<PackageVersion Include="Silk.NET.OpenGLES.Extensions.EXT" Version="2.22.0" />
<PackageVersion Include="Silk.NET.OpenXR" Version="2.22.0" />
<PackageVersion Include="Silk.NET.OpenXR.Extensions.FB" Version="2.22.0" />
<PackageVersion Include="Silk.NET.Sdl" Version="2.22.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ public static GraphicsPlatform GetDefaultGraphicsPlatform(this PlatformType plat
return GraphicsPlatform.Direct3D11;
case PlatformType.Android:
case PlatformType.iOS:
return GraphicsPlatform.OpenGLES;
case PlatformType.Linux:
return GraphicsPlatform.OpenGL;
case PlatformType.macOS:
return GraphicsPlatform.Vulkan;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public static void Write(string name, CompilerParameters parameters, EffectBytec
{
GraphicsPlatform.Direct3D11 or
GraphicsPlatform.Direct3D12 => "STRIDE_GRAPHICS_API_DIRECT3D",
GraphicsPlatform.OpenGL => "STRIDE_GRAPHICS_API_OPENGLCORE",
GraphicsPlatform.OpenGLES => "STRIDE_GRAPHICS_API_OPENGLES",
GraphicsPlatform.Vulkan => "STRIDE_GRAPHICS_API_VULKAN",

_ => "undefined"
Expand Down
65 changes: 3 additions & 62 deletions sources/engine/Stride.Assets/Textures/TextureHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
{
case GraphicsPlatform.Direct3D11:
case GraphicsPlatform.Direct3D12:
case GraphicsPlatform.OpenGL:
case GraphicsPlatform.Vulkan:

// https://msdn.microsoft.com/en-us/library/windows/desktop/hh308955%28v=vs.85%29.aspx
Expand Down Expand Up @@ -296,11 +295,11 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
// Support some specific optimized formats based on the hint or input type
if (parameters.GraphicsProfile >= GraphicsProfile.Level_10_0)
{
if (parameters.GraphicsPlatform != GraphicsPlatform.OpenGL && hint == TextureHint.NormalMap)
if (hint == TextureHint.NormalMap)
{
outputFormat = PixelFormat.BC5_UNorm;
}
else if (parameters.GraphicsPlatform != GraphicsPlatform.OpenGL && hint == TextureHint.Grayscale)
else if (hint == TextureHint.Grayscale)
{
outputFormat = PixelFormat.BC4_UNorm;
}
Expand All @@ -313,40 +312,8 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
// TODO support the BC6/BC7 but they are so slow to compile that we can't use them right now
}
break;
case GraphicsPlatform.OpenGLES: // OpenGLES on Windows
if (inputImageFormat.IsHDR)
{
outputFormat = inputImageFormat;
}
else if (parameters.IsSRgb)
{
outputFormat = PixelFormat.R8G8B8A8_UNorm_SRgb;
}
else
{
switch (parameters.GraphicsProfile)
{
case GraphicsProfile.Level_9_1:
case GraphicsProfile.Level_9_2:
case GraphicsProfile.Level_9_3:
outputFormat = alphaMode == AlphaFormat.None ? PixelFormat.ETC1 : PixelFormat.R8G8B8A8_UNorm;
break;
case GraphicsProfile.Level_10_0:
case GraphicsProfile.Level_10_1:
case GraphicsProfile.Level_11_0:
case GraphicsProfile.Level_11_1:
case GraphicsProfile.Level_11_2:
// GLES3.0 starting from Level_10_0, this profile enables ETC2 compression on Android
outputFormat = alphaMode == AlphaFormat.None ? PixelFormat.ETC1 : PixelFormat.ETC2_RGBA;
break;
default:
throw new ArgumentOutOfRangeException("GraphicsProfile");
}
}
break;
default:
// OpenGL on Windows
// TODO: Need to handle OpenGL Desktop compression
// Null platform
outputFormat = parameters.IsSRgb ? PixelFormat.R8G8B8A8_UNorm_SRgb : PixelFormat.R8G8B8A8_UNorm;
break;
}
Expand All @@ -363,32 +330,6 @@ public static PixelFormat DetermineOutputFormat(ImportParameters parameters, Siz
throw new ArgumentOutOfRangeException();
}

// OpenGLES: avoid BGRA (optional extension)
if (parameters.GraphicsPlatform == GraphicsPlatform.OpenGLES)
{
switch (outputFormat)
{
case PixelFormat.B8G8R8A8_UNorm:
outputFormat = PixelFormat.R8G8B8A8_UNorm;
break;
case PixelFormat.B8G8R8A8_UNorm_SRgb:
outputFormat = PixelFormat.R8G8B8A8_UNorm_SRgb;
break;
}
}

// OpenGL and OpenGLES: avoid R5G6B5 (not implemented)
if (parameters.GraphicsPlatform == GraphicsPlatform.OpenGLES || parameters.GraphicsPlatform == GraphicsPlatform.OpenGL)
{
switch (outputFormat)
{
case PixelFormat.B5G5R5A1_UNorm:
case PixelFormat.B5G6R5_UNorm:
outputFormat = PixelFormat.R8G8B8A8_UNorm;
break;
}
}

return outputFormat;
}

Expand Down
2 changes: 1 addition & 1 deletion sources/engine/Stride.Assets/WindowsGameSettingsProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public WindowsGameSettingsProfile()

public override IEnumerable<GraphicsPlatform> GetSupportedGraphicsPlatforms()
{
return new[] { GraphicsPlatform.Direct3D11, GraphicsPlatform.OpenGL, GraphicsPlatform.OpenGLES, };
return [GraphicsPlatform.Direct3D11];
}
}
}
2 changes: 0 additions & 2 deletions sources/engine/Stride.Engine.Tests/TesselationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ private void ChangeMaterial(int i)
[SkippableFact]
public void RunTestGame()
{
SkipTestForGraphicPlatform(GraphicsPlatform.OpenGL);
SkipTestForGraphicPlatform(GraphicsPlatform.OpenGLES);
SkipTestForGraphicPlatform(GraphicsPlatform.Vulkan);
// Note: D3D12 WARP tessellation is limited to first frame only (see RegisterTests)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,8 @@ protected override void InitializeCore()
actualMultisampleCount = (MultisampleCount)Math.Min((int)actualMultisampleCount, (int)GraphicsDevice.Features[DepthBufferFormat].MultisampleCountMax);

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

Expand Down
Loading
Loading