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,9 +2559,9 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
src->add(")");
|
||||
}
|
||||
|
||||
// sample_compare doesn't return a float
|
||||
if (!isCompare)
|
||||
{
|
||||
if (isCompare)
|
||||
src->add(")");
|
||||
|
||||
if (texOpcode == GPU7_TEX_INST_SAMPLE_C || texOpcode == GPU7_TEX_INST_SAMPLE_C_LZ)
|
||||
{
|
||||
src->add(".");
|
||||
|
@ -2601,7 +2605,6 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
elemIndex = fetchToGather[elemIndex];
|
||||
}
|
||||
src->add(resultElemTable[elemIndex]);
|
||||
numWrittenElements++;
|
||||
}
|
||||
else if (texInstruction->dstSel[f] == 7)
|
||||
{
|
||||
|
@ -2613,7 +2616,6 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
src->add(");");
|
||||
|
||||
// debug
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue