diff options
author | Dylan Baker <[email protected]> | 2018-09-10 10:22:42 -0700 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2020-04-21 11:09:03 -0700 |
commit | 53c36dfcfe3eb3749a53267f054870280afb0d71 (patch) | |
tree | 7d178170b8324ce2ec4fed64e66a146c173edf97 /src/mesa/main/texparam.c | |
parent | df3ce8fb77e718ee4371fe7ca9f4a7c889319efb (diff) |
replace IROUND with util functions
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 <[email protected]>
Reviewed-by: Kristian H. Kristensen <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
Diffstat (limited to 'src/mesa/main/texparam.c')
-rw-r--r-- | src/mesa/main/texparam.c | 10 |
1 files changed, 5 insertions, 5 deletions
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) |