From f3a8fbb0d338b721f4b7be97b5fc4464e5eea757 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Mon, 11 Jul 2022 08:07:24 -0700 Subject: [PATCH] gpu: add SType enum Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 25 ------------------------- gpu/src/types.zig | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index d506ead8..96096115 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,30 +1,5 @@ typedef uint32_t WGPUFlags; -typedef enum WGPUSType { - WGPUSType_Invalid = 0x00000000, - WGPUSType_SurfaceDescriptorFromMetalLayer = 0x00000001, - WGPUSType_SurfaceDescriptorFromWindowsHWND = 0x00000002, - WGPUSType_SurfaceDescriptorFromXlibWindow = 0x00000003, - WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004, - WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005, - WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006, - WGPUSType_PrimitiveDepthClipControl = 0x00000007, - WGPUSType_SurfaceDescriptorFromWaylandSurface = 0x00000008, - WGPUSType_SurfaceDescriptorFromAndroidNativeWindow = 0x00000009, - WGPUSType_SurfaceDescriptorFromWindowsCoreWindow = 0x0000000B, - WGPUSType_ExternalTextureBindingEntry = 0x0000000C, - WGPUSType_ExternalTextureBindingLayout = 0x0000000D, - WGPUSType_SurfaceDescriptorFromWindowsSwapChainPanel = 0x0000000E, - WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F, - WGPUSType_DawnTextureInternalUsageDescriptor = 0x000003E8, - WGPUSType_PrimitiveDepthClampingState = 0x000003E9, - WGPUSType_DawnTogglesDeviceDescriptor = 0x000003EA, - WGPUSType_DawnEncoderInternalUsageDescriptor = 0x000003EB, - WGPUSType_DawnInstanceDescriptor = 0x000003EC, - WGPUSType_DawnCacheDeviceDescriptor = 0x000003ED, - WGPUSType_Force32 = 0x7FFFFFFF -} WGPUSType; - typedef enum WGPUSamplerBindingType { WGPUSamplerBindingType_Undefined = 0x00000000, WGPUSamplerBindingType_Filtering = 0x00000001, diff --git a/gpu/src/types.zig b/gpu/src/types.zig index 431a1d4f..ae354c8c 100644 --- a/gpu/src/types.zig +++ b/gpu/src/types.zig @@ -209,6 +209,30 @@ pub const RequestDeviceStatus = enum(u32) { unknown = 0x00000002, }; +pub const SType = enum(u32) { + invalid = 0x00000000, + surface_descriptor_from_metal_layer = 0x00000001, + surface_descriptor_from_windows_hwnd = 0x00000002, + surface_descriptor_from_xlib_window = 0x00000003, + surface_descriptor_from_canvas_html_selector = 0x00000004, + shader_module_spirv_descriptor = 0x00000005, + shader_module_wgsl_descriptor = 0x00000006, + primitive_depth_clip_control = 0x00000007, + surface_descriptor_from_wayland_surface = 0x00000008, + surface_descriptor_from_android_native_window = 0x00000009, + surface_descriptor_from_windows_core_window = 0x0000000B, + external_texture_binding_entry = 0x0000000C, + external_texture_binding_layout = 0x0000000D, + surface_descriptor_from_windows_swap_chain_panel = 0x0000000E, + render_pass_descriptor_max_draw_count = 0x0000000F, + dawn_texture_internal_usage_descriptor = 0x000003E8, + primitive_depth_clamping_state = 0x000003E9, + dawn_toggles_device_descriptor = 0x000003EA, + dawn_encoder_internal_usage_descriptor = 0x000003EB, + dawn_instance_descriptor = 0x000003EC, + dawn_cache_device_descriptor = 0x000003ED, +}; + test "BackendType name" { try testing.expectEqualStrings("Vulkan", BackendType.vulkan.name()); }