Exemple #1
0
/**
 * Initialize the texture image's FetchTexel methods.
 */
static void
set_fetch_functions(struct swrast_texture_image *texImage, GLuint dims)
{
   gl_format format = texImage->Base.TexFormat;

   ASSERT(dims == 1 || dims == 2 || dims == 3);

   texImage->FetchTexel = _mesa_get_texel_fetch_func(format, dims);
   ASSERT(texImage->FetchTexel);
}
/**
 * Initialize the texture image's FetchTexelc and FetchTexelf methods.
 */
void
_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims)
{
   ASSERT(dims == 1 || dims == 2 || dims == 3);

   texImage->FetchTexelf =
      _mesa_get_texel_fetch_func(texImage->TexFormat, dims);

   texImage->FetchTexelc = fetch_texel_float_to_chan;

   ASSERT(texImage->FetchTexelc);
   ASSERT(texImage->FetchTexelf);
}
Exemple #3
0
/**
 * Initialize the texture image's FetchTexel methods.
 */
static void
set_fetch_functions(struct swrast_texture_image *texImage, GLuint dims)
{
   gl_format format = texImage->Base.TexFormat;

   ASSERT(dims == 1 || dims == 2 || dims == 3);

   if (texImage->Base.TexObject->Sampler.sRGBDecode == GL_SKIP_DECODE_EXT &&
       _mesa_get_format_color_encoding(format) == GL_SRGB) {
      format = _mesa_get_srgb_format_linear(format);
   }

   texImage->FetchTexel = _mesa_get_texel_fetch_func(format, dims);
   ASSERT(texImage->FetchTexel);
}