Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Areas of interest for new linux developers
#31
The "try to inline everything" switch is enabled on O3 -finline-functions.
There is a fairly new switch on gcc that seems really nice - -fopt-info .You can find more about it here https://gcc.gnu.org/onlinedocs/gcc/Debug...tions.html .
Reply

Sponsored links

#32
On line 365 of https://github.com/PCSX2/pcsx2/blob/mast...eCache.cpp there is

Code:
found=b;

Shouldn't it be

Code:
if(b) found=b;

So the variable does not get overwritten and we might reclaim some memory back because below there is

Code:
if(!found && GSUtil::HasCompatibleBits(psm, t->m_TEX0.PSM))
{
t->m_dirty.push_back(GSDirtyRect(r, psm));
t->m_TEX0.TBW = bw;
}
Reply
#33
See github issueb#332
Reply
#34
Oh ok.
Reply
#35
I've been analysing pcsx2 with cppcheck. Apart from c vs c++ style :

- https://github.com/PCSX2/pcsx2/blob/mast...Thread.cpp line 303. Refers with would be more efficient to use empty()
- VmStateBuffer declaration is hidden on https://github.com/PCSX2/pcsx2/blob/mast...sThreads.h. Already defined at System.h

The output is at cppcheck.txt file
Also did the same for zzogl and gsdx.
Zzogl has some troubling code :

Quote:inline void PSMT_SET_BLOCK_SIZE (int psm, int& W, int&H, int& ppw) {
switch (PIXELS_PER_WORD(psm)) {
case 8:
W = 128; H = 128; ppw = 8;
case 4:
W = 128; H = 64; ppw = 4;
case 2:
W = 64; H = 64; ppw = 2;
default:
W = 32; H = 64; ppw = 1;
}
}


Attached Files
.txt   cppcheck_zzogl.txt (Size: 66,11 KB / Downloads: 101)
.txt   cppcheck_gsdx.txt (Size: 74,1 KB / Downloads: 90)
.txt   cppcheck.txt (Size: 179,59 KB / Downloads: 100)
Reply
#36
I've been working a bit on fixing the issues with ZZogl. Seems a easier codebase to start with Smile
Clut from the code on the previous post and some other code was totally broken.
Reply
#37
Good idea. It is strange that zzogl is so broken, are you sure the code is called? However be aware GS code is all but easy Tongue2
Reply
#38
I'm trying to understand the code below
Quote: float4 v = DefaultBitBltPos();

v = DefaultBitBltTex();

v.x = 1;
v.y = 2;
v.z = PSMT_IS16Z(psm) ? 1.0f : 0.0f;
v.w = g_filog32;

It does not make much sense why v is assigned twice. This code is found at ZZDepthTargets.cpp

float4 CRenderTarget:LaughefaultBitBltPos()
{
float4 v = float4(1, -1, 0.5f / (float)RW(fbw), 0.5f / (float)RH(fbh));
v *= 1.0f / 32767.0f;
ZZshSetParameter4fv(pvsBitBlt.prog, pvsBitBlt.sBitBltPos, v, "g_sBitBltPos");
return v;
}

// Used to transform texture coordinates from GS (when 0,0 is upper left) to
// OpenGL (0,0 - lower left).
float4 CRenderTarget:LaughefaultBitBltTex()
{
// I really sure that -0.5 is correct, because OpenGL have no half-offset
// issue, DirectX known for.
float4 v = float4(1, -1, 0.5f / (float)RW(fbw), -0.5f / (float)RH(fbh));
ZZshSetParameter4fv(pvsBitBlt.prog, pvsBitBlt.sBitBltTex, v, "g_sBitBltTex");
return v;
}
Reply
#39
Now you have to find out what ZZshSetParameter4fv does...
Probably they set the parameters "g_sBitBltPos" and "g_sBitBltTex". Therefore you can not omit the first assign even if the return value is never used.
Reply
#40
ZZshSetParameter4fv set the shader parameters. In this case saving the value doesn't seem useful, but function must be called.
Reply




Users browsing this thread: 1 Guest(s)