Veldrid 4.2.0-beta1
Today, Veldrid 4.2.0-beta1 is available. This is a fairly large update with several exciting new features. Additionally, there are many bug fixes and performance improvements. Due to the volume of changes, I'm planning to gather some feedback with this beta version before marking it as stable.
OpenGL ES Support
A fully-featured OpenGL ES backend has been added. This backend can be used on both Android and iOS, as well as on certain desktop platforms, provided the drivers and operating system support it. It is very similar to the existing OpenGL backend, and several changes and improvements have been made to the OpenGL backend as a result of this new support.
Veldrid requires at least OpenGL ES version 3.0. Some optional features, like compute shaders, require higher versions of OpenGL ES.
Android Support
Veldrid now supports Android through the Vulkan and OpenGL ES backends. Vulkan remains a fairly advanced feature for current Android devices, but it will become more common in the future. OpenGL ES is supported by the majority of current Android devices.
A Veldrid GraphicsDevice can be created through an Android Surface or SurfaceView. Use the SwapchainSource.CreateAndroidSurface() function to create a SwapchainSource for the given application view. Then, you can use GraphicsDevice.CreateOpenGLES() or GraphicsDevice.CreateVulkan(), depending on what your device supports.
GraphicsDevice Capabilities
Although Veldrid aims to be as portable as possible, there are a number of places where differences between different systems and API's cannot be cleanly hidden. Additionally, all graphics API's enforce specific limitations on how the API can be used. Without knowledge of these limitations at runtime, it's difficult to write code that is guaranteed to work portably. This version of Veldrid introduces several GraphicsDevice members informing you about the limitations of the current system.
- GraphicsDeviceFeatures -- Enumerates the optional features supported by a GraphicsDevice.
- bool GetPixelFormatSupport() -- Queries whether the current GraphicsDevice supports the given PixelFormat.
- PixelFormatProperties -- Describes the limits of a Texture's dimensions and other properties if created with the given PixelFormat, TextureType, and TextureUsage flags.
Change List
New Features
Add support for OpenGL ES [c9103d3] [78eff33] [e41591d] [77588d4] [2edc075] [aaf1cd2]
- New GraphicsBackend member: GraphicsBackend.OpenGLES
- New GraphicsDevice creation method: public static GraphicsDevice CreateOpenGLES(GraphicsDeviceOptions options, SwapchainDescription swapchainDescription)
Add GraphicsDeviceFeatures, a class for querying specific device features. [2889a11] [49d4b92] [71166c0]
Add a query function for PixelFormat support. [c5301e3]
Add ResourceBindingModel.Improved, with better handling of Metal buffer resources. (@tgjones) [b1e35c2] [e52bd08] [dd8adb5] [452cf45] [db293b1]
Add support for ETC2 formats. [c288fe5]
- New PixelFormat members:
ETC2_R8_G8_B8_UNorm
,ETC2_R8_G8_B8_A1_UNorm
,ETC2_R8_G8_B8_A8_UNorm
- New PixelFormat members:
Misc Changes
- Fix the equality and hash code implementations of several Description structs. [fe20ccf]
- [D3D11] Fix a synchronization issue related to the access of shared resources. [dab068e]
- Update SDL2 binaries to 2.0.8. [c03e69b] [d512245]
- [OpenGL] Improve multisample texture extension handling. [f0b94a3]
- [Veldrid.ImageSharp] Update to ImageSharp beta0003. [7128134]
- Add [UnmanagedFunctionPointer] to all OpenGL function definitions. This fixes an issue when using mono AOT. [d41c9af]
- [Vulkan] Fix several validation warnings and errors. [31ac583]
- [Vulkan] Handle cases where VkSurfaceCapabilitiesKHR.maxImageCount is 0. [3c0f9a6]
- [Vulkan] Detect when a Swapchain has become invalid and throw a VeldridException. [66b9326]
- [Vulkan] Change VkMemoryBlock into a struct. [4b908fa]
- Add missing depth buffer formats to the OpenGL backend (@feliwir) [e525d94].
- [Metal] Use a different "drawPrimitives" overload when instanceStart == 0. [cb2c4a1]
- Fix OpenGL context initialization with SDL2. [c011b50]
- [OpenGL] Fix sampler maximum LOD parameter. [25db1e0]
- [Vulkan] Fix a Veldrid validation issue when a shared Vulkan staging Texture is re-used as a different format. [b1cbac3]
- [Vulkan] Improve how shared VkCommandPools are recycled. [a1ce176]