diff --git a/ffi/wgpu.h b/ffi/wgpu.h index ce9c7589..c65aa023 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -29,6 +29,31 @@ typedef enum WGPUNativeFeature { WGPUNativeFeature_PipelineStatisticsQuery = 0x00030008, WGPUNativeFeature_StorageResourceBindingArray = 0x00030009, WGPUNativeFeature_PartiallyBoundBindingArray = 0x0003000A, + WGPUNativeFeature_TextureFormat16bitNorm = 0x0003000B, + WGPUNativeFeature_TextureCompressionAstcHdr = 0x0003000C, + // TODO: requires wgpu.h api change + // WGPUNativeFeature_TimestampQueryInsidePasses = 0x0003000D, + WGPUNativeFeature_MappablePrimaryBuffers = 0x0003000E, + WGPUNativeFeature_BufferBindingArray = 0x0003000F, + WGPUNativeFeature_UniformBufferAndStorageTextureArrayNonUniformIndexing = 0x00030010, + // TODO: requires wgpu.h api change + // WGPUNativeFeature_AddressModeClampToZero = 0x00030011, + // WGPUNativeFeature_AddressModeClampToBorder = 0x00030012, + // WGPUNativeFeature_PolygonModeLine = 0x00030013, + // WGPUNativeFeature_PolygonModePoint = 0x00030014, + // WGPUNativeFeature_ConservativeRasterization = 0x00030015, + // WGPUNativeFeature_ClearTexture = 0x00030016, + // WGPUNativeFeature_SpirvShaderPassthrough = 0x00030017, + // WGPUNativeFeature_Multiview = 0x00030018, + WGPUNativeFeature_VertexAttribute64bit = 0x00030019, + WGPUNativeFeature_ShaderUnusedVertexOutput = 0x0003001A, + WGPUNativeFeature_TextureFormatNv12 = 0x0003001B, + WGPUNativeFeature_RayTracingAccelerationStructure = 0x0003001C, + WGPUNativeFeature_RayQuery = 0x0003001D, + WGPUNativeFeature_ShaderF64 = 0x0003001E, + WGPUNativeFeature_ShaderI16 = 0x0003001F, + WGPUNativeFeature_ShaderPrimitiveIndex = 0x00030020, + WGPUNativeFeature_ShaderEarlyDepthTest = 0x00030021, WGPUNativeFeature_Force32 = 0x7FFFFFFF } WGPUNativeFeature; diff --git a/src/conv.rs b/src/conv.rs index d1915e28..fccae55c 100644 --- a/src/conv.rs +++ b/src/conv.rs @@ -1115,6 +1115,79 @@ pub fn features_to_native(features: wgt::Features) -> Vec Option { native::WGPUNativeFeature_PipelineStatisticsQuery => Some(Features::PIPELINE_STATISTICS_QUERY), native::WGPUNativeFeature_StorageResourceBindingArray => Some(Features::STORAGE_RESOURCE_BINDING_ARRAY), native::WGPUNativeFeature_PartiallyBoundBindingArray => Some(Features::PARTIALLY_BOUND_BINDING_ARRAY), + native::WGPUNativeFeature_TextureFormat16bitNorm => Some(Features::TEXTURE_FORMAT_16BIT_NORM), + native::WGPUNativeFeature_TextureCompressionAstcHdr => Some(Features::TEXTURE_COMPRESSION_ASTC_HDR), + // TODO: requires wgpu.h api change + // native::WGPUNativeFeature_TimestampQueryInsidePasses => Some(Features::TIMESTAMP_QUERY_INSIDE_PASSES), + native::WGPUNativeFeature_MappablePrimaryBuffers => Some(Features::MAPPABLE_PRIMARY_BUFFERS), + native::WGPUNativeFeature_BufferBindingArray => Some(Features::BUFFER_BINDING_ARRAY), + native::WGPUNativeFeature_UniformBufferAndStorageTextureArrayNonUniformIndexing => Some(Features::UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING), + // TODO: requires wgpu.h api change + // native::WGPUNativeFeature_AddressModeClampToZero => Some(Features::ADDRESS_MODE_CLAMP_TO_ZERO), + // native::WGPUNativeFeature_AddressModeClampToBorder => Some(Features::ADDRESS_MODE_CLAMP_TO_BORDER), + // native::WGPUNativeFeature_PolygonModeLine => Some(Features::POLYGON_MODE_LINE), + // native::WGPUNativeFeature_PolygonModePoint => Some(Features::POLYGON_MODE_POINT), + // native::WGPUNativeFeature_ConservativeRasterization => Some(Features::CONSERVATIVE_RASTERIZATION), + // native::WGPUNativeFeature_ClearTexture => Some(Features::CLEAR_TEXTURE), + // native::WGPUNativeFeature_SpirvShaderPassthrough => Some(Features::SPIRV_SHADER_PASSTHROUGH), + // native::WGPUNativeFeature_Multiview => Some(Features::MULTIVIEW), + native::WGPUNativeFeature_VertexAttribute64bit => Some(Features::VERTEX_ATTRIBUTE_64BIT), + native::WGPUNativeFeature_ShaderUnusedVertexOutput => Some(Features::SHADER_UNUSED_VERTEX_OUTPUT), + native::WGPUNativeFeature_TextureFormatNv12 => Some(Features::TEXTURE_FORMAT_NV12), + native::WGPUNativeFeature_RayTracingAccelerationStructure => Some(Features::RAY_TRACING_ACCELERATION_STRUCTURE), + native::WGPUNativeFeature_RayQuery => Some(Features::RAY_QUERY), + native::WGPUNativeFeature_ShaderF64 => Some(Features::SHADER_F64), + native::WGPUNativeFeature_ShaderPrimitiveIndex => Some(Features::SHADER_PRIMITIVE_INDEX), + native::WGPUNativeFeature_ShaderEarlyDepthTest => Some(Features::SHADER_EARLY_DEPTH_TEST), // fallback, probably not available in wgpu-core _ => None, }