public static class WebGpuConversionsThe RHI's vocabulary in WebGPU's terms.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Every one of these is a pure function of its argument, so the whole of the backend's decision-making is testable without an implementation, a driver or a browser — which is most of what a backend gets wrong.
Where WebGPU has no equivalent the substitution is named here and only here, with what it costs. Three of them are worth knowing before reading any further: ToWebGpu has nowhere to put a border colour, ToWebGpu has no "do not care", and ToWebGpu is not a cast — WebGPU numbers Immediate and Mailbox the other way round from the RHI, and a cast there silently swaps tearing for frame-dropping.
Methods (31)
public static WgpuBufferUsage ToWebGpu(BufferUsage usage, MemoryAccess access)What a buffer has to be created with, given what it is for and where it lives.
public static WgpuTextureUsage ToWebGpu(TextureUsage usage)What a texture has to be created with.
public static WgpuTextureDimension ToWebGpu(TextureDimension dimension)The WebGPU texture dimension for one of ours.
public static WgpuTextureViewDimension ToViewDimension(TextureDimension dimension, int arrayLayers)How a view of a texture is read.
public static WgpuShaderStage ToWebGpu(ShaderStage stages)Which stages a binding is visible to, in WebGPU's terms.
public static WgpuCompareFunction ToWebGpu(CompareFunction compare)The WebGPU comparison for one of ours.
public static WgpuStencilOperation ToWebGpu(StencilOperation operation)The WebGPU stencil operation for one of ours.
public static WgpuCullMode ToWebGpu(CullMode cull)The WebGPU cull mode for one of ours.
public static WgpuFrontFace ToWebGpu(FrontFace face)The WebGPU winding for one of ours.
public static WgpuPrimitiveTopology ToWebGpu(PrimitiveTopology topology)The WebGPU topology for one of ours.
public static bool IsStrip(PrimitiveTopology topology)Whether a topology is a strip, and therefore needs a strip index format.
public static WgpuIndexFormat ToWebGpu(IndexFormat format)The WebGPU index format for one of ours.
public static WgpuAddressMode ToWebGpu(AddressMode mode)The WebGPU address mode for one of ours.
public static WgpuFilterMode ToWebGpu(FilterMode filter)The WebGPU filter for one of ours.
public static WgpuMipmapFilterMode ToMipmapFilter(FilterMode filter)The WebGPU mip filter for one of ours.
public static WgpuBlendFactor ToWebGpu(BlendFactor factor)The WebGPU blend factor for one of ours.
public static WgpuBlendOperation ToWebGpu(BlendOperation operation)The WebGPU blend operation for one of ours.
public static WgpuColorWriteMask ToWebGpu(ColourWriteMask mask)The WebGPU write mask for one of ours.
public static WgpuLoadOp ToWebGpu(LoadAction load)The WebGPU load operation for one of ours.
public static WgpuStoreOp ToWebGpu(StoreAction store)The WebGPU store operation for one of ours.
public static WgpuPresentMode ToWebGpu(PresentMode mode)The WebGPU present mode for one of ours.
public static SwapChainStatus ToEngine(WgpuSurfaceStatus status, bool suboptimal)What a surface acquisition means to the RHI.
public static WgpuTextureSampleType ToWebGpu(DescriptorSampleType sampleType)How a sampled texture's texels are read, for the layout that declares the binding.
public static WgpuSamplerBindingType ToSamplerBinding(DescriptorSampleType sampleType)What a sampler binding does, for the layout that declares it.
public static WgpuBindGroupLayoutEntry ToWebGpu(in DescriptorBinding binding)What a descriptor binding is, in WebGPU's terms.
public static WgpuBufferDescriptor ToWebGpu(in BufferDescription description)What to create a WebGPU buffer as, for one of ours.
public static WgpuTextureDescriptor ToWebGpu(in TextureDescription description)What to create a WebGPU texture as, for one of ours.
public static WgpuSamplerDescriptor ToWebGpu(in SamplerDescription description, bool anisotropySupported)What to create a WebGPU sampler as, for one of ours.
public static WgpuColourTargetState ToWebGpu(in ColourTargetState target)The blend equation to build a colour target from.
public static WgpuDepthStencilState ToWebGpu(in DepthStencilState state, PixelFormat format, in RasterizerState rasterizer)The depth-stencil state to build a pipeline from.
public static WgpuStencilFaceState ToWebGpu(in StencilFaceState face)The stencil face state for one of ours.
Used by (5)
- WebGpuCommandListVixen.Graphics.WebGPU
- WebGpuConversionTestsVixen.Graphics.WebGPU.Tests
- WebGpuDeviceVixen.Graphics.WebGPU
- WebGpuEnumAgreementTestsVixen.Graphics.WebGPU.Tests
- WebGpuSwapChainVixen.Graphics.WebGPU