struct swrast_texture_image;
-typedef void (*FetchTexelFuncC)(const struct swrast_texture_image *texImage,
- GLint col, GLint row, GLint img,
- GLchan *texelOut);
-
/**
- * As above, but returns floats.
- * Used for depth component images and for upcoming signed/float
- * texture images.
+ * Fetch a texel from texture image at given position.
*/
typedef void (*FetchTexelFuncF)(const struct swrast_texture_image *texImage,
GLint col, GLint row, GLint img,
GLint TexelSize; /**< bytes per texel block */
#endif
- FetchTexelFuncC FetchTexelc;
FetchTexelFuncF FetchTexelf;
StoreTexelFunc Store;
/**
- * Adaptor for fetching a GLchan texel from a float-valued texture.
- */
-static void
-fetch_texel_float_to_chan(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texelOut)
-{
- GLfloat temp[4];
- GLenum baseFormat = _mesa_get_format_base_format(texImage->Base.TexFormat);
-
- ASSERT(texImage->FetchTexelf);
- texImage->FetchTexelf(texImage, i, j, k, temp);
- if (baseFormat == GL_DEPTH_COMPONENT ||
- baseFormat == GL_DEPTH_STENCIL_EXT) {
- /* just one channel */
- UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]);
- }
- else {
- /* four channels */
- UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]);
- UNCLAMPED_FLOAT_TO_CHAN(texelOut[1], temp[1]);
- UNCLAMPED_FLOAT_TO_CHAN(texelOut[2], temp[2]);
- UNCLAMPED_FLOAT_TO_CHAN(texelOut[3], temp[3]);
- }
-}
-
-
-#if 0
-/**
- * Adaptor for fetching a float texel from a GLchan-valued texture.
- */
-static void
-fetch_texel_chan_to_float(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texelOut)
-{
- GLchan temp[4];
- GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat);
-
- ASSERT(texImage->FetchTexelc);
- texImage->FetchTexelc(texImage, i, j, k, temp);
- if (baseFormat == GL_DEPTH_COMPONENT ||
- baseFormat == GL_DEPTH_STENCIL_EXT) {
- /* just one channel */
- texelOut[0] = CHAN_TO_FLOAT(temp[0]);
- }
- else {
- /* four channels */
- texelOut[0] = CHAN_TO_FLOAT(temp[0]);
- texelOut[1] = CHAN_TO_FLOAT(temp[1]);
- texelOut[2] = CHAN_TO_FLOAT(temp[2]);
- texelOut[3] = CHAN_TO_FLOAT(temp[3]);
- }
-}
-#endif
-
-
-/**
- * Initialize the texture image's FetchTexelc and FetchTexelf methods.
+ * Initialize the texture image's FetchTexelf methods.
*/
static void
set_fetch_functions(struct swrast_texture_image *texImage, GLuint dims)
}
texImage->FetchTexelf = _mesa_get_texel_fetch_func(format, dims);
-
- texImage->FetchTexelc = fetch_texel_float_to_chan;
-
- ASSERT(texImage->FetchTexelc);
ASSERT(texImage->FetchTexelf);
}