提交 1dde9929 编写于 作者: P Palana

remove mipmap texture filter from min_filter for rectangle textures

上级 92186278
......@@ -182,6 +182,24 @@ enum gs_texture_type device_gettexturetype(device_t device,
return texture->type;
}
static void strip_mipmap_filter(GLint *filter)
{
switch (*filter) {
case GL_NEAREST:
case GL_LINEAR:
return;
case GL_NEAREST_MIPMAP_NEAREST:
case GL_NEAREST_MIPMAP_LINEAR:
*filter = GL_NEAREST;
return;
case GL_LINEAR_MIPMAP_NEAREST:
case GL_LINEAR_MIPMAP_LINEAR:
*filter = GL_LINEAR;
return;
}
*filter = GL_NEAREST;
}
static bool load_texture_sampler(texture_t tex, samplerstate_t ss)
{
bool success = true;
......@@ -196,8 +214,12 @@ static bool load_texture_sampler(texture_t tex, samplerstate_t ss)
samplerstate_addref(ss);
GLint min_filter = ss->min_filter;
if (texture_isrect(tex))
strip_mipmap_filter(&min_filter);
if (!gl_tex_param_i(tex->gl_target, GL_TEXTURE_MIN_FILTER,
ss->min_filter))
min_filter))
success = false;
if (!gl_tex_param_i(tex->gl_target, GL_TEXTURE_MAG_FILTER,
ss->mag_filter))
......
......@@ -643,7 +643,7 @@ EXPORT bool texture_map(texture_t tex, void **ptr, uint32_t *row_bytes);
EXPORT void texture_unmap(texture_t tex);
/** special-case function (GL only) - specifies whether the texture is a
* GL_TEXTURE_RECTANGLE type, which doesn't use normalized texture
* coordinates */
* coordinates, doesn't support mipmapping, and requires address clamping */
EXPORT bool texture_isrect(texture_t tex);
EXPORT void cubetexture_destroy(texture_t cubetex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册