mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 22:41:18 +12:00
mask out color attachments
This commit is contained in:
parent
e4068856bc
commit
68d328b094
2 changed files with 5 additions and 8 deletions
|
@ -855,6 +855,7 @@ void LatteDecompiler_analyze(LatteDecompilerShaderContext* shaderContext, LatteD
|
|||
// check if textures are used as render targets
|
||||
if (shader->shaderType == LatteConst::ShaderType::Pixel)
|
||||
{
|
||||
uint8 colorBufferMask = LatteMRT::GetActiveColorBufferMask(shader, *shaderContext->contextRegistersNew);
|
||||
for (sint32 i = 0; i < shader->textureUnitListCount; i++)
|
||||
{
|
||||
sint32 textureIndex = shader->textureUnitList[i];
|
||||
|
@ -867,15 +868,11 @@ void LatteDecompiler_analyze(LatteDecompilerShaderContext* shaderContext, LatteD
|
|||
|
||||
for (sint32 j = 0; j < LATTE_NUM_COLOR_TARGET; j++)
|
||||
{
|
||||
if (((colorBufferMask) & (1 << j)) == 0)
|
||||
continue; // color buffer not enabled
|
||||
|
||||
uint32* colorBufferRegBase = shaderContext->contextRegisters + (mmCB_COLOR0_BASE + j);
|
||||
uint32 regColorBufferBase = colorBufferRegBase[mmCB_COLOR0_BASE - mmCB_COLOR0_BASE] & 0xFFFFFF00; // the low 8 bits are ignored? How to Survive seems to rely on this
|
||||
uint32 regColorSize = colorBufferRegBase[mmCB_COLOR0_SIZE - mmCB_COLOR0_BASE];
|
||||
uint32 regColorInfo = colorBufferRegBase[mmCB_COLOR0_INFO - mmCB_COLOR0_BASE];
|
||||
uint32 regColorView = colorBufferRegBase[mmCB_COLOR0_VIEW - mmCB_COLOR0_BASE];
|
||||
// decode color buffer reg info
|
||||
Latte::E_HWTILEMODE colorBufferTileMode = (Latte::E_HWTILEMODE)((regColorInfo >> 8) & 0xF);
|
||||
uint32 numberType = (regColorInfo >> 12) & 7;
|
||||
Latte::E_GX2SURFFMT colorBufferFormat = LatteMRT::GetColorBufferFormat(j, *shaderContext->contextRegistersNew);
|
||||
|
||||
MPTR colorBufferPhysMem = regColorBufferBase;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue