mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 14:31:17 +12:00
clean up accurate barriers
This commit is contained in:
parent
68d328b094
commit
27a31fedab
2 changed files with 16 additions and 10 deletions
|
@ -1031,7 +1031,11 @@ void MetalRenderer::draw_execute(uint32 baseVertex, uint32 baseInstance, uint32
|
|||
endRenderPass = CheckIfRenderPassNeedsFlush(geometryShader);
|
||||
|
||||
if (endRenderPass)
|
||||
{
|
||||
EndEncoding();
|
||||
// TODO: only log in debug?
|
||||
cemuLog_logOnce(LogType::Force, "Ending render pass due to render target self-dependency\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Primitive type
|
||||
|
@ -1871,6 +1875,11 @@ bool MetalRenderer::CheckIfRenderPassNeedsFlush(LatteDecompilerShader* shader)
|
|||
const auto relative_textureUnit = shader->resourceMapping.getTextureUnitFromBindingPoint(i);
|
||||
auto hostTextureUnit = relative_textureUnit;
|
||||
auto textureDim = shader->textureUnitDim[relative_textureUnit];
|
||||
|
||||
// Texture is accessed as a framebuffer fetch, therefore there is no need to flush it
|
||||
if (shader->textureRenderTargetIndex[relative_textureUnit] != 255)
|
||||
continue;
|
||||
|
||||
auto texUnitRegIndex = hostTextureUnit * 7;
|
||||
switch (shader->shaderType)
|
||||
{
|
||||
|
@ -1895,15 +1904,13 @@ bool MetalRenderer::CheckIfRenderPassNeedsFlush(LatteDecompilerShader* shader)
|
|||
continue;
|
||||
|
||||
LatteTexture* baseTexture = textureView->baseTexture;
|
||||
if (!m_state.m_isFirstDrawInRenderPass)
|
||||
|
||||
// If the texture is also used in the current render pass, we need to end the render pass to "flush" the texture
|
||||
for (uint8 i = 0; i < LATTE_NUM_COLOR_TARGET; i++)
|
||||
{
|
||||
// If the texture is also used in the current render pass, we need to end the render pass to "flush" the texture
|
||||
for (uint8 i = 0; i < LATTE_NUM_COLOR_TARGET; i++)
|
||||
{
|
||||
auto colorTarget = m_state.m_activeFBO.m_fbo->colorBuffer[i].texture;
|
||||
if (colorTarget && colorTarget->baseTexture == baseTexture)
|
||||
return true;
|
||||
}
|
||||
auto colorTarget = m_state.m_activeFBO.m_fbo->colorBuffer[i].texture;
|
||||
if (colorTarget && colorTarget->baseTexture == baseTexture)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,8 +125,7 @@ struct MetalState
|
|||
MetalActiveFBOState m_lastUsedFBO;
|
||||
|
||||
size_t m_vertexBufferOffsets[MAX_MTL_VERTEX_BUFFERS];
|
||||
// TODO: find out what is the max number of bound textures on the Wii U
|
||||
class LatteTextureViewMtl* m_textures[64] = {nullptr};
|
||||
class LatteTextureViewMtl* m_textures[LATTE_NUM_MAX_TEX_UNITS] = {nullptr};
|
||||
size_t m_uniformBufferOffsets[METAL_GENERAL_SHADER_TYPE_TOTAL][MAX_MTL_BUFFERS];
|
||||
|
||||
MTL::Viewport m_viewport;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue