webgpu support
This commit is contained in:
parent
5352ef69a2
commit
dedf6b0467
22 changed files with 1656 additions and 324 deletions
42
interfaces/Crafter.Graphics-GraphicsTypes.cppm
Normal file
42
interfaces/Crafter.Graphics-GraphicsTypes.cppm
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
Crafter®.Graphics
|
||||
Copyright (C) 2026 Catcrafts®
|
||||
catcrafts.net
|
||||
*/
|
||||
|
||||
// Backend-portable type aliases. NOT an abstraction layer — these are pure
|
||||
// `using` declarations that resolve to the backend's native types per the
|
||||
// active CRAFTER_GRAPHICS_WINDOW_* define.
|
||||
|
||||
module;
|
||||
#ifndef CRAFTER_GRAPHICS_WINDOW_DOM
|
||||
#include "vulkan/vulkan.h"
|
||||
#endif
|
||||
export module Crafter.Graphics:GraphicsTypes;
|
||||
|
||||
#ifndef CRAFTER_GRAPHICS_WINDOW_DOM
|
||||
import :VulkanBuffer;
|
||||
import :DescriptorHeapVulkan;
|
||||
import :ComputeShader;
|
||||
|
||||
export namespace Crafter {
|
||||
using GraphicsCommandBuffer = VkCommandBuffer;
|
||||
using GraphicsDescriptorHeap = DescriptorHeapVulkan;
|
||||
using GraphicsComputeShader = ComputeShader;
|
||||
template<class T, bool Mapped>
|
||||
using GraphicsBuffer = VulkanBuffer<T, Mapped>;
|
||||
}
|
||||
#else
|
||||
import :WebGPU;
|
||||
import :WebGPUBuffer;
|
||||
import :DescriptorHeapWebGPU;
|
||||
import :WebGPUComputeShader;
|
||||
|
||||
export namespace Crafter {
|
||||
using GraphicsCommandBuffer = WebGPUCommandEncoderRef;
|
||||
using GraphicsDescriptorHeap = DescriptorHeapWebGPU;
|
||||
using GraphicsComputeShader = WebGPUComputeShader;
|
||||
template<class T, bool Mapped>
|
||||
using GraphicsBuffer = WebGPUBuffer<T, Mapped>;
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue