Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
4 changes: 0 additions & 4 deletions build/Stride.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
<PropertyGroup Condition="'$(StridePlatform)' == 'Windows'">
<StrideGraphicsApis Condition="'$(StrideGraphicsApis)' == ''">Direct3D11</StrideGraphicsApis>
</PropertyGroup>

<PropertyGroup Condition="'$(StridePlatform)' == 'Linux'">
<StrideGraphicsApis Condition="'$(StrideGraphicsApis)' == ''">OpenGL</StrideGraphicsApis>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be removed and set to Vulkan instead

Copy link
Copy Markdown
Member Author

@xen2 xen2 Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally did it on purpose, because Linux now had only a single Graphics API, not multiple, so it was supposedly set by StrideGraphicsApi (without a s).
However I noticed some other issue with this system so currently reviewing the changes.
I might revert them for now.

</PropertyGroup>
</Project>
3 changes: 0 additions & 3 deletions build/Stride.UnitTests.Build.targets
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<!-- Build file pre-included by all Stride projects -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(StridePlatform)' == 'Linux'">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here

<StrideGraphicsApis Condition="'$(StrideGraphicsApis)' == ''">OpenGL</StrideGraphicsApis>
</PropertyGroup>
<PropertyGroup Condition="'$(StridePlatform)' == 'Windows'">
<StrideGraphicsApis Condition="'$(StrideGraphicsApis)' == ''">Direct3D11</StrideGraphicsApis>
</PropertyGroup>
Expand Down
26 changes: 8 additions & 18 deletions build/Stride.build
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,6 @@ Example of use:
<MSBuild Targets="Build" Projects="$(StrideSolution).Runtime.sln" Properties="$(BuildProperties);StrideGraphicsApis=Direct3D12;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
</Target>

<Target Name="BuildWindowsOpenGL">
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideSolution).Runtime;StrideGraphicsApis=OpenGL"/>
<MSBuild Targets="Build" Projects="$(StrideSolution).Runtime.sln" Properties="$(BuildProperties);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
</Target>

<Target Name="BuildWindowsOpenGLES">
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideSolution).Runtime;StrideGraphicsApis=OpenGLES"/>
<MSBuild Targets="Build" Projects="$(StrideSolution).Runtime.sln" Properties="$(BuildProperties);StrideGraphicsApis=OpenGLES;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
</Target>

<Target Name="BuildAndroid">
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=Android;StrideSolution=$(StrideSolution).Android"/>
<MSBuild Targets="Build" Projects="$(StrideSolution).Android.sln" Properties="$(BuildProperties);StridePlatforms=Android;StrideSkipAutoPack=true;StrideSkipUnitTests=true"/>
Expand Down Expand Up @@ -211,7 +201,7 @@ Example of use:
<StridePlatforms>Linux</StridePlatforms>
</PropertyGroup>
<MSBuild Targets="Restore" Projects="$(MSBuildThisFileFullPath)" Properties="StridePlatforms=$(StridePlatforms);StrideSolution=$(StrideSolution);StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
<MSBuild Targets="Build" Projects="$(StrideSolution).sln" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideGraphicsApis=OpenGL;StrideSkipAutoPack=true;StrideSkipUnitTests=true;StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
<MSBuild Targets="Build" Projects="$(StrideSolution).sln" Properties="$(BuildProperties);StridePlatforms=$(StridePlatforms);StrideGraphicsApis=Vulkan;StrideSkipAutoPack=true;StrideSkipUnitTests=true;StrideGraphicsApiDependentBuildAll=$(StrideGraphicsApiDependentBuildAll)"/>
</Target>

<Target Name="BuildLinuxVulkan">
Expand Down Expand Up @@ -271,13 +261,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
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 @@ -201,8 +201,6 @@ private void ChangeMaterial(int i)
[SkippableFact]
public void RunTestGame()
{
SkipTestForGraphicPlatform(GraphicsPlatform.OpenGL);
SkipTestForGraphicPlatform(GraphicsPlatform.OpenGLES);
SkipTestForGraphicPlatform(GraphicsPlatform.Vulkan);

RunGameTest(new TesselationTest());
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
2 changes: 1 addition & 1 deletion sources/engine/Stride.Games/Android/GamePlatformAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public override List<GraphicsDeviceInformation> FindBestDevices(GameGraphicsPara

public override void DeviceChanged(GraphicsDevice currentDevice, GraphicsDeviceInformation deviceInformation)
{
// TODO: Check when it needs to be disabled on iOS (OpenGL)?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment mentions iOS on a file named GamePlatformAndroid. Is this correct?

// TODO: Check when it needs to be disabled on Android?
// Force to resize the gameWindow
//gameWindow.Resize(deviceInformation.PresentationParameters.BackBufferWidth, deviceInformation.PresentationParameters.BackBufferHeight);
}
Expand Down
2 changes: 1 addition & 1 deletion sources/engine/Stride.Games/GameContextWinforms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public GameContextWinforms(Control control, int requestedWidth = 0, int requeste

private static Form CreateForm()
{
#if !STRIDE_GRAPHICS_API_OPENGL && !STRIDE_GRAPHICS_API_NULL
#if !STRIDE_GRAPHICS_API_NULL
return new GameForm();
#else
// Not Reachable.
Expand Down
1 change: 0 additions & 1 deletion sources/engine/Stride.Games/Stride.Games.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<Compile Include="..\..\shared\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Stride.Graphics\OpenGL\OpenGLUtils.cs" Link="OpenGLUtils.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Stride.Graphics\Stride.Graphics.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion sources/engine/Stride.Games/iOS/GamePlatformiOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public override List<GraphicsDeviceInformation> FindBestDevices(GameGraphicsPara

public override void DeviceChanged(GraphicsDevice currentDevice, GraphicsDeviceInformation deviceInformation)
{
// TODO: Check when it needs to be disabled on iOS (OpenGL)?
// TODO: Check when it needs to be disabled on iOS?
// Force to resize the gameWindow
//gameWindow.Resize(deviceInformation.PresentationParameters.BackBufferWidth, deviceInformation.PresentationParameters.BackBufferHeight);
}
Expand Down
14 changes: 0 additions & 14 deletions sources/engine/Stride.Graphics.Regression/RegressionHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ public static ImageTestResultConnection GetDefaultImageTestResultConnection()
result.DeviceName = "Direct3D12";
#elif STRIDE_GRAPHICS_API_DIRECT3D11
result.DeviceName = "Direct3D";
#elif STRIDE_GRAPHICS_API_OPENGLES
result.DeviceName = "OpenGLES";
#elif STRIDE_GRAPHICS_API_OPENGL
result.DeviceName = "OpenGL";
#elif STRIDE_GRAPHICS_API_VULKAN
result.DeviceName = "Vulkan";
#endif
Expand Down Expand Up @@ -96,10 +92,6 @@ public static string GetPlatformName(TestPlatform platform)
{
case TestPlatform.WindowsDx:
return "Windows_Direct3D11";
case TestPlatform.WindowsOgl:
return "Windows_OpenGL";
case TestPlatform.WindowsOgles:
return "Windows_OpenGLES";
case TestPlatform.Android:
return "Android";
case TestPlatform.Ios:
Expand All @@ -119,10 +111,6 @@ public static TestPlatform GetPlatform()
return TestPlatform.None;
#elif STRIDE_GRAPHICS_API_DIRECT3D
return TestPlatform.WindowsDx;
#elif STRIDE_GRAPHICS_API_OPENGLES
return TestPlatform.WindowsOgles;
#elif STRIDE_GRAPHICS_API_OPENGL
return TestPlatform.WindowsOgl;
#elif STRIDE_GRAPHICS_API_VULKAN
return TestPlatform.WindowsVulkan;
#endif
Expand Down Expand Up @@ -182,8 +170,6 @@ public enum TestPlatform
{
None,
WindowsDx,
WindowsOgl,
WindowsOgles,
WindowsVulkan,
Android,
Ios
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FOR /F "skip=1" %%D IN ('adb devices') DO (
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe C:\Projects\Stride\sources\engine\Stride.Graphics.RegressionTests\Stride.Graphics.RegressionTests.Android.csproj /p:SolutionName=Stride.Android;SolutionDir=C:\Projects\Stride\ /t:Install /p:AdbTarget="-s %%D"

REM install the package -> should be done by bamboo too?
REM adb -s %%D -d install -r C:\Projects\Stride\Bin\Android-AnyCPU-OpenGLES\Stride.Graphics.RegressionTests-Signed.apk
REM adb -s %%D -d install -r C:\Projects\Stride\Bin\Android-AnyCPU-Vulkan\Stride.Graphics.RegressionTests-Signed.apk

REM run it
adb -s %%D shell am start -a android.intent.action.MAIN -n Stride.Graphics.RegressionTests/stride.graphics.regressiontests.Program -e STRIDE_SERVER_IP %1 -e STRIDE_SERVER_PORT %2 -e STRIDE_BUILD_NUMBER %3
Expand All @@ -29,7 +29,7 @@ adb -s %4 am shell force-stop Stride.Graphics.RegressionTests
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe C:\Projects\Stride\sources\engine\Stride.Graphics.RegressionTests\Stride.Graphics.RegressionTests.Android.csproj /p:SolutionName=Stride.Android;SolutionDir=C:\Projects\Stride\ /t:Install /p:AdbTarget="-s %4"

REM install the package -> should be done by bamboo too?
REM adb -s %%D -d install -r C:\Projects\Stride\Bin\Android-AnyCPU-OpenGLES\Stride.Graphics.RegressionTests-Signed.apk
REM adb -s %%D -d install -r C:\Projects\Stride\Bin\Android-AnyCPU-Vulkan\Stride.Graphics.RegressionTests-Signed.apk

REM run it
adb -s %4 shell am start -a android.intent.action.MAIN -n Stride.Graphics.RegressionTests/stride.graphics.regressiontests.Program -e STRIDE_SERVER_IP %1 -e STRIDE_SERVER_PORT %2 -e STRIDE_BUILD_NUMBER %3 -e STRIDE_DEVICE_SERIAL %4
adb -s %4 shell am start -a android.intent.action.MAIN -n Stride.Graphics.RegressionTests/stride.graphics.regressiontests.Program -e STRIDE_SERVER_IP %1 -e STRIDE_SERVER_PORT %2 -e STRIDE_BUILD_NUMBER %3 -e STRIDE_DEVICE_SERIAL %4
Loading