gl_rasterizer: ignore mipmap setting for cubemap before we implements it

This commit is contained in:
wwylele 2018-07-22 17:31:02 +03:00 committed by Weiyi Wang
parent d7196b5573
commit 777af04f4a
2 changed files with 18 additions and 0 deletions

View file

@ -1583,6 +1583,21 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig(
PicaToGL::TextureMinFilterMode(min_filter, mip_filter));
}
// TODO(wwylele): remove this block once mipmap for cube is implemented
bool new_supress_mipmap_for_cube =
config.type == Pica::TexturingRegs::TextureConfig::TextureCube;
if (supress_mipmap_for_cube != new_supress_mipmap_for_cube) {
supress_mipmap_for_cube = new_supress_mipmap_for_cube;
if (new_supress_mipmap_for_cube) {
// HACK: use mag filter converter for min filter because they are the same anyway
glSamplerParameteri(s, GL_TEXTURE_MIN_FILTER,
PicaToGL::TextureMagFilterMode(min_filter));
} else {
glSamplerParameteri(s, GL_TEXTURE_MIN_FILTER,
PicaToGL::TextureMinFilterMode(min_filter, mip_filter));
}
}
if (wrap_s != config.wrap_s) {
wrap_s = config.wrap_s;
glSamplerParameteri(s, GL_TEXTURE_WRAP_S, PicaToGL::WrapMode(wrap_s));

View file

@ -76,6 +76,9 @@ private:
u32 lod_min;
u32 lod_max;
s32 lod_bias;
// TODO(wwylele): remove this once mipmap for cube is implemented
bool supress_mipmap_for_cube = false;
};
/// Structure that the hardware rendered vertices are composed of