mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix wrong width/height values being stored in thin3d textures
This commit is contained in:
parent
eb2f12e64a
commit
8b3ef19450
1 changed files with 7 additions and 4 deletions
|
@ -821,11 +821,14 @@ OpenGLTexture::OpenGLTexture(GLRenderManager *render, const TextureDesc &desc) :
|
|||
return;
|
||||
|
||||
int level = 0;
|
||||
int width = width_;
|
||||
int height = height_;
|
||||
int depth = depth_;
|
||||
for (auto data : desc.initData) {
|
||||
SetImageData(0, 0, 0, width_, height_, depth_, level, 0, data, desc.initDataCallback);
|
||||
width_ = (width_ + 1) / 2;
|
||||
height_ = (height_ + 1) / 2;
|
||||
depth_ = (depth_ + 1) / 2;
|
||||
SetImageData(0, 0, 0, width, height, depth, level, 0, data, desc.initDataCallback);
|
||||
width = (width + 1) / 2;
|
||||
height = (height + 1) / 2;
|
||||
depth = (depth + 1) / 2;
|
||||
level++;
|
||||
}
|
||||
mipLevels_ = desc.generateMips ? desc.mipLevels : level;
|
||||
|
|
Loading…
Add table
Reference in a new issue