mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Committing magumagu9's work on texture decoding transferral to OGL, I added DX9 support. Speed seems to have increased but I'm not sure. See issue 581 for more info.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2222 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -343,21 +343,30 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, expandedWidth);
|
||||
|
||||
int gl_format;
|
||||
int gl_iformat;
|
||||
int gl_type;
|
||||
switch (dfmt) {
|
||||
case PC_TEX_FMT_NONE:
|
||||
PanicAlert("Invalid PC texture format %i", dfmt);
|
||||
case PC_TEX_FMT_BGRA32:
|
||||
gl_format = GL_BGRA;
|
||||
gl_iformat = 4;
|
||||
gl_type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case PC_TEX_FMT_I8:
|
||||
gl_format = GL_LUMINANCE;
|
||||
gl_iformat = GL_INTENSITY;
|
||||
gl_type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
}
|
||||
if (!entry.isNonPow2 && ((tm0.min_filter & 3) == 1 || (tm0.min_filter & 3) == 2)) {
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, 4, width, height, gl_format, gl_type, temp);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, gl_iformat, width, height, 0, gl_format, gl_type, temp);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE);
|
||||
entry.bHaveMipMaps = true;
|
||||
}
|
||||
else
|
||||
glTexImage2D(target, 0, 4, width, height, 0, gl_format, gl_type, temp);
|
||||
glTexImage2D(target, 0, gl_iformat, width, height, 0, gl_format, gl_type, temp);
|
||||
|
||||
if (expandedWidth != width) // reset
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
|
Reference in New Issue
Block a user