fix: missing lod parameter

This commit is contained in:
Samuliak 2024-08-22 18:20:26 +02:00
parent b332d638c7
commit 8e87b9676a

View File

@ -2429,6 +2429,9 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
src->addFmt("+ float2(1.0)/float2(tex{}.get_width(), tex{}.get_height())/512.0", texInstruction->textureFetch.textureIndex, texInstruction->textureFetch.textureIndex); src->addFmt("+ float2(1.0)/float2(tex{}.get_width(), tex{}.get_height())/512.0", texInstruction->textureFetch.textureIndex, texInstruction->textureFetch.textureIndex);
} }
// lod or lod bias parameter // lod or lod bias parameter
// 1D textures don't support lod
if (texDim != Latte::E_DIM::DIM_1D && texDim != Latte::E_DIM::DIM_1D_ARRAY)
{
if( texOpcode == GPU7_TEX_INST_SAMPLE_L || texOpcode == GPU7_TEX_INST_SAMPLE_LB || texOpcode == GPU7_TEX_INST_SAMPLE_C_L) if( texOpcode == GPU7_TEX_INST_SAMPLE_L || texOpcode == GPU7_TEX_INST_SAMPLE_LB || texOpcode == GPU7_TEX_INST_SAMPLE_C_L)
{ {
src->add(", "); src->add(", ");
@ -2444,12 +2447,11 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
src->add(")"); src->add(")");
} }
} }
// TODO: uncomment? else if( texOpcode == GPU7_TEX_INST_SAMPLE_LZ || texOpcode == GPU7_TEX_INST_SAMPLE_C_LZ )
//else if( texOpcode == GPU7_TEX_INST_SAMPLE_LZ || texOpcode == GPU7_TEX_INST_SAMPLE_C_LZ ) {
//{ src->add(", level(0.0)");
// // TODO: correct? }
// src->add(", level(0.0)"); }
//}
} }
// gradient parameters // gradient parameters
if (texOpcode == GPU7_TEX_INST_SAMPLE_G) if (texOpcode == GPU7_TEX_INST_SAMPLE_G)