This commit is contained in:
BreadFish64 2020-06-27 13:23:34 -05:00
parent ea2584c54d
commit 662c348b6c
2 changed files with 4 additions and 4 deletions

View file

@ -779,7 +779,7 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) {
temp_tex.Create();
glBindTexture(GL_TEXTURE_2D, temp_tex.handle);
auto [internal_format, format, type] = GetFormatTuple(color_surface->pixel_format);
OGLTexture::Allocate(GL_TEXTURE_2D, color_surface->max_level, internal_format, format, type,
OGLTexture::Allocate(GL_TEXTURE_2D, color_surface->max_level + 1, internal_format, format, type,
color_surface->GetScaledWidth(), color_surface->GetScaledHeight());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);

View file

@ -64,8 +64,8 @@ void OGLTexture::Allocate(GLenum target, GLsizei levels, GLenum internalformat,
glTexStorage1D(target, levels, internalformat, width);
} else {
for (GLsizei level{0}; level < levels; ++level) {
width >>= 1;
glTexImage1D(target, level, internalformat, width, 0, format, type, nullptr);
width >>= 1;
}
}
break;
@ -77,11 +77,11 @@ void OGLTexture::Allocate(GLenum target, GLsizei levels, GLenum internalformat,
glTexStorage2D(target, levels, internalformat, width, height);
} else {
for (GLsizei level{0}; level < levels; ++level) {
glTexImage2D(target, level, internalformat, width, height, 0, format, type,
nullptr);
width >>= 1;
if (target != GL_TEXTURE_1D_ARRAY)
height >>= 1;
glTexImage2D(target, level, internalformat, width, height, 0, format, type,
nullptr);
}
}
break;