mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-07 15:31:18 +12:00
fix: component indexing for framebuffer fetch
This commit is contained in:
parent
4479584eb6
commit
ca3fe96104
1 changed files with 247 additions and 255 deletions
|
@ -2261,24 +2261,14 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
}
|
||||
|
||||
// Do a framebuffer fetch if possible
|
||||
// TODO: support comparison samplers
|
||||
if (static_cast<MetalRenderer*>(g_renderer.get())->SupportsFramebufferFetch())
|
||||
{
|
||||
uint8 renderTargetIndex = shaderContext->shader->textureRenderTargetIndex[texInstruction->textureFetch.textureIndex];
|
||||
if (renderTargetIndex != 255)
|
||||
if (static_cast<MetalRenderer*>(g_renderer.get())->SupportsFramebufferFetch() && renderTargetIndex != 255)
|
||||
{
|
||||
src->addFmt("col{}.", renderTargetIndex);
|
||||
// TODO: clean up
|
||||
std::string components[] = {"x", "y", "z", "w"};
|
||||
for (sint32 i = 0; i < numWrittenElements; i++)
|
||||
// TODO: support comparison samplers
|
||||
src->addFmt("col{}", renderTargetIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
src->addFmt("{}", components[i]);
|
||||
}
|
||||
src->add(");" _CRLF);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (emulateCompare)
|
||||
{
|
||||
cemu_assert_debug(!isGather);
|
||||
|
@ -2537,6 +2527,8 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
|||
// lod bias (TODO: wht?)
|
||||
|
||||
src->add(")");
|
||||
}
|
||||
|
||||
// sample_compare doesn't return a float
|
||||
if (!isCompare)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue