mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-07 23:41: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
|
// 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];
|
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: support comparison samplers
|
||||||
// TODO: clean up
|
src->addFmt("col{}", renderTargetIndex);
|
||||||
std::string components[] = {"x", "y", "z", "w"};
|
}
|
||||||
for (sint32 i = 0; i < numWrittenElements; i++)
|
else
|
||||||
{
|
{
|
||||||
src->addFmt("{}", components[i]);
|
|
||||||
}
|
|
||||||
src->add(");" _CRLF);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (emulateCompare)
|
if (emulateCompare)
|
||||||
{
|
{
|
||||||
cemu_assert_debug(!isGather);
|
cemu_assert_debug(!isGather);
|
||||||
|
@ -2537,6 +2527,8 @@ static void _emitTEXSampleTextureCode(LatteDecompilerShaderContext* shaderContex
|
||||||
// lod bias (TODO: wht?)
|
// lod bias (TODO: wht?)
|
||||||
|
|
||||||
src->add(")");
|
src->add(")");
|
||||||
|
}
|
||||||
|
|
||||||
// sample_compare doesn't return a float
|
// sample_compare doesn't return a float
|
||||||
if (!isCompare)
|
if (!isCompare)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue