mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-02 15:45:58 +00:00
Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start. Fixed misc vertical alignments and some { needed newlining.
This commit is contained in:
parent
4591464486
commit
31cfc73a09
189 changed files with 1250 additions and 1159 deletions
|
@ -324,7 +324,7 @@ void AVIDump::AddFrame(const u8* data, int width, int height)
|
|||
if (s_Stream->codec->coded_frame->pts != (unsigned int)AV_NOPTS_VALUE)
|
||||
pkt.pts = av_rescale_q(s_Stream->codec->coded_frame->pts,
|
||||
s_Stream->codec->time_base, s_Stream->time_base);
|
||||
if(s_Stream->codec->coded_frame->key_frame)
|
||||
if (s_Stream->codec->coded_frame->key_frame)
|
||||
pkt.flags |= AV_PKT_FLAG_KEY;
|
||||
pkt.stream_index = s_Stream->index;
|
||||
pkt.data = s_OutBuffer;
|
||||
|
|
|
@ -340,9 +340,9 @@ struct TevStageCombiner
|
|||
|
||||
// several discoveries:
|
||||
// GXSetTevIndBumpST(tevstage, indstage, matrixind)
|
||||
// if( matrix == 2 ) realmat = 6; // 10
|
||||
// else if( matrix == 3 ) realmat = 7; // 11
|
||||
// else if( matrix == 1 ) realmat = 5; // 9
|
||||
// if ( matrix == 2 ) realmat = 6; // 10
|
||||
// else if ( matrix == 3 ) realmat = 7; // 11
|
||||
// else if ( matrix == 1 ) realmat = 5; // 9
|
||||
// GXSetTevIndirect(tevstage, indstage, 0, 3, realmat, 6, 6, 0, 0, 0)
|
||||
// GXSetTevIndirect(tevstage+1, indstage, 0, 3, realmat+4, 6, 6, 1, 0, 0)
|
||||
// GXSetTevIndirect(tevstage+2, indstage, 0, 0, 0, 0, 0, 1, 0, 0)
|
||||
|
@ -886,7 +886,7 @@ union AlphaTest
|
|||
|
||||
inline TEST_RESULT TestResult() const
|
||||
{
|
||||
switch(logic)
|
||||
switch (logic)
|
||||
{
|
||||
case 0: // AND
|
||||
if (comp0 == ALPHACMP_ALWAYS && comp1 == ALPHACMP_ALWAYS)
|
||||
|
|
|
@ -66,17 +66,17 @@ void BPWritten(const BPCmd& bp)
|
|||
|
||||
if (((s32*)&bpmem)[bp.address] == bp.newvalue)
|
||||
{
|
||||
if (!(bp.address == BPMEM_TRIGGER_EFB_COPY
|
||||
|| bp.address == BPMEM_CLEARBBOX1
|
||||
|| bp.address == BPMEM_CLEARBBOX2
|
||||
|| bp.address == BPMEM_SETDRAWDONE
|
||||
|| bp.address == BPMEM_PE_TOKEN_ID
|
||||
|| bp.address == BPMEM_PE_TOKEN_INT_ID
|
||||
|| bp.address == BPMEM_LOADTLUT0
|
||||
|| bp.address == BPMEM_LOADTLUT1
|
||||
|| bp.address == BPMEM_TEXINVALIDATE
|
||||
|| bp.address == BPMEM_PRELOAD_MODE
|
||||
|| bp.address == BPMEM_CLEAR_PIXEL_PERF))
|
||||
if (!(bp.address == BPMEM_TRIGGER_EFB_COPY ||
|
||||
bp.address == BPMEM_CLEARBBOX1 ||
|
||||
bp.address == BPMEM_CLEARBBOX2 ||
|
||||
bp.address == BPMEM_SETDRAWDONE ||
|
||||
bp.address == BPMEM_PE_TOKEN_ID ||
|
||||
bp.address == BPMEM_PE_TOKEN_INT_ID ||
|
||||
bp.address == BPMEM_LOADTLUT0 ||
|
||||
bp.address == BPMEM_LOADTLUT1 ||
|
||||
bp.address == BPMEM_TEXINVALIDATE ||
|
||||
bp.address == BPMEM_PRELOAD_MODE ||
|
||||
bp.address == BPMEM_CLEAR_PIXEL_PERF))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -91,9 +91,9 @@ void BPWritten(const BPCmd& bp)
|
|||
case BPMEM_GENMODE: // Set the Generation Mode
|
||||
{
|
||||
PRIM_LOG("genmode: texgen=%d, col=%d, multisampling=%d, tev=%d, cullmode=%d, ind=%d, zfeeze=%d",
|
||||
bpmem.genMode.numtexgens, bpmem.genMode.numcolchans,
|
||||
bpmem.genMode.multisampling, bpmem.genMode.numtevstages+1, bpmem.genMode.cullmode,
|
||||
bpmem.genMode.numindstages, bpmem.genMode.zfreeze);
|
||||
bpmem.genMode.numtexgens, bpmem.genMode.numcolchans,
|
||||
bpmem.genMode.multisampling, bpmem.genMode.numtevstages+1, bpmem.genMode.cullmode,
|
||||
bpmem.genMode.numindstages, bpmem.genMode.zfreeze);
|
||||
|
||||
// Only call SetGenerationMode when cull mode changes.
|
||||
if (bp.changes & 0xC000)
|
||||
|
@ -109,15 +109,15 @@ void BPWritten(const BPCmd& bp)
|
|||
case BPMEM_IND_MTXA+6:
|
||||
case BPMEM_IND_MTXB+6:
|
||||
case BPMEM_IND_MTXC+6:
|
||||
if(bp.changes)
|
||||
if (bp.changes)
|
||||
PixelShaderManager::SetIndMatrixChanged((bp.address - BPMEM_IND_MTXA) / 3);
|
||||
break;
|
||||
case BPMEM_RAS1_SS0: // Index Texture Coordinate Scale 0
|
||||
if(bp.changes)
|
||||
if (bp.changes)
|
||||
PixelShaderManager::SetIndTexScaleChanged(false);
|
||||
break;
|
||||
case BPMEM_RAS1_SS1: // Index Texture Coordinate Scale 1
|
||||
if(bp.changes)
|
||||
if (bp.changes)
|
||||
PixelShaderManager::SetIndTexScaleChanged(true);
|
||||
break;
|
||||
// ----------------
|
||||
|
@ -166,9 +166,9 @@ void BPWritten(const BPCmd& bp)
|
|||
case BPMEM_CONSTANTALPHA: // Set Destination Alpha
|
||||
{
|
||||
PRIM_LOG("constalpha: alp=%d, en=%d", bpmem.dstalpha.alpha, bpmem.dstalpha.enable);
|
||||
if(bp.changes & 0xFF)
|
||||
if (bp.changes & 0xFF)
|
||||
PixelShaderManager::SetDestAlpha();
|
||||
if(bp.changes & 0x100)
|
||||
if (bp.changes & 0x100)
|
||||
SetBlendMode();
|
||||
break;
|
||||
}
|
||||
|
@ -306,14 +306,14 @@ void BPWritten(const BPCmd& bp)
|
|||
case BPMEM_ALPHACOMPARE: // Compare Alpha Values
|
||||
PRIM_LOG("alphacmp: ref0=%d, ref1=%d, comp0=%d, comp1=%d, logic=%d", bpmem.alpha_test.ref0,
|
||||
bpmem.alpha_test.ref1, bpmem.alpha_test.comp0, bpmem.alpha_test.comp1, bpmem.alpha_test.logic);
|
||||
if(bp.changes & 0xFFFF)
|
||||
if (bp.changes & 0xFFFF)
|
||||
PixelShaderManager::SetAlpha();
|
||||
if(bp.changes)
|
||||
if (bp.changes)
|
||||
g_renderer->SetColorMask();
|
||||
break;
|
||||
case BPMEM_BIAS: // BIAS
|
||||
PRIM_LOG("ztex bias=0x%x", bpmem.ztex1.bias);
|
||||
if(bp.changes)
|
||||
if (bp.changes)
|
||||
PixelShaderManager::SetZTextureBias();
|
||||
break;
|
||||
case BPMEM_ZTEX2: // Z Texture type
|
||||
|
@ -390,7 +390,7 @@ void BPWritten(const BPCmd& bp)
|
|||
|
||||
case BPMEM_ZCOMPARE: // Set the Z-Compare and EFB pixel format
|
||||
OnPixelFormatChange();
|
||||
if(bp.changes & 7)
|
||||
if (bp.changes & 7)
|
||||
{
|
||||
SetBlendMode(); // dual source could be activated by changing to PIXELFMT_RGBA6_Z24
|
||||
g_renderer->SetColorMask(); // alpha writing needs to be disabled if the new pixel format doesn't have an alpha channel
|
||||
|
@ -424,7 +424,7 @@ void BPWritten(const BPCmd& bp)
|
|||
|
||||
case BPMEM_CLEAR_PIXEL_PERF:
|
||||
// GXClearPixMetric writes 0xAAA here, Sunshine alternates this register between values 0x000 and 0xAAA
|
||||
if(PerfQueryBase::ShouldEmulate())
|
||||
if (PerfQueryBase::ShouldEmulate())
|
||||
g_perf_query->ResetQuery();
|
||||
break;
|
||||
|
||||
|
@ -505,7 +505,7 @@ void BPWritten(const BPCmd& bp)
|
|||
case BPMEM_SU_TSIZE+12:
|
||||
case BPMEM_SU_SSIZE+14:
|
||||
case BPMEM_SU_TSIZE+14:
|
||||
if(bp.changes)
|
||||
if (bp.changes)
|
||||
PixelShaderManager::SetTexCoordChanged((bp.address - BPMEM_SU_SSIZE) >> 1);
|
||||
break;
|
||||
// ------------------------
|
||||
|
|
|
@ -310,8 +310,9 @@ void STACKALIGN GatherPipeBursted()
|
|||
{
|
||||
// In multibuffer mode is not allowed write in the same FIFO attached to the GPU.
|
||||
// Fix Pokemon XD in DC mode.
|
||||
if((ProcessorInterface::Fifo_CPUEnd == fifo.CPEnd) && (ProcessorInterface::Fifo_CPUBase == fifo.CPBase)
|
||||
&& fifo.CPReadWriteDistance > 0)
|
||||
if ((ProcessorInterface::Fifo_CPUEnd == fifo.CPEnd) &&
|
||||
(ProcessorInterface::Fifo_CPUBase == fifo.CPBase) &&
|
||||
fifo.CPReadWriteDistance > 0)
|
||||
{
|
||||
ProcessFifoAllDistance();
|
||||
}
|
||||
|
@ -509,17 +510,17 @@ void SetCpControlRegister()
|
|||
fifo.bFF_LoWatermarkInt = m_CPCtrlReg.FifoUnderflowIntEnable;
|
||||
fifo.bFF_GPLinkEnable = m_CPCtrlReg.GPLinkEnable;
|
||||
|
||||
if(m_CPCtrlReg.GPReadEnable && m_CPCtrlReg.GPLinkEnable)
|
||||
if (m_CPCtrlReg.GPReadEnable && m_CPCtrlReg.GPLinkEnable)
|
||||
{
|
||||
ProcessorInterface::Fifo_CPUWritePointer = fifo.CPWritePointer;
|
||||
ProcessorInterface::Fifo_CPUBase = fifo.CPBase;
|
||||
ProcessorInterface::Fifo_CPUEnd = fifo.CPEnd;
|
||||
}
|
||||
|
||||
if(fifo.bFF_GPReadEnable && !m_CPCtrlReg.GPReadEnable)
|
||||
if (fifo.bFF_GPReadEnable && !m_CPCtrlReg.GPReadEnable)
|
||||
{
|
||||
fifo.bFF_GPReadEnable = m_CPCtrlReg.GPReadEnable;
|
||||
while(fifo.isGpuReadingData) Common::YieldCPU();
|
||||
while (fifo.isGpuReadingData) Common::YieldCPU();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ void GFXDebuggerCheckAndPause(bool update)
|
|||
if (GFXDebuggerPauseFlag)
|
||||
{
|
||||
g_pdebugger->OnPause();
|
||||
while( GFXDebuggerPauseFlag )
|
||||
while ( GFXDebuggerPauseFlag )
|
||||
{
|
||||
g_video_backend->UpdateFPSDisplay("Paused by Video Debugger");
|
||||
|
||||
|
@ -93,7 +93,7 @@ void GFXDebuggerBase::DumpPixelShader(const char* path)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(g_ActiveConfig.backend_info.bSupportsDualSourceBlend)
|
||||
if (g_ActiveConfig.backend_info.bSupportsDualSourceBlend)
|
||||
{
|
||||
output = "Using dual source blending for destination alpha:\n";
|
||||
/// output += GeneratePixelShaderCode(DSTALPHA_DUAL_SOURCE_BLEND, g_ActiveConfig.backend_info.APIType, g_nativeVertexFmt->m_components);
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace DriverDetails
|
|||
m_family = family;
|
||||
|
||||
if (driver == DRIVER_UNKNOWN)
|
||||
switch(vendor)
|
||||
switch (vendor)
|
||||
{
|
||||
case VENDOR_NVIDIA:
|
||||
case VENDOR_TEGRA:
|
||||
|
@ -91,15 +91,14 @@ namespace DriverDetails
|
|||
break;
|
||||
}
|
||||
|
||||
for(auto& bug : m_known_bugs)
|
||||
for (auto& bug : m_known_bugs)
|
||||
{
|
||||
if(
|
||||
( bug.m_os & m_os ) &&
|
||||
( bug.m_vendor == m_vendor || bug.m_vendor == VENDOR_ALL ) &&
|
||||
( bug.m_driver == m_driver || bug.m_driver == DRIVER_ALL ) &&
|
||||
( bug.m_family == m_family || bug.m_family == -1) &&
|
||||
( bug.m_versionstart <= m_version || bug.m_versionstart == -1 ) &&
|
||||
( bug.m_versionend > m_version || bug.m_versionend == -1 )
|
||||
if (( bug.m_os & m_os ) &&
|
||||
( bug.m_vendor == m_vendor || bug.m_vendor == VENDOR_ALL ) &&
|
||||
( bug.m_driver == m_driver || bug.m_driver == DRIVER_ALL ) &&
|
||||
( bug.m_family == m_family || bug.m_family == -1) &&
|
||||
( bug.m_versionstart <= m_version || bug.m_versionstart == -1 ) &&
|
||||
( bug.m_versionend > m_version || bug.m_versionend == -1 )
|
||||
)
|
||||
m_bugs.insert(std::make_pair(bug.m_bug, bug));
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ HWND GetParentWnd()
|
|||
|
||||
LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( iMsg )
|
||||
switch ( iMsg )
|
||||
{
|
||||
case WM_PAINT:
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
|||
/* Post the mouse events to the main window, it's necessary, because the difference between the
|
||||
keyboard inputs is that these events only appear here, not in the parent window or any other WndProc()*/
|
||||
case WM_LBUTTONDOWN:
|
||||
if(g_ActiveConfig.backend_info.bSupports3DVision && g_ActiveConfig.b3DVision)
|
||||
if (g_ActiveConfig.backend_info.bSupports3DVision && g_ActiveConfig.b3DVision)
|
||||
{
|
||||
// This basically throws away the left button down input when b3DVision is activated so WX
|
||||
// can't get access to it, stopping focus pulling on mouse click.
|
||||
|
|
|
@ -95,7 +95,7 @@ void ExitGpuLoop()
|
|||
// This should break the wait loop in CPU thread
|
||||
CommandProcessor::fifo.bFF_GPReadEnable = false;
|
||||
SCPFifoStruct &fifo = CommandProcessor::fifo;
|
||||
while(fifo.isGpuReadingData) Common::YieldCPU();
|
||||
while (fifo.isGpuReadingData) Common::YieldCPU();
|
||||
// Terminate GPU thread loop
|
||||
GpuRunningState = false;
|
||||
EmuRunningState = true;
|
||||
|
@ -180,7 +180,7 @@ void RunGpuLoop()
|
|||
|
||||
Common::AtomicStore(fifo.CPReadPointer, readPtr);
|
||||
Common::AtomicAdd(fifo.CPReadWriteDistance, -32);
|
||||
if((GetVideoBufferEndPtr() - g_pVideoData) == 0)
|
||||
if ((GetVideoBufferEndPtr() - g_pVideoData) == 0)
|
||||
Common::AtomicStore(fifo.SafeCPReadPointer, fifo.CPReadPointer);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ static u16* (*primitive_table[8])(u16*, u32, u32);
|
|||
|
||||
void IndexGenerator::Init()
|
||||
{
|
||||
if(g_Config.backend_info.bSupportsPrimitiveRestart)
|
||||
if (g_Config.backend_info.bSupportsPrimitiveRestart)
|
||||
{
|
||||
primitive_table[0] = IndexGenerator::AddQuads<true>;
|
||||
primitive_table[2] = IndexGenerator::AddList<true>;
|
||||
|
@ -58,7 +58,7 @@ template <bool pr> __forceinline u16* IndexGenerator::WriteTriangle(u16 *Iptr, u
|
|||
*Iptr++ = index1;
|
||||
*Iptr++ = index2;
|
||||
*Iptr++ = index3;
|
||||
if(pr)
|
||||
if (pr)
|
||||
*Iptr++ = s_primitive_restart;
|
||||
return Iptr;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ template <bool pr> u16* IndexGenerator::AddList(u16 *Iptr, u32 const numVerts, u
|
|||
|
||||
template <bool pr> u16* IndexGenerator::AddStrip(u16 *Iptr, u32 const numVerts, u32 index)
|
||||
{
|
||||
if(pr)
|
||||
if (pr)
|
||||
{
|
||||
for (u32 i = 0; i < numVerts; ++i)
|
||||
{
|
||||
|
@ -122,9 +122,9 @@ template <bool pr> u16* IndexGenerator::AddFan(u16 *Iptr, u32 numVerts, u32 inde
|
|||
{
|
||||
u32 i = 2;
|
||||
|
||||
if(pr)
|
||||
if (pr)
|
||||
{
|
||||
for(; i+3<=numVerts; i+=3)
|
||||
for (; i+3<=numVerts; i+=3)
|
||||
{
|
||||
*Iptr++ = index + i - 1;
|
||||
*Iptr++ = index + i + 0;
|
||||
|
@ -134,7 +134,7 @@ template <bool pr> u16* IndexGenerator::AddFan(u16 *Iptr, u32 numVerts, u32 inde
|
|||
*Iptr++ = s_primitive_restart;
|
||||
}
|
||||
|
||||
for(; i+2<=numVerts; i+=2)
|
||||
for (; i+2<=numVerts; i+=2)
|
||||
{
|
||||
*Iptr++ = index + i - 1;
|
||||
*Iptr++ = index + i + 0;
|
||||
|
@ -173,7 +173,7 @@ template <bool pr> u16* IndexGenerator::AddQuads(u16 *Iptr, u32 numVerts, u32 in
|
|||
u32 i = 3;
|
||||
for (; i < numVerts; i+=4)
|
||||
{
|
||||
if(pr)
|
||||
if (pr)
|
||||
{
|
||||
*Iptr++ = index + i - 2;
|
||||
*Iptr++ = index + i - 1;
|
||||
|
@ -189,7 +189,7 @@ template <bool pr> u16* IndexGenerator::AddQuads(u16 *Iptr, u32 numVerts, u32 in
|
|||
}
|
||||
|
||||
// three vertices remaining, so render a triangle
|
||||
if(i == numVerts)
|
||||
if (i == numVerts)
|
||||
{
|
||||
Iptr = WriteTriangle<pr>(Iptr, index+numVerts-3, index+numVerts-2, index+numVerts-1);
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com
|
|||
object.Write("lacc.w = 1.0;\n");
|
||||
}
|
||||
|
||||
if(color.enablelighting && alpha.enablelighting)
|
||||
if (color.enablelighting && alpha.enablelighting)
|
||||
{
|
||||
// both have lighting, test if they use the same lights
|
||||
int mask = 0;
|
||||
|
@ -217,10 +217,10 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com
|
|||
uid_data.diffusefunc |= alpha.diffusefunc << (2*(j+2));
|
||||
uid_data.light_mask |= color.GetFullLightMask() << (8*j);
|
||||
uid_data.light_mask |= alpha.GetFullLightMask() << (8*(j+2));
|
||||
if(color.lightparams == alpha.lightparams)
|
||||
if (color.lightparams == alpha.lightparams)
|
||||
{
|
||||
mask = color.GetFullLightMask() & alpha.GetFullLightMask();
|
||||
if(mask)
|
||||
if (mask)
|
||||
{
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ void VideoBackendHardware::Video_SetRendering(bool bEnabled)
|
|||
// Run from the graphics thread (from Fifo.cpp)
|
||||
void VideoFifo_CheckSwapRequest()
|
||||
{
|
||||
if(g_ActiveConfig.bUseXFB)
|
||||
if (g_ActiveConfig.bUseXFB)
|
||||
{
|
||||
if (Common::AtomicLoadAcquire(s_swapRequested))
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
|
|||
{
|
||||
if (g_ActiveConfig.bUseXFB)
|
||||
{
|
||||
if(Common::AtomicLoadAcquire(s_swapRequested))
|
||||
if (Common::AtomicLoadAcquire(s_swapRequested))
|
||||
{
|
||||
u32 aLower = xfbAddr;
|
||||
u32 aUpper = xfbAddr + 2 * fbWidth * fbHeight;
|
||||
|
@ -194,7 +194,7 @@ void VideoFifo_CheckPerfQueryRequest()
|
|||
|
||||
u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type)
|
||||
{
|
||||
if(!g_perf_query->ShouldEmulate())
|
||||
if (!g_perf_query->ShouldEmulate())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ void AddMessage(const std::string& str, u32 ms)
|
|||
|
||||
void DrawMessages()
|
||||
{
|
||||
if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages)
|
||||
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages)
|
||||
return;
|
||||
|
||||
int left = 25, top = 15;
|
||||
|
|
|
@ -371,7 +371,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
|||
for (unsigned int i = 0; i < numTexgen; ++i)
|
||||
out.Write(",\n in %s float3 uv%d : TEXCOORD%d", optCentroid, i, i);
|
||||
out.Write(",\n in %s float4 clipPos : TEXCOORD%d", optCentroid, numTexgen);
|
||||
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
out.Write(",\n in %s float4 Normal : TEXCOORD%d", optCentroid, numTexgen + 1);
|
||||
out.Write(" ) {\n");
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
|||
RegisterStates[0].AlphaNeedOverflowControl = false;
|
||||
RegisterStates[0].ColorNeedOverflowControl = false;
|
||||
RegisterStates[0].AuxStored = false;
|
||||
for(int i = 1; i < 4; i++)
|
||||
for (int i = 1; i < 4; i++)
|
||||
{
|
||||
RegisterStates[i].AlphaNeedOverflowControl = true;
|
||||
RegisterStates[i].ColorNeedOverflowControl = true;
|
||||
|
@ -515,13 +515,13 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
|||
{
|
||||
// The results of the last texenv stage are put onto the screen,
|
||||
// regardless of the used destination register
|
||||
if(bpmem.combiners[numStages - 1].colorC.dest != 0)
|
||||
if (bpmem.combiners[numStages - 1].colorC.dest != 0)
|
||||
{
|
||||
bool retrieveFromAuxRegister = !RegisterStates[bpmem.combiners[numStages - 1].colorC.dest].ColorNeedOverflowControl && RegisterStates[bpmem.combiners[numStages - 1].colorC.dest].AuxStored;
|
||||
out.Write("\tprev.rgb = %s%s;\n", retrieveFromAuxRegister ? "c" : "" , tevCOutputTable[bpmem.combiners[numStages - 1].colorC.dest]);
|
||||
RegisterStates[0].ColorNeedOverflowControl = RegisterStates[bpmem.combiners[numStages - 1].colorC.dest].ColorNeedOverflowControl;
|
||||
}
|
||||
if(bpmem.combiners[numStages - 1].alphaC.dest != 0)
|
||||
if (bpmem.combiners[numStages - 1].alphaC.dest != 0)
|
||||
{
|
||||
bool retrieveFromAuxRegister = !RegisterStates[bpmem.combiners[numStages - 1].alphaC.dest].AlphaNeedOverflowControl && RegisterStates[bpmem.combiners[numStages - 1].alphaC.dest].AuxStored;
|
||||
out.Write("\tprev.a = %s%s;\n", retrieveFromAuxRegister ? "c" : "" , tevAOutputTable[bpmem.combiners[numStages - 1].alphaC.dest]);
|
||||
|
@ -529,7 +529,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
|||
}
|
||||
}
|
||||
// emulation of unsigned 8 overflow when casting if needed
|
||||
if(RegisterStates[0].AlphaNeedOverflowControl || RegisterStates[0].ColorNeedOverflowControl)
|
||||
if (RegisterStates[0].AlphaNeedOverflowControl || RegisterStates[0].ColorNeedOverflowControl)
|
||||
out.Write("\tprev = frac(prev * (255.0/256.0)) * (256.0/255.0);\n");
|
||||
|
||||
AlphaTest::TEST_RESULT Pretest = bpmem.alpha_test.TestResult();
|
||||
|
@ -766,12 +766,12 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
uid_data.stagehash[n].cc = cc.hex & 0xFFFFFF;
|
||||
uid_data.stagehash[n].ac = ac.hex & 0xFFFFF0; // Storing rswap and tswap later
|
||||
|
||||
if(cc.a == TEVCOLORARG_RASA || cc.a == TEVCOLORARG_RASC
|
||||
|| cc.b == TEVCOLORARG_RASA || cc.b == TEVCOLORARG_RASC
|
||||
|| cc.c == TEVCOLORARG_RASA || cc.c == TEVCOLORARG_RASC
|
||||
|| cc.d == TEVCOLORARG_RASA || cc.d == TEVCOLORARG_RASC
|
||||
|| ac.a == TEVALPHAARG_RASA || ac.b == TEVALPHAARG_RASA
|
||||
|| ac.c == TEVALPHAARG_RASA || ac.d == TEVALPHAARG_RASA)
|
||||
if (cc.a == TEVCOLORARG_RASA || cc.a == TEVCOLORARG_RASC ||
|
||||
cc.b == TEVCOLORARG_RASA || cc.b == TEVCOLORARG_RASC ||
|
||||
cc.c == TEVCOLORARG_RASA || cc.c == TEVCOLORARG_RASC ||
|
||||
cc.d == TEVCOLORARG_RASA || cc.d == TEVCOLORARG_RASC ||
|
||||
ac.a == TEVALPHAARG_RASA || ac.b == TEVALPHAARG_RASA ||
|
||||
ac.c == TEVALPHAARG_RASA || ac.d == TEVALPHAARG_RASA)
|
||||
{
|
||||
const int i = bpmem.combiners[n].alphaC.rswap;
|
||||
uid_data.stagehash[n].ac |= bpmem.combiners[n].alphaC.rswap;
|
||||
|
@ -792,7 +792,7 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
if (!bHasIndStage)
|
||||
{
|
||||
// calc tevcord
|
||||
if(bHasTexCoord)
|
||||
if (bHasTexCoord)
|
||||
out.Write("tevcoord.xy = uv%d.xy;\n", texcoord);
|
||||
else
|
||||
out.Write("tevcoord.xy = float2(0.0, 0.0);\n");
|
||||
|
@ -820,15 +820,17 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
}
|
||||
|
||||
|
||||
if (cc.a == TEVCOLORARG_KONST || cc.b == TEVCOLORARG_KONST || cc.c == TEVCOLORARG_KONST || cc.d == TEVCOLORARG_KONST
|
||||
|| ac.a == TEVALPHAARG_KONST || ac.b == TEVALPHAARG_KONST || ac.c == TEVALPHAARG_KONST || ac.d == TEVALPHAARG_KONST)
|
||||
if (cc.a == TEVCOLORARG_KONST || cc.b == TEVCOLORARG_KONST ||
|
||||
cc.c == TEVCOLORARG_KONST || cc.d == TEVCOLORARG_KONST ||
|
||||
ac.a == TEVALPHAARG_KONST || ac.b == TEVALPHAARG_KONST ||
|
||||
ac.c == TEVALPHAARG_KONST || ac.d == TEVALPHAARG_KONST)
|
||||
{
|
||||
int kc = bpmem.tevksel[n / 2].getKC(n & 1);
|
||||
int ka = bpmem.tevksel[n / 2].getKA(n & 1);
|
||||
uid_data.stagehash[n].tevksel_kc = kc;
|
||||
uid_data.stagehash[n].tevksel_ka = ka;
|
||||
out.Write("konsttemp = float4(%s, %s);\n", tevKSelTableC[kc], tevKSelTableA[ka]);
|
||||
if(kc > 7 || ka > 7)
|
||||
if (kc > 7 || ka > 7)
|
||||
{
|
||||
out.Write("ckonsttemp = frac(konsttemp * (255.0/256.0)) * (256.0/255.0);\n");
|
||||
}
|
||||
|
@ -842,12 +844,13 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
out.SetConstantsUsed(C_KCOLORS+((ka-0xc)%4),C_KCOLORS+((ka-0xc)%4));
|
||||
}
|
||||
|
||||
if(cc.a == TEVCOLORARG_CPREV || cc.a == TEVCOLORARG_APREV
|
||||
|| cc.b == TEVCOLORARG_CPREV || cc.b == TEVCOLORARG_APREV
|
||||
|| cc.c == TEVCOLORARG_CPREV || cc.c == TEVCOLORARG_APREV
|
||||
|| ac.a == TEVALPHAARG_APREV || ac.b == TEVALPHAARG_APREV || ac.c == TEVALPHAARG_APREV)
|
||||
if (cc.a == TEVCOLORARG_CPREV || cc.a == TEVCOLORARG_APREV ||
|
||||
cc.b == TEVCOLORARG_CPREV || cc.b == TEVCOLORARG_APREV ||
|
||||
cc.c == TEVCOLORARG_CPREV || cc.c == TEVCOLORARG_APREV ||
|
||||
ac.a == TEVALPHAARG_APREV || ac.b == TEVALPHAARG_APREV ||
|
||||
ac.c == TEVALPHAARG_APREV)
|
||||
{
|
||||
if(RegisterStates[0].AlphaNeedOverflowControl || RegisterStates[0].ColorNeedOverflowControl)
|
||||
if (RegisterStates[0].AlphaNeedOverflowControl || RegisterStates[0].ColorNeedOverflowControl)
|
||||
{
|
||||
out.Write("cprev = frac(prev * (255.0/256.0)) * (256.0/255.0);\n");
|
||||
RegisterStates[0].AlphaNeedOverflowControl = false;
|
||||
|
@ -860,13 +863,14 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
RegisterStates[0].AuxStored = true;
|
||||
}
|
||||
|
||||
if(cc.a == TEVCOLORARG_C0 || cc.a == TEVCOLORARG_A0
|
||||
|| cc.b == TEVCOLORARG_C0 || cc.b == TEVCOLORARG_A0
|
||||
|| cc.c == TEVCOLORARG_C0 || cc.c == TEVCOLORARG_A0
|
||||
|| ac.a == TEVALPHAARG_A0 || ac.b == TEVALPHAARG_A0 || ac.c == TEVALPHAARG_A0)
|
||||
if (cc.a == TEVCOLORARG_C0 || cc.a == TEVCOLORARG_A0 ||
|
||||
cc.b == TEVCOLORARG_C0 || cc.b == TEVCOLORARG_A0 ||
|
||||
cc.c == TEVCOLORARG_C0 || cc.c == TEVCOLORARG_A0 ||
|
||||
ac.a == TEVALPHAARG_A0 || ac.b == TEVALPHAARG_A0 ||
|
||||
ac.c == TEVALPHAARG_A0)
|
||||
{
|
||||
out.SetConstantsUsed(C_COLORS+1,C_COLORS+1);
|
||||
if(RegisterStates[1].AlphaNeedOverflowControl || RegisterStates[1].ColorNeedOverflowControl)
|
||||
if (RegisterStates[1].AlphaNeedOverflowControl || RegisterStates[1].ColorNeedOverflowControl)
|
||||
{
|
||||
out.Write("cc0 = frac(c0 * (255.0/256.0)) * (256.0/255.0);\n");
|
||||
RegisterStates[1].AlphaNeedOverflowControl = false;
|
||||
|
@ -879,13 +883,14 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
RegisterStates[1].AuxStored = true;
|
||||
}
|
||||
|
||||
if(cc.a == TEVCOLORARG_C1 || cc.a == TEVCOLORARG_A1
|
||||
|| cc.b == TEVCOLORARG_C1 || cc.b == TEVCOLORARG_A1
|
||||
|| cc.c == TEVCOLORARG_C1 || cc.c == TEVCOLORARG_A1
|
||||
|| ac.a == TEVALPHAARG_A1 || ac.b == TEVALPHAARG_A1 || ac.c == TEVALPHAARG_A1)
|
||||
if (cc.a == TEVCOLORARG_C1 || cc.a == TEVCOLORARG_A1 ||
|
||||
cc.b == TEVCOLORARG_C1 || cc.b == TEVCOLORARG_A1 ||
|
||||
cc.c == TEVCOLORARG_C1 || cc.c == TEVCOLORARG_A1 ||
|
||||
ac.a == TEVALPHAARG_A1 || ac.b == TEVALPHAARG_A1 ||
|
||||
ac.c == TEVALPHAARG_A1)
|
||||
{
|
||||
out.SetConstantsUsed(C_COLORS+2,C_COLORS+2);
|
||||
if(RegisterStates[2].AlphaNeedOverflowControl || RegisterStates[2].ColorNeedOverflowControl)
|
||||
if (RegisterStates[2].AlphaNeedOverflowControl || RegisterStates[2].ColorNeedOverflowControl)
|
||||
{
|
||||
out.Write("cc1 = frac(c1 * (255.0/256.0)) * (256.0/255.0);\n");
|
||||
RegisterStates[2].AlphaNeedOverflowControl = false;
|
||||
|
@ -898,13 +903,14 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
RegisterStates[2].AuxStored = true;
|
||||
}
|
||||
|
||||
if(cc.a == TEVCOLORARG_C2 || cc.a == TEVCOLORARG_A2
|
||||
|| cc.b == TEVCOLORARG_C2 || cc.b == TEVCOLORARG_A2
|
||||
|| cc.c == TEVCOLORARG_C2 || cc.c == TEVCOLORARG_A2
|
||||
|| ac.a == TEVALPHAARG_A2 || ac.b == TEVALPHAARG_A2 || ac.c == TEVALPHAARG_A2)
|
||||
if (cc.a == TEVCOLORARG_C2 || cc.a == TEVCOLORARG_A2 ||
|
||||
cc.b == TEVCOLORARG_C2 || cc.b == TEVCOLORARG_A2 ||
|
||||
cc.c == TEVCOLORARG_C2 || cc.c == TEVCOLORARG_A2 ||
|
||||
ac.a == TEVALPHAARG_A2 || ac.b == TEVALPHAARG_A2 ||
|
||||
ac.c == TEVALPHAARG_A2)
|
||||
{
|
||||
out.SetConstantsUsed(C_COLORS+3,C_COLORS+3);
|
||||
if(RegisterStates[3].AlphaNeedOverflowControl || RegisterStates[3].ColorNeedOverflowControl)
|
||||
if (RegisterStates[3].AlphaNeedOverflowControl || RegisterStates[3].ColorNeedOverflowControl)
|
||||
{
|
||||
out.Write("cc2 = frac(c2 * (255.0/256.0)) * (256.0/255.0);\n");
|
||||
RegisterStates[3].AlphaNeedOverflowControl = false;
|
||||
|
@ -948,7 +954,7 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
if (cc.shift > TEVSCALE_1)
|
||||
out.Write("%s*(", tevScaleTable[cc.shift]);
|
||||
|
||||
if(!(cc.d == TEVCOLORARG_ZERO && cc.op == TEVOP_ADD))
|
||||
if (!(cc.d == TEVCOLORARG_ZERO && cc.op == TEVOP_ADD))
|
||||
out.Write("%s%s", tevCInputTable[cc.d], tevOpTable[cc.op]);
|
||||
|
||||
if (cc.a == cc.b)
|
||||
|
@ -997,7 +1003,7 @@ static inline void WriteStage(T& out, pixel_shader_uid_data& uid_data, int n, AP
|
|||
if (ac.shift > TEVSCALE_1)
|
||||
out.Write("%s*(", tevScaleTable[ac.shift]);
|
||||
|
||||
if(!(ac.d == TEVALPHAARG_ZERO && ac.op == TEVOP_ADD))
|
||||
if (!(ac.d == TEVALPHAARG_ZERO && ac.op == TEVOP_ADD))
|
||||
out.Write("%s.a%s", tevAInputTable[ac.d], tevOpTable[ac.op]);
|
||||
|
||||
if (ac.a == ac.b)
|
||||
|
@ -1095,7 +1101,7 @@ static inline void WriteAlphaTest(T& out, pixel_shader_uid_data& uid_data, API_T
|
|||
out.Write("\t\tocol0 = float4(0.0, 0.0, 0.0, 0.0);\n");
|
||||
if (dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND)
|
||||
out.Write("\t\tocol1 = float4(0.0, 0.0, 0.0, 0.0);\n");
|
||||
if(per_pixel_depth)
|
||||
if (per_pixel_depth)
|
||||
out.Write("\t\tdepth = 1.0;\n");
|
||||
|
||||
// HAXX: zcomploc (aka early_ztest) is a way to control whether depth test is done before
|
||||
|
@ -1138,7 +1144,7 @@ template<class T>
|
|||
static inline void WriteFog(T& out, pixel_shader_uid_data& uid_data)
|
||||
{
|
||||
uid_data.fog_fsel = bpmem.fog.c_proj_fsel.fsel;
|
||||
if(bpmem.fog.c_proj_fsel.fsel == 0)
|
||||
if (bpmem.fog.c_proj_fsel.fsel == 0)
|
||||
return; // no Fog
|
||||
|
||||
uid_data.fog_proj = bpmem.fog.c_proj_fsel.proj;
|
||||
|
|
|
@ -72,7 +72,7 @@ void PixelShaderManager::SetConstants()
|
|||
{
|
||||
// set by two components, so keep changed flag here
|
||||
// TODO: try to split both registers and move this logic to the shader
|
||||
if(!g_ActiveConfig.bDisableFog && bpmem.fogRange.Base.Enabled == 1)
|
||||
if (!g_ActiveConfig.bDisableFog && bpmem.fogRange.Base.Enabled == 1)
|
||||
{
|
||||
//bpmem.fogRange.Base.Center : center of the viewport in x axis. observation: bpmem.fogRange.Base.Center = realcenter + 342;
|
||||
int center = ((u32)bpmem.fogRange.Base.Center) - 342;
|
||||
|
@ -137,7 +137,7 @@ void PixelShaderManager::SetConstants()
|
|||
}
|
||||
}
|
||||
|
||||
if(s_bViewPortChanged)
|
||||
if (s_bViewPortChanged)
|
||||
{
|
||||
constants.zbias[1][0] = xfregs.viewport.farZ / 16777216.0f;
|
||||
constants.zbias[1][1] = xfregs.viewport.zRange / 16777216.0f;
|
||||
|
@ -179,7 +179,7 @@ void PixelShaderManager::SetTexDims(int texmapid, u32 width, u32 height, u32 wra
|
|||
{
|
||||
// TODO: move this check out to callee. There we could just call this function on texture changes
|
||||
// or better, use textureSize() in glsl
|
||||
if(constants.texdims[texmapid][0] != 1.0f/width || constants.texdims[texmapid][1] != 1.0f/height)
|
||||
if (constants.texdims[texmapid][0] != 1.0f/width || constants.texdims[texmapid][1] != 1.0f/height)
|
||||
dirty = true;
|
||||
|
||||
constants.texdims[texmapid][0] = 1.0f/width;
|
||||
|
@ -280,7 +280,7 @@ void PixelShaderManager::SetFogColorChanged()
|
|||
|
||||
void PixelShaderManager::SetFogParamChanged()
|
||||
{
|
||||
if(!g_ActiveConfig.bDisableFog)
|
||||
if (!g_ActiveConfig.bDisableFog)
|
||||
{
|
||||
constants.fog[1][0] = bpmem.fog.a.GetA();
|
||||
constants.fog[1][1] = (float)bpmem.fog.b_magnitude / 0xFFFFFF;
|
||||
|
@ -324,7 +324,7 @@ void PixelShaderManager::InvalidateXFRange(int start, int end)
|
|||
|
||||
void PixelShaderManager::SetMaterialColorChanged(int index, u32 color)
|
||||
{
|
||||
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
{
|
||||
constants.pmaterials[index][0] = ((color >> 24) & 0xFF) / 255.0f;
|
||||
constants.pmaterials[index][1] = ((color >> 16) & 0xFF) / 255.0f;
|
||||
|
|
|
@ -288,7 +288,7 @@ void Renderer::DrawDebugText()
|
|||
}
|
||||
|
||||
const char* ar_text = "";
|
||||
switch(g_ActiveConfig.iAspectRatio)
|
||||
switch (g_ActiveConfig.iAspectRatio)
|
||||
{
|
||||
case ASPECT_AUTO:
|
||||
ar_text = "Auto";
|
||||
|
|
|
@ -46,7 +46,7 @@ TextureCache::TextureCache()
|
|||
|
||||
TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
|
||||
|
||||
if(g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures)
|
||||
if (g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures)
|
||||
HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
|
||||
|
||||
SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
|
||||
|
@ -88,7 +88,7 @@ void TextureCache::OnConfigChanged(VideoConfig& config)
|
|||
{
|
||||
g_texture_cache->Invalidate();
|
||||
|
||||
if(g_ActiveConfig.bHiresTextures)
|
||||
if (g_ActiveConfig.bHiresTextures)
|
||||
HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
|
||||
|
||||
SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
|
||||
|
@ -125,10 +125,9 @@ void TextureCache::Cleanup()
|
|||
TexCache::iterator tcend = textures.end();
|
||||
while (iter != tcend)
|
||||
{
|
||||
if (frameCount > TEXTURE_KILL_THRESHOLD + iter->second->frameCount
|
||||
|
||||
// EFB copies living on the host GPU are unrecoverable and thus shouldn't be deleted
|
||||
&& ! iter->second->IsEfbCopy() )
|
||||
if (frameCount > TEXTURE_KILL_THRESHOLD + iter->second->frameCount &&
|
||||
// EFB copies living on the host GPU are unrecoverable and thus shouldn't be deleted
|
||||
!iter->second->IsEfbCopy())
|
||||
{
|
||||
delete iter->second;
|
||||
textures.erase(iter++);
|
||||
|
@ -421,9 +420,14 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
|
|||
//
|
||||
// TODO: Don't we need to force texture decoding to RGBA8 for dynamic EFB copies?
|
||||
// TODO: Actually, it should be enough if the internal texture format matches...
|
||||
if ((entry->type == TCET_NORMAL && width == entry->virtual_width && height == entry->virtual_height
|
||||
&& full_format == entry->format && entry->num_mipmaps > maxlevel)
|
||||
|| (entry->type == TCET_EC_DYNAMIC && entry->native_width == width && entry->native_height == height))
|
||||
if ((entry->type == TCET_NORMAL &&
|
||||
width == entry->virtual_width &&
|
||||
height == entry->virtual_height &&
|
||||
full_format == entry->format &&
|
||||
entry->num_mipmaps > maxlevel) ||
|
||||
(entry->type == TCET_EC_DYNAMIC &&
|
||||
entry->native_width == width &&
|
||||
entry->native_height == height))
|
||||
{
|
||||
// reuse the texture
|
||||
}
|
||||
|
@ -449,7 +453,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
|
|||
expandedHeight = height;
|
||||
|
||||
// If we thought we could reuse the texture before, make sure to pool it now!
|
||||
if(entry)
|
||||
if (entry)
|
||||
{
|
||||
delete entry;
|
||||
entry = nullptr;
|
||||
|
@ -750,7 +754,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
|
|||
ColorMask[4] = ColorMask[7] = 1.0f / 15.0f;
|
||||
|
||||
cbufid = 16;
|
||||
if(!efbHasAlpha) {
|
||||
if (!efbHasAlpha) {
|
||||
ColorMask[3] = 0.0f;
|
||||
fConstAdd[3] = 1.0f;
|
||||
cbufid = 17;
|
||||
|
@ -760,7 +764,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
|
|||
colmat[0] = colmat[4] = colmat[8] = colmat[15] = 1.0f;
|
||||
|
||||
cbufid = 18;
|
||||
if(!efbHasAlpha) {
|
||||
if (!efbHasAlpha) {
|
||||
ColorMask[3] = 0.0f;
|
||||
fConstAdd[3] = 1.0f;
|
||||
cbufid = 19;
|
||||
|
@ -771,7 +775,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
|
|||
colmat[3] = colmat[7] = colmat[11] = colmat[15] = 1.0f;
|
||||
|
||||
cbufid = 20;
|
||||
if(!efbHasAlpha) {
|
||||
if (!efbHasAlpha) {
|
||||
ColorMask[3] = 0.0f;
|
||||
fConstAdd[0] = 1.0f;
|
||||
fConstAdd[1] = 1.0f;
|
||||
|
@ -818,7 +822,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
|
|||
ColorMask[7] = 1.0f / 7.0f;
|
||||
|
||||
cbufid = 27;
|
||||
if(!efbHasAlpha) {
|
||||
if (!efbHasAlpha) {
|
||||
ColorMask[3] = 0.0f;
|
||||
fConstAdd[3] = 1.0f;
|
||||
cbufid = 28;
|
||||
|
@ -828,7 +832,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
|
|||
colmat[0] = colmat[5] = colmat[10] = colmat[15] = 1.0f;
|
||||
|
||||
cbufid = 29;
|
||||
if(!efbHasAlpha) {
|
||||
if (!efbHasAlpha) {
|
||||
ColorMask[3] = 0.0f;
|
||||
fConstAdd[3] = 1.0f;
|
||||
cbufid = 30;
|
||||
|
|
|
@ -584,7 +584,7 @@ void WriteZ24Encoder(char*& p, API_TYPE ApiType)
|
|||
WRITE(p, " expanded%i.b = depth%i;\n", i, i);
|
||||
}
|
||||
|
||||
WRITE(p, " if(!first) {\n");
|
||||
WRITE(p, " if (!first) {\n");
|
||||
// upper 16
|
||||
WRITE(p, " ocol0.b = expanded0.g / 255.0;\n");
|
||||
WRITE(p, " ocol0.g = expanded0.b / 255.0;\n");
|
||||
|
|
|
@ -728,7 +728,7 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
|
|||
{
|
||||
u16 *ptr = (u16 *)dst + (y + iy) * width + x;
|
||||
u16 *s = (u16 *)(src + 8 * xStep);
|
||||
for(int j = 0; j < 4; j++)
|
||||
for (int j = 0; j < 4; j++)
|
||||
*ptr++ = Common::swap16(*s++);
|
||||
}
|
||||
}
|
||||
|
@ -758,7 +758,7 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
|
|||
{
|
||||
u16 *ptr = (u16 *)dst + (y + iy) * width + x;
|
||||
u16 *s = (u16 *)(src + 8 * xStep);
|
||||
for(int j = 0; j < 4; j++)
|
||||
for (int j = 0; j < 4; j++)
|
||||
*ptr++ = Common::swap16(*s++);
|
||||
}
|
||||
}
|
||||
|
@ -857,7 +857,7 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
|
|||
for (int iy = 0, xStep = 8 * yStep; iy < 8; iy++,xStep++)
|
||||
decodebytesC4_5A3_To_rgba32(dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr);
|
||||
}
|
||||
else if(tlutfmt == 0)
|
||||
else if (tlutfmt == 0)
|
||||
{
|
||||
for (int y = 0; y < height; y += 8)
|
||||
for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8,yStep++)
|
||||
|
@ -919,7 +919,7 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
|
|||
for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
|
||||
decodebytesC8_5A3_To_RGBA32((u32*)dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr);
|
||||
}
|
||||
else if(tlutfmt == 0)
|
||||
else if (tlutfmt == 0)
|
||||
{
|
||||
for (int y = 0; y < height; y += 4)
|
||||
for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
|
||||
|
@ -992,7 +992,7 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
|
|||
{
|
||||
u32 *ptr = dst + (y + iy) * width + x;
|
||||
u16 *s = (u16 *)src;
|
||||
for(int j = 0; j < 4; j++)
|
||||
for (int j = 0; j < 4; j++)
|
||||
*ptr++ = decode565RGBA(Common::swap16(*s++));
|
||||
}
|
||||
}
|
||||
|
@ -1093,7 +1093,7 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in
|
|||
{
|
||||
for (int x=0; x < xcnt; x++)
|
||||
{
|
||||
switch(retval)
|
||||
switch (retval)
|
||||
{
|
||||
case PC_TEX_FMT_I8:
|
||||
{
|
||||
|
|
|
@ -791,7 +791,7 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
|
|||
{
|
||||
u16 *ptr = (u16 *)dst + (y + iy) * width + x;
|
||||
u16 *s = (u16 *)(src + 8 * xStep);
|
||||
for(int j = 0; j < 4; j++)
|
||||
for (int j = 0; j < 4; j++)
|
||||
*ptr++ = Common::swap16(*s++);
|
||||
}
|
||||
|
||||
|
@ -825,7 +825,7 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
|
|||
{
|
||||
u16 *ptr = (u16 *)dst + (y + iy) * width + x;
|
||||
u16 *s = (u16 *)(src + 8 * xStep);
|
||||
for(int j = 0; j < 4; j++)
|
||||
for (int j = 0; j < 4; j++)
|
||||
*ptr++ = Common::swap16(*s++);
|
||||
}
|
||||
}
|
||||
|
@ -974,7 +974,7 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
|
|||
for (int iy = 0, xStep = 8 * yStep; iy < 8; iy++,xStep++)
|
||||
decodebytesC4_5A3_To_rgba32(dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr);
|
||||
}
|
||||
else if(tlutfmt == 0)
|
||||
else if (tlutfmt == 0)
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int y = 0; y < height; y += 8)
|
||||
|
@ -1229,7 +1229,7 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
|
|||
for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
|
||||
decodebytesC8_5A3_To_RGBA32((u32*)dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr);
|
||||
}
|
||||
else if(tlutfmt == 0)
|
||||
else if (tlutfmt == 0)
|
||||
{
|
||||
#pragma omp parallel for
|
||||
for (int y = 0; y < height; y += 4)
|
||||
|
@ -2068,7 +2068,7 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in
|
|||
{
|
||||
for (int x=0; x < xcnt; x++)
|
||||
{
|
||||
switch(retval)
|
||||
switch (retval)
|
||||
{
|
||||
case PC_TEX_FMT_I8:
|
||||
{
|
||||
|
|
|
@ -567,7 +567,7 @@ void VertexLoader::CompileVertexTranslator()
|
|||
if (m_VtxDesc.Tex7MatIdx) {m_VertexSize += 1; components |= VB_HAS_TEXMTXIDX7; WriteCall(TexMtx_ReadDirect_UByte); }
|
||||
|
||||
// Write vertex position loader
|
||||
if(g_ActiveConfig.bUseBBox)
|
||||
if (g_ActiveConfig.bUseBBox)
|
||||
{
|
||||
WriteCall(UpdateBoundingBoxPrepare);
|
||||
WriteCall(VertexLoader_Position::GetFunction(m_VtxDesc.Position, m_VtxAttr.PosFormat, m_VtxAttr.PosElements));
|
||||
|
@ -947,7 +947,7 @@ void VertexLoader::SetVAT(u32 _group0, u32 _group1, u32 _group2)
|
|||
m_VtxAttr.texCoord[7].Format = vat.g2.Tex7CoordFormat;
|
||||
m_VtxAttr.texCoord[7].Frac = vat.g2.Tex7Frac;
|
||||
|
||||
if(!m_VtxAttr.ByteDequant) {
|
||||
if (!m_VtxAttr.ByteDequant) {
|
||||
ERROR_LOG(VIDEO, "ByteDequant is set to zero");
|
||||
}
|
||||
};
|
||||
|
|
|
@ -66,7 +66,7 @@ void VertexManager::PrepareForAdditionalData(int primitive, u32 count, u32 strid
|
|||
{
|
||||
Flush();
|
||||
|
||||
if(count > IndexGenerator::GetRemainingIndices())
|
||||
if (count > IndexGenerator::GetRemainingIndices())
|
||||
ERROR_LOG(VIDEO, "Too little remaining index values. Use 32-bit or reset them on flush.");
|
||||
if (count > GetRemainingIndices(primitive))
|
||||
ERROR_LOG(VIDEO, "VertexManager: Buffer not large enough for all indices! "
|
||||
|
@ -77,7 +77,7 @@ void VertexManager::PrepareForAdditionalData(int primitive, u32 count, u32 strid
|
|||
}
|
||||
|
||||
// need to alloc new buffer
|
||||
if(IsFlushed)
|
||||
if (IsFlushed)
|
||||
{
|
||||
g_vertex_manager->ResetBuffer(stride);
|
||||
IsFlushed = false;
|
||||
|
@ -88,7 +88,7 @@ u32 VertexManager::GetRemainingIndices(int primitive)
|
|||
{
|
||||
u32 index_len = MAXIBUFFERSIZE - IndexGenerator::GetIndexLen();
|
||||
|
||||
if(g_Config.backend_info.bSupportsPrimitiveRestart)
|
||||
if (g_Config.backend_info.bSupportsPrimitiveRestart)
|
||||
{
|
||||
switch (primitive)
|
||||
{
|
||||
|
@ -216,13 +216,15 @@ void VertexManager::Flush()
|
|||
VertexShaderManager::SetConstants();
|
||||
PixelShaderManager::SetConstants();
|
||||
|
||||
bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate
|
||||
&& bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
|
||||
bool useDstAlpha = !g_ActiveConfig.bDstAlphaPass &&
|
||||
bpmem.dstalpha.enable &&
|
||||
bpmem.blendmode.alphaupdate &&
|
||||
bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24;
|
||||
|
||||
if(PerfQueryBase::ShouldEmulate())
|
||||
if (PerfQueryBase::ShouldEmulate())
|
||||
g_perf_query->EnableQuery(bpmem.zcontrol.early_ztest ? PQG_ZCOMP_ZCOMPLOC : PQG_ZCOMP);
|
||||
g_vertex_manager->vFlush(useDstAlpha);
|
||||
if(PerfQueryBase::ShouldEmulate())
|
||||
if (PerfQueryBase::ShouldEmulate())
|
||||
g_perf_query->DisableQuery(bpmem.zcontrol.early_ztest ? PQG_ZCOMP_ZCOMPLOC : PQG_ZCOMP);
|
||||
|
||||
GFX_DEBUGGER_PAUSE_AT(NEXT_FLUSH, true);
|
||||
|
|
|
@ -49,7 +49,7 @@ static inline void GenerateVSOutputStruct(T& object, API_TYPE api_type)
|
|||
|
||||
DefineVSOutputStructMember(object, api_type, "float4", "clipPos", -1, "TEXCOORD", xfregs.numTexGen.numTexGens);
|
||||
|
||||
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
DefineVSOutputStructMember(object, api_type, "float4", "Normal", -1, "TEXCOORD", xfregs.numTexGen.numTexGens + 1);
|
||||
|
||||
object.Write("};\n");
|
||||
|
@ -104,7 +104,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
|
|||
uid_data.components = components;
|
||||
uid_data.pixel_lighting = (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting);
|
||||
|
||||
if(api_type == API_OPENGL)
|
||||
if (api_type == API_OPENGL)
|
||||
{
|
||||
out.Write("in float4 rawpos; // ATTR%d,\n", SHADER_POSITION_ATTRIB);
|
||||
if (components & VB_HAS_POSMTXIDX)
|
||||
|
@ -384,7 +384,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
|
|||
// clipPos/w needs to be done in pixel shader, not here
|
||||
out.Write("o.clipPos = float4(pos.x,pos.y,o.pos.z,o.pos.w);\n");
|
||||
|
||||
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
{
|
||||
out.Write("o.Normal = float4(_norm0.x,_norm0.y,_norm0.z,pos.z);\n");
|
||||
|
||||
|
@ -418,7 +418,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
|
|||
//seems to get rather complicated
|
||||
}
|
||||
|
||||
if(api_type == API_OPENGL)
|
||||
if (api_type == API_OPENGL)
|
||||
{
|
||||
// Bit ugly here
|
||||
// TODO: Make pretty
|
||||
|
@ -428,7 +428,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
|
|||
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i)
|
||||
out.Write(" uv%d_2.xyz = o.tex%d;\n", i, i);
|
||||
out.Write(" clipPos_2 = o.clipPos;\n");
|
||||
if(g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
if (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting)
|
||||
out.Write(" Normal_2 = o.Normal;\n");
|
||||
|
||||
out.Write("colors_02 = o.colors_0;\n");
|
||||
|
|
|
@ -233,7 +233,7 @@ void VertexShaderManager::SetConstants()
|
|||
{
|
||||
int startn = nNormalMatricesChanged[0] / 3;
|
||||
int endn = (nNormalMatricesChanged[1] + 2) / 3;
|
||||
for(int i=startn; i<endn; i++)
|
||||
for (int i=startn; i<endn; i++)
|
||||
{
|
||||
memcpy(constants.normalmatrices[i], &xfmem[XFMEM_NORMALMATRICES + 3*i], 12);
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ void VertexShaderManager::SetConstants()
|
|||
g_renderer->SetViewport();
|
||||
|
||||
// Update projection if the viewport isn't 1:1 useable
|
||||
if(!g_ActiveConfig.backend_info.bSupportsOversizedViewports)
|
||||
if (!g_ActiveConfig.backend_info.bSupportsOversizedViewports)
|
||||
{
|
||||
ViewportCorrectionMatrix(s_viewportCorrection);
|
||||
bProjectionChanged = true;
|
||||
|
@ -385,7 +385,7 @@ void VertexShaderManager::SetConstants()
|
|||
|
||||
float *rawProjection = xfregs.projection.rawProjection;
|
||||
|
||||
switch(xfregs.projection.type)
|
||||
switch (xfregs.projection.type)
|
||||
{
|
||||
case GX_PERSPECTIVE:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue