mirror of https://github.com/PCSX2/pcsx2.git
zzogl: align_16 array before sse2 instruction + minor stuff
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4263 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
1b209e265b
commit
2d38e89194
|
@ -502,8 +502,8 @@ template <>
|
|||
u16* clut = (u16*)GetClutBufferAddress<u32>(csa); // Keep aligned version for sse2
|
||||
|
||||
// which side to copy
|
||||
u32 clutsize_right;
|
||||
u32 clutsize_left;
|
||||
s32 clutsize_right;
|
||||
s32 clutsize_left;
|
||||
if (csa < 16) {
|
||||
clutsize_right = min(clutsize, (16-csa)*64);
|
||||
clutsize_left = clutsize - clutsize_right;
|
||||
|
@ -582,7 +582,7 @@ template <>
|
|||
#else
|
||||
// Note +1 because we change higher 16 bits
|
||||
for(int i = 0; i < 16; ++i)
|
||||
dst[i] = clut[2*i];
|
||||
dst[i] = clut[2*i+1];
|
||||
#endif
|
||||
|
||||
dst += 16;
|
||||
|
|
|
@ -722,26 +722,29 @@ inline void FlushDecodeClut(VB& curvb, GLuint& ptexclut)
|
|||
{
|
||||
glGenTextures(1, &ptexclut);
|
||||
glBindTexture(GL_TEXTURE_2D, ptexclut);
|
||||
vector<char> data(PSMT_ISHALF_STORAGE(curvb.tex0) ? 512 : 1024);
|
||||
|
||||
if (ptexclut != 0)
|
||||
{
|
||||
int clutsize;
|
||||
int entries = PSMT_IS8CLUT(curvb.tex0.psm) ? 256 : 16;
|
||||
|
||||
if (curvb.tex0.csm && curvb.tex0.csa)
|
||||
ZZLog::Debug_Log("ERROR, csm1.");
|
||||
if (curvb.tex0.csm && curvb.tex0.csa) ZZLog::Debug_Log("ERROR, csm1.");
|
||||
|
||||
if (PSMT_IS32BIT(curvb.tex0.cpsm)) {
|
||||
__aligned16 u32 data[256];
|
||||
clutsize = min(entries, 256 - curvb.tex0.csa * 16) * 4;
|
||||
ClutBuffer_to_Array<u32>((u32*)&data[0], curvb.tex0.csa, clutsize);
|
||||
} else {
|
||||
clutsize = min(entries, 512 - curvb.tex0.csa * 16) * 2;
|
||||
ClutBuffer_to_Array<u16>((u16*)&data[0], curvb.tex0.csa, clutsize);
|
||||
}
|
||||
|
||||
GLenum tempType = PSMT_ISHALF_STORAGE(curvb.tex0) ? GL_UNSIGNED_SHORT_5_5_5_1 : GL_UNSIGNED_BYTE;
|
||||
Texture2D(4, 256, 1, GL_RGBA, tempType, &data[0]);
|
||||
ClutBuffer_to_Array<u32>((u32*)data, curvb.tex0.csa, clutsize);
|
||||
|
||||
Texture2D(4, 256, 1, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
} else {
|
||||
__aligned16 u16 data[256];
|
||||
clutsize = min(entries, 512 - curvb.tex0.csa * 16) * 2;
|
||||
|
||||
ClutBuffer_to_Array<u16>((u16*)data, curvb.tex0.csa, clutsize);
|
||||
|
||||
Texture2D(4, 256, 1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, data);
|
||||
}
|
||||
|
||||
s_vecTempTextures.push_back(ptexclut);
|
||||
|
||||
|
|
Loading…
Reference in New Issue