mesa: implement new texture format L16
[mesa.git] / src / mesa / main / texfetch.c
index aa3a6961b6442be0931005187bf39863757f4c60..4791e367598d9e9caf491dff42c34817d169089a 100644 (file)
@@ -236,6 +236,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
       fetch_texel_3d_f_argb1555_rev,
       store_texel_argb1555_rev
    },
+   {
+      MESA_FORMAT_AL44,
+      fetch_texel_1d_f_al44,
+      fetch_texel_2d_f_al44,
+      fetch_texel_3d_f_al44,
+      store_texel_al44
+   },
    {
       MESA_FORMAT_AL88,
       fetch_texel_1d_f_al88,
@@ -278,6 +285,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
       fetch_texel_3d_f_a8,
       store_texel_a8
    },
+   {
+      MESA_FORMAT_A16,
+      fetch_texel_1d_f_a16,
+      fetch_texel_2d_f_a16,
+      fetch_texel_3d_f_a16,
+      store_texel_a16
+   },
    {
       MESA_FORMAT_L8,
       fetch_texel_1d_f_l8,
@@ -285,6 +299,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
       fetch_texel_3d_f_l8,
       store_texel_l8
    },
+   {
+      MESA_FORMAT_L16,
+      fetch_texel_1d_f_l16,
+      fetch_texel_2d_f_l16,
+      fetch_texel_3d_f_l16,
+      store_texel_l16
+   },
    {
       MESA_FORMAT_I8,
       fetch_texel_1d_f_i8,
@@ -355,6 +376,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
       fetch_texel_3d_f_rg1616_rev,
       store_texel_rg1616_rev,
    },
+   {
+      MESA_FORMAT_ARGB2101010,
+      fetch_texel_1d_f_argb2101010,
+      fetch_texel_2d_f_argb2101010,
+      fetch_texel_3d_f_argb2101010,
+      store_texel_argb2101010
+   },
    {
       MESA_FORMAT_Z24_S8,
       fetch_texel_1d_f_z24_s8,
@@ -823,17 +851,11 @@ void
 _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims)
 {
    ASSERT(dims == 1 || dims == 2 || dims == 3);
-   ASSERT(texImage->TexFormat);
 
-   if (!texImage->FetchTexelf) {
-      texImage->FetchTexelf =
-         _mesa_get_texel_fetch_func(texImage->TexFormat, dims);
-   }
+   texImage->FetchTexelf =
+      _mesa_get_texel_fetch_func(texImage->TexFormat, dims);
 
-   /* now check if we need to use a float/chan adaptor */
-   if (!texImage->FetchTexelc) {
-      texImage->FetchTexelc = fetch_texel_float_to_chan;
-   }
+   texImage->FetchTexelc = fetch_texel_float_to_chan;
 
    ASSERT(texImage->FetchTexelc);
    ASSERT(texImage->FetchTexelf);