From: Brian Paul Date: Fri, 7 Oct 2011 14:22:35 +0000 (-0600) Subject: swrast: remove unused swrast_texture_image::FetchTexelc method X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba69c4a0025e73ec2997795ddb4c3d6a210bfe32;p=mesa.git swrast: remove unused swrast_texture_image::FetchTexelc method We only use the float-valued function now. --- diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 12ad688b06c..d7ad764a9e2 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -112,14 +112,8 @@ typedef void (*validate_texture_image_func)(struct gl_context *ctx, 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, @@ -150,7 +144,6 @@ struct swrast_texture_image GLint TexelSize; /**< bytes per texel block */ #endif - FetchTexelFuncC FetchTexelc; FetchTexelFuncF FetchTexelf; StoreTexelFunc Store; diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c index 7573abda6dd..4bacf218b0b 100644 --- a/src/mesa/swrast/s_texfetch.c +++ b/src/mesa/swrast/s_texfetch.c @@ -1287,63 +1287,7 @@ _mesa_get_texel_store_func(gl_format format) /** - * 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) @@ -1358,10 +1302,6 @@ 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); }