GPU: Simplify GPUSubsystem::PostprocessDisplay().

This commit is contained in:
rogerman 2021-09-13 19:31:31 -07:00
parent a5b25313f8
commit 8a610234c5
1 changed files with 10 additions and 36 deletions

View File

@ -5639,8 +5639,6 @@ void GPUSubsystem::SetWillPostprocessDisplays(const bool willPostprocess)
void GPUSubsystem::PostprocessDisplay(const NDSDisplayID displayID, NDSDisplayInfo &mutableInfo)
{
if (mutableInfo.isDisplayEnabled[displayID])
{
if (mutableInfo.colorFormat == NDSColorFormat_BGR666_Rev)
{
if (mutableInfo.needConvertColorFormat[displayID])
{
@ -5648,45 +5646,21 @@ void GPUSubsystem::PostprocessDisplay(const NDSDisplayID displayID, NDSDisplayIn
}
if (mutableInfo.needApplyMasterBrightness[displayID])
{
this->_display[displayID]->GetEngine()->ApplyMasterBrightness<NDSColorFormat_BGR888_Rev>(mutableInfo);
}
}
else
{
if (mutableInfo.needApplyMasterBrightness[displayID])
{
switch (mutableInfo.colorFormat)
{
case NDSColorFormat_BGR555_Rev:
this->_display[displayID]->GetEngine()->ApplyMasterBrightness<NDSColorFormat_BGR555_Rev>(mutableInfo);
break;
case NDSColorFormat_BGR666_Rev:
this->_display[displayID]->GetEngine()->ApplyMasterBrightness<NDSColorFormat_BGR666_Rev>(mutableInfo);
break;
case NDSColorFormat_BGR888_Rev:
this->_display[displayID]->GetEngine()->ApplyMasterBrightness<NDSColorFormat_BGR888_Rev>(mutableInfo);
break;
default:
break;
}
}
}
}
else
{
if (mutableInfo.colorFormat == NDSColorFormat_BGR555_Rev)
{
memset(mutableInfo.renderedBuffer[displayID], 0, mutableInfo.renderedWidth[displayID] * mutableInfo.renderedHeight[displayID] * sizeof(u16));
this->_display[displayID]->GetEngine()->ApplyMasterBrightness<NDSColorFormat_BGR555_Rev>(mutableInfo);
}
else
{
memset(mutableInfo.renderedBuffer[displayID], 0, mutableInfo.renderedWidth[displayID] * mutableInfo.renderedHeight[displayID] * sizeof(u32));
this->_display[displayID]->GetEngine()->ApplyMasterBrightness<NDSColorFormat_BGR888_Rev>(mutableInfo);
}
}
}
else
{
memset(mutableInfo.renderedBuffer[displayID], 0, mutableInfo.renderedWidth[displayID] * mutableInfo.renderedHeight[displayID] * mutableInfo.pixelBytes);
}
mutableInfo.needConvertColorFormat[displayID] = false;
mutableInfo.needApplyMasterBrightness[displayID] = false;