mesa: add gl_coontext::ForceIntegerTexNearest
Some applications incorrectly use GL_LINEAR* values for integers texture. copyimage.c already implemented a tolerance for such app in prepare_target_err. This commit adds a boolean that will treat GL_LINEAR* filters as GL_NEAREST for integer textures. CC: 20.1 <mesa-stable@lists.freedesktop.org> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4647>
This commit is contained in:
@@ -114,9 +114,14 @@ st_convert_sampler(const struct st_context *st,
|
||||
sampler->wrap_t = gl_wrap_xlate(msamp->WrapT);
|
||||
sampler->wrap_r = gl_wrap_xlate(msamp->WrapR);
|
||||
|
||||
sampler->min_img_filter = gl_filter_to_img_filter(msamp->MinFilter);
|
||||
if (texobj->_IsIntegerFormat && st->ctx->Const.ForceIntegerTexNearest) {
|
||||
sampler->min_img_filter = gl_filter_to_img_filter(GL_NEAREST);
|
||||
sampler->mag_img_filter = gl_filter_to_img_filter(GL_NEAREST);
|
||||
} else {
|
||||
sampler->min_img_filter = gl_filter_to_img_filter(msamp->MinFilter);
|
||||
sampler->mag_img_filter = gl_filter_to_img_filter(msamp->MagFilter);
|
||||
}
|
||||
sampler->min_mip_filter = gl_filter_to_mip_filter(msamp->MinFilter);
|
||||
sampler->mag_img_filter = gl_filter_to_img_filter(msamp->MagFilter);
|
||||
|
||||
if (texobj->Target != GL_TEXTURE_RECTANGLE_ARB)
|
||||
sampler->normalized_coords = 1;
|
||||
|
||||
Reference in New Issue
Block a user