From 53c36dfcfe3eb3749a53267f054870280afb0d71 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 10 Sep 2018 10:22:42 -0700 Subject: replace IROUND with util functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds two new util functions to rounding.h, _mesa_iroundf and mesa_lround, which are just wrappers around roundf and round, that cast to int and long int respectively. This is possible since mesa recently dropped support for VC2013, since 2015 and 2017 support roundf. Reviewed-by: Marek Olšák Reviewed-by: Kristian H. Kristensen Reviewed-by: Matt Turner Part-of: --- src/mesa/main/texparam.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa/main/texparam.c') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index ced2da8496c..7e062403bb9 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1649,7 +1649,7 @@ get_tex_level_parameter_image(struct gl_context *ctx, } if (*params == 0 && pname == GL_TEXTURE_INTENSITY_SIZE) { /* Gallium may store intensity as LA */ - *params = _mesa_get_format_bits(texFormat, + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); } } @@ -2424,7 +2424,7 @@ get_tex_parameteriv(struct gl_context *ctx, /* GL spec 'Data Conversions' section specifies that floating-point * value in integer Get function is rounded to nearest integer */ - *params = IROUND(obj->Sampler.MinLod); + *params = lroundf(obj->Sampler.MinLod); break; case GL_TEXTURE_MAX_LOD: if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) @@ -2432,7 +2432,7 @@ get_tex_parameteriv(struct gl_context *ctx, /* GL spec 'Data Conversions' section specifies that floating-point * value in integer Get function is rounded to nearest integer */ - *params = IROUND(obj->Sampler.MaxLod); + *params = lroundf(obj->Sampler.MaxLod); break; case GL_TEXTURE_BASE_LEVEL: if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) @@ -2449,7 +2449,7 @@ get_tex_parameteriv(struct gl_context *ctx, /* GL spec 'Data Conversions' section specifies that floating-point * value in integer Get function is rounded to nearest integer */ - *params = IROUND(obj->Sampler.MaxAnisotropy); + *params = lroundf(obj->Sampler.MaxAnisotropy); break; case GL_GENERATE_MIPMAP_SGIS: if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) @@ -2487,7 +2487,7 @@ get_tex_parameteriv(struct gl_context *ctx, /* GL spec 'Data Conversions' section specifies that floating-point * value in integer Get function is rounded to nearest integer */ - *params = IROUND(obj->Sampler.LodBias); + *params = lroundf(obj->Sampler.LodBias); break; case GL_TEXTURE_CROP_RECT_OES: if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture) -- cgit v1.2.3