mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 14:31:17 +12:00
fix: sample compare component count
This commit is contained in:
parent
f0cf61461c
commit
86f364889a
1 changed files with 77 additions and 75 deletions
|
@ -2295,6 +2295,10 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
}
|
||||
else
|
||||
{
|
||||
// sample_compare returns a float, need to convert to float4
|
||||
if (isCompare)
|
||||
src->addFmt("float4(");
|
||||
|
||||
if (emulateCompare)
|
||||
{
|
||||
cemu_assert_debug(!isGather);
|
||||
|
@ -2555,10 +2559,10 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
src->add(")");
|
||||
}
|
||||
|
||||
// sample_compare doesn't return a float
|
||||
if (!isCompare)
|
||||
{
|
||||
if( texOpcode == GPU7_TEX_INST_SAMPLE_C || texOpcode == GPU7_TEX_INST_SAMPLE_C_LZ )
|
||||
if (isCompare)
|
||||
src->add(")");
|
||||
|
||||
if (texOpcode == GPU7_TEX_INST_SAMPLE_C || texOpcode == GPU7_TEX_INST_SAMPLE_C_LZ)
|
||||
{
|
||||
src->add(".");
|
||||
|
||||
|
@ -2581,7 +2585,7 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
src->add(".");
|
||||
for (sint32 f = 0; f < 4; f++)
|
||||
{
|
||||
if( texInstruction->dstSel[f] < 4 )
|
||||
if (texInstruction->dstSel[f] < 4)
|
||||
{
|
||||
uint8 elemIndex = texInstruction->dstSel[f];
|
||||
if (isGather)
|
||||
|
@ -2601,9 +2605,8 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
elemIndex = fetchToGather[elemIndex];
|
||||
}
|
||||
src->add(resultElemTable[elemIndex]);
|
||||
numWrittenElements++;
|
||||
}
|
||||
else if( texInstruction->dstSel[f] == 7 )
|
||||
else if (texInstruction->dstSel[f] == 7)
|
||||
{
|
||||
// masked and not written
|
||||
}
|
||||
|
@ -2613,7 +2616,6 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
src->add(");");
|
||||
|
||||
// debug
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue