rusticl/format: document cl to pipe format mapping
authorKarol Herbst <git@karolherbst.de>
Sun, 18 Jun 2023 17:40:28 +0000 (19:40 +0200)
committerKarol Herbst <git@karolherbst.de>
Mon, 19 Jun 2023 12:07:03 +0000 (14:07 +0200)
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nora Allen <blackcatgames@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23714>

src/gallium/frontends/rusticl/core/format.rs

index 3153a64..b2348e9 100644 (file)
@@ -10,6 +10,36 @@ pub struct RusticlImageFormat {
     pub pipe: pipe_format,
 }
 
+// cl -> pipe mapping:
+//
+// channels (x: bit size):
+// CL_R         => Rx
+// CL_A         => Ax
+// CL_DEPTH     => Zx
+// CL_LUMINANCE => Lx
+// CL_INTENSITY => Ix
+// CL_RG        => RxGx
+// CL_RA        => RxAx
+// CL_Rx        => not supported
+// CL_RGB       => RxGxBx
+// CL_RGx       => not supported
+// CL_RGBA      => RxGxBxAx
+// CL_ARGB      => AxRxGxBx
+// CL_BGRA      => BxGxRxAx
+// CL_ABGR      => AxBxGxRx
+// CL_RGBx      => RxGxBxXx
+// CL_sRGB      => RxGxBx_SRGB
+// CL_sRGBA     => RxGxBxAx_SRGB
+// CL_sBGRA     => BxGxRxAx_SRGB
+// CL_sRGBx     => RxGxBxXx_SRGB
+//
+// data types:
+// SNORM        => x  SNORM
+// UNORM        => x  UNORM
+// SIGNED_INT   => x  SINT
+// UNSIGNED_INT => x  UINT
+// HALF_FLOAT   => 16 FLOAT
+// FLOAT        => 32 FLOAT
 #[rustfmt::skip]
 const fn cl_format_to_pipe(
     ch_order: cl_channel_order,