fix: incorrect texture read coord type

This commit is contained in:
Samuliak 2024-11-23 18:06:13 +01:00
parent 4c54f4b11d
commit 05b603d652
No known key found for this signature in database
2 changed files with 2 additions and 3 deletions

View file

@ -2316,7 +2316,7 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
// handle integer coordinates for texelFetch
if (texDim == Latte::E_DIM::DIM_2D || texDim == Latte::E_DIM::DIM_2D_MSAA)
{
src->add("int2(");
src->add("uint2(");
src->add("float2(");
_emitTEXSampleCoordInputComponent(shaderContext, texInstruction, 0, texCoordDataType);
src->addFmt(", ");
@ -2330,7 +2330,7 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
else if (texDim == Latte::E_DIM::DIM_1D)
{
// VC DS games forget to initialize textures and use texel fetch on an uninitialized texture (a dim of 0 maps to 1D)
src->add("int(");
src->add("uint(");
src->add("float(");
_emitTEXSampleCoordInputComponent(shaderContext, texInstruction, 0, (texOpcode == GPU7_TEX_INST_LD) ? LATTE_DECOMPILER_DTYPE_SIGNED_INT : LATTE_DECOMPILER_DTYPE_FLOAT);
src->addFmt(")*supportBuffer.tex{}Scale.x", texInstruction->textureFetch.textureIndex);

View file

@ -20,7 +20,6 @@
#include "Cemu/Logging/CemuLogging.h"
#include "Cafe/HW/Latte/Core/FetchShader.h"
#include "Cafe/HW/Latte/Core/LatteConst.h"
#include "HW/Latte/Renderer/Metal/MetalCommon.h"
#include "config/CemuConfig.h"
#include "gui/guiWrapper.h"