diff --git a/src/LLGI.Base.h b/src/LLGI.Base.h index cdafb208..e15c05d1 100644 --- a/src/LLGI.Base.h +++ b/src/LLGI.Base.h @@ -270,6 +270,7 @@ enum class TextureFormatType D32, D24S8, D32S8, + RG11B10_UFLOAT, Unknown, }; @@ -532,6 +533,8 @@ inline std::string to_string(TextureFormatType format) return "D32S8"; case TextureFormatType::D24S8: return "D24S8"; + case TextureFormatType::RG11B10_UFLOAT: + return "RG11B10_UFLOAT"; default: return "Unregistered"; } @@ -575,6 +578,8 @@ inline int32_t GetTextureRowPitch(TextureFormatType format, Vec3I size) return size.X * 4; case TextureFormatType::B8G8R8A8_UNORM: return size.X * 4; + case TextureFormatType::RG11B10_UFLOAT: + return size.X * 4; case TextureFormatType::R16G16_FLOAT: return size.X * 4; case TextureFormatType::R8G8B8A8_UNORM_SRGB: diff --git a/src/WebGPU/LLGI.BaseWebGPU.cpp b/src/WebGPU/LLGI.BaseWebGPU.cpp index 00fcdb68..cb37b40a 100644 --- a/src/WebGPU/LLGI.BaseWebGPU.cpp +++ b/src/WebGPU/LLGI.BaseWebGPU.cpp @@ -192,6 +192,9 @@ wgpu::TextureFormat ConvertFormat(TextureFormatType format) if (format == TextureFormatType::B8G8R8A8_UNORM) return wgpu::TextureFormat::BGRA8Unorm; + if (format == TextureFormatType::RG11B10_UFLOAT) + return wgpu::TextureFormat::RG11B10Ufloat; + if (format == TextureFormatType::R16G16B16A16_FLOAT) return wgpu::TextureFormat::RGBA16Float; @@ -257,6 +260,9 @@ TextureFormatType ConvertFormat(wgpu::TextureFormat format) if (format == wgpu::TextureFormat::BGRA8Unorm) return TextureFormatType::B8G8R8A8_UNORM; + if (format == wgpu::TextureFormat::RG11B10Ufloat) + return TextureFormatType::RG11B10_UFLOAT; + if (format == wgpu::TextureFormat::RGBA16Float) return TextureFormatType::R16G16B16A16_FLOAT;