fix
This commit is contained in:
parent
ea2584c54d
commit
662c348b6c
2 changed files with 4 additions and 4 deletions
|
@ -779,7 +779,7 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) {
|
||||||
temp_tex.Create();
|
temp_tex.Create();
|
||||||
glBindTexture(GL_TEXTURE_2D, temp_tex.handle);
|
glBindTexture(GL_TEXTURE_2D, temp_tex.handle);
|
||||||
auto [internal_format, format, type] = GetFormatTuple(color_surface->pixel_format);
|
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());
|
color_surface->GetScaledWidth(), color_surface->GetScaledHeight());
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
|
|
|
@ -64,8 +64,8 @@ void OGLTexture::Allocate(GLenum target, GLsizei levels, GLenum internalformat,
|
||||||
glTexStorage1D(target, levels, internalformat, width);
|
glTexStorage1D(target, levels, internalformat, width);
|
||||||
} else {
|
} else {
|
||||||
for (GLsizei level{0}; level < levels; ++level) {
|
for (GLsizei level{0}; level < levels; ++level) {
|
||||||
width >>= 1;
|
|
||||||
glTexImage1D(target, level, internalformat, width, 0, format, type, nullptr);
|
glTexImage1D(target, level, internalformat, width, 0, format, type, nullptr);
|
||||||
|
width >>= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -77,11 +77,11 @@ void OGLTexture::Allocate(GLenum target, GLsizei levels, GLenum internalformat,
|
||||||
glTexStorage2D(target, levels, internalformat, width, height);
|
glTexStorage2D(target, levels, internalformat, width, height);
|
||||||
} else {
|
} else {
|
||||||
for (GLsizei level{0}; level < levels; ++level) {
|
for (GLsizei level{0}; level < levels; ++level) {
|
||||||
|
glTexImage2D(target, level, internalformat, width, height, 0, format, type,
|
||||||
|
nullptr);
|
||||||
width >>= 1;
|
width >>= 1;
|
||||||
if (target != GL_TEXTURE_1D_ARRAY)
|
if (target != GL_TEXTURE_1D_ARRAY)
|
||||||
height >>= 1;
|
height >>= 1;
|
||||||
glTexImage2D(target, level, internalformat, width, height, 0, format, type,
|
|
||||||
nullptr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue