Skip to content

Veldrid Backend (Windows:D3D, Vulkan, OpenGL) (Android:Vulkan)#14

Open
jeske wants to merge 10 commits into
SilkCommunity:mainfrom
jeske:veldrid_backend_2
Open

Veldrid Backend (Windows:D3D, Vulkan, OpenGL) (Android:Vulkan)#14
jeske wants to merge 10 commits into
SilkCommunity:mainfrom
jeske:veldrid_backend_2

Conversation

@jeske

@jeske jeske commented Mar 10, 2026

Copy link
Copy Markdown

I saw that you didn't merge the other Veldrid backend from Redhacker1.

This one is quite a bit different (completely separate implementation), so perhaps you'll be interested in merging it. If not, I'm using and maintaining it anyway.

NOTE: i made one change to the Demo code, with a SetFileLoader() delegate, to support loading image resources using the Android apk API rather than from raw files for the Android Example.

  1. This implementation defaults to the actively maintained ppy.Veldrid fork maintained created by osu! (though it supports building for legacy veldrid as well)
  2. This implementation does build-time shader compile, so Veldrid.SPIRV is not a 5MB dependency at runtime.
  3. This implementation does not use an uber-shader, but more veldrid idiomatic small shaders. (arguably better for modern graphics, worse for opengl pipeline changes, simpler either way)

This has been tested to work on:

  • Windows 11: D3D, Vulkan, OpenGL
  • Android:Vulkan

HOPEFULLY SOON: OSX/iOS Metal1, Android:GLES

NOTE: To make Veldrid:OpenGL work with precompiled shaders i had to fix a rather insidious bug in the Veldrid.SPIRV shader compiler, so i've decided to check in the generated shader output to relieve people from having to get a fixed Veldrid.SPIRV compiler. For more info see: veldrid/veldrid-spirv#8


Screenshots

Below is the native SilkNvg OpenGL backend on top, with Veldrid:Vulkan lower left, and Veldrid:D3D lower right. Note that as these are all running simultaneously, don't read anything into the perf numbers. The Veldrid versions perform about the same (within 0-10% slower situationally).

image

Here is the new "Veldrid Android Example" using Vulkan running on a samsung Galaxy S22 Ultra. Frametime is about double what it is on my Desktop AMD 7950X3D + 5080, which seems about as expected.

image

Here is the Veldrid:OpenGL backend:

image

Here is Veldrid:Android:GLES backend (requires ppy/veldrid#71 ):

image

@jeske jeske changed the title Veldrid Backend (tested on Win:D3D, Win:Vulkan, Android:Vulkan) Veldrid Backend (Windows:D3D, Vulkan, OpenGL) (Android:Vulkan) Mar 10, 2026
@MatijaBrown

Copy link
Copy Markdown
Collaborator

This looks pretty good to me. I don't remember the one by Redhacker1, but I probably just didn't see it. I'm currently doing a bit of work on Silky myself after a few years again and will definitely be merging this!
Thanks for offering it up.

- skip compiling up to date shaders
- support GLES startup in Android Example
- both android and vulkan backends working and showing the backend in a label

requires patched ppy.Veldrid backend
  - see [Pull #71](ppy/veldrid#71)
@jeske

jeske commented Mar 15, 2026

Copy link
Copy Markdown
Author

fixed up the Android Example to work on Android GLES.. (but it requires patches to ppy.Veldrid, see ppy/veldrid#71

@jeske

jeske commented Mar 19, 2026

Copy link
Copy Markdown
Author

FYI - i have an important (small) bugfix coming for my Veldrid backend to properly support multi-window (which i just didn't test in the example).. should get it here today or tomoorow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants