WebGPU is the Future of Graphics Development, in D as Well

  • Platform and vendor independence matter almost equally much. You want your code to be portable seamlessly across operating systems, and you don’t want to wait for a new version of a high-level engine (that would probably also break your code) each time when you run into a bug or want to use functionality that otherwise could be added in a few minutes. Your own engine based on a standard graphics API gives you such flexibility. So directly using OpenGL is better that using a ready engine. The sad part is, OpenGL is not supported equally well on all platforms. It is also getting old, and it’s obvious that an “OpenGL way” of writing graphics code is currently at its dead end.
  • Vulkan may seem as a replacement for OpenGL, but actually it’s not. Due to the specificity of Vulkan’s architecture, it can’t be just “added” to an existing single-API engine. OpenGL functionality doesn’t map one-to-one to Vulkan. The way to go is to use a mid-level graphics library with API-specific code at the backend. Any big commercial engine already does it, but until recently there was no widely accepted standard for a middleware like that. And guess what — WebGPU has full potential to become such a standard!
WGPURenderPipelineDescriptor rpDesc = {
label: “Render pipeline”,
layout: pipelineLayout,
vertex: {
modul: shaderModule,
entryPoint: “vs_main”,
bufferCount: 0,
buffers: null
},
primitive: {
topology: WGPUPrimitiveTopology.TriangleList,
stripIndexFormat: WGPUIndexFormat.Undefined,
frontFace: WGPUFrontFace.CCW,
cullMode: WGPUCullMode.None
},
multisample: {
count: 1,
mask: ~0,
alphaToCoverageEnabled: false
},
fragment: &fs,
depthStencil: null
};

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store