Merge pull request #4822 from wwylele/mipmap-cub

gl_rasterizer: correct supress_mipmap_for_cube logic
This commit is contained in:
Pengfei Zhu 2019-07-06 22:56:36 +08:00 committed by GitHub
commit 46d552b4d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1576,17 +1576,14 @@ void RasterizerOpenGL::SamplerInfo::SyncWithConfig(
mag_filter = config.mag_filter; mag_filter = config.mag_filter;
glSamplerParameteri(s, GL_TEXTURE_MAG_FILTER, PicaToGL::TextureMagFilterMode(mag_filter)); glSamplerParameteri(s, GL_TEXTURE_MAG_FILTER, PicaToGL::TextureMagFilterMode(mag_filter));
} }
if (min_filter != config.min_filter || mip_filter != config.mip_filter) {
min_filter = config.min_filter;
mip_filter = config.mip_filter;
glSamplerParameteri(s, GL_TEXTURE_MIN_FILTER,
PicaToGL::TextureMinFilterMode(min_filter, mip_filter));
}
// TODO(wwylele): remove this block once mipmap for cube is implemented // TODO(wwylele): remove new_supress_mipmap_for_cube logic once mipmap for cube is implemented
bool new_supress_mipmap_for_cube = bool new_supress_mipmap_for_cube =
config.type == Pica::TexturingRegs::TextureConfig::TextureCube; config.type == Pica::TexturingRegs::TextureConfig::TextureCube;
if (supress_mipmap_for_cube != new_supress_mipmap_for_cube) { if (min_filter != config.min_filter || mip_filter != config.mip_filter ||
supress_mipmap_for_cube != new_supress_mipmap_for_cube) {
min_filter = config.min_filter;
mip_filter = config.mip_filter;
supress_mipmap_for_cube = new_supress_mipmap_for_cube; supress_mipmap_for_cube = new_supress_mipmap_for_cube;
if (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 // HACK: use mag filter converter for min filter because they are the same anyway