GPU: Fix warnings in RGB24 shader

This commit is contained in:
Connor McLaughlin 2019-10-05 14:52:52 +10:00
parent e80775ed82
commit 1998a74ff4
2 changed files with 25 additions and 26 deletions

View File

@ -405,31 +405,30 @@ void main()
// select the bit for this pixel depending on its offset in the 4-pixel block
uint r, g, b;
switch (xoff & 3)
int block_offset = xoff & 3;
if (block_offset == 0)
{
case 0:
r = s0 & 0xFFu;
g = s0 >> 8;
b = s1 & 0xFFu;
break;
case 1:
r = s1 >> 8;
g = s2 & 0xFFu;
b = s2 >> 8;
break;
case 2:
r = s1 & 0xFFu;
g = s1 >> 8;
b = s2 & 0xFFu;
break;
case 3:
r = s2 >> 8;
g = s3 & 0xFFu;
b = s3 >> 8;
break;
r = s0 & 0xFFu;
g = s0 >> 8;
b = s1 & 0xFFu;
}
else if (block_offset == 1)
{
r = s1 >> 8;
g = s2 & 0xFFu;
b = s2 >> 8;
}
else if (block_offset == 2)
{
r = s1 & 0xFFu;
g = s1 >> 8;
b = s2 & 0xFFu;
}
else
{
r = s2 >> 8;
g = s3 & 0xFFu;
b = s3 >> 8;
}
// and normalize

View File

@ -86,9 +86,9 @@ static int Run(int argc, char* argv[])
int main(int argc, char* argv[])
{
// set log flags
// g_pLog->SetConsoleOutputParams(true, nullptr, LOGLEVEL_DEBUG);
g_pLog->SetConsoleOutputParams(true, nullptr, LOGLEVEL_DEBUG);
// g_pLog->SetConsoleOutputParams(true, "GPU GPU_HW_OpenGL SPU Pad DigitalController", LOGLEVEL_DEBUG);
g_pLog->SetConsoleOutputParams(true, "GPU GPU_HW_OpenGL SPU Pad DigitalController InterruptController", LOGLEVEL_DEBUG);
// g_pLog->SetConsoleOutputParams(true, "GPU GPU_HW_OpenGL SPU Pad DigitalController InterruptController", LOGLEVEL_DEBUG);
#ifdef Y_BUILD_CONFIG_RELEASE
g_pLog->SetFilterLevel(LOGLEVEL_INFO);