mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 05:51:19 +12:00
Replaced ASSUME(false) with UNREACHABLE.
This commit is contained in:
parent
f33540faa1
commit
73a8e6faac
8 changed files with 20 additions and 14 deletions
|
@ -518,7 +518,7 @@ void LatteOverlay_translateScreenPosition(ScreenPosition pos, const Vector2f& wi
|
|||
direction = -1;
|
||||
break;
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1463,7 +1463,7 @@ void OpenGLRenderer::shader_bind(RendererShader* shader)
|
|||
prevGeometryShaderProgram = program;
|
||||
break;
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
catchOpenGLError();
|
||||
|
@ -1494,7 +1494,7 @@ void OpenGLRenderer::shader_unbind(RendererShader::ShaderType shaderType)
|
|||
prevGeometryShaderProgram = -1;
|
||||
break;
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -270,7 +270,7 @@ void RendererShaderGL::ShaderCacheLoading_begin(uint64 cacheTitleId)
|
|||
usePrecompiled = false;
|
||||
break;
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
forceLog_printf("Using precompiled shaders: %s", usePrecompiled ? "true" : "false");
|
||||
|
|
|
@ -3412,7 +3412,7 @@ VkDescriptorSetInfo::~VkDescriptorSetInfo()
|
|||
break;
|
||||
}
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
// update global stats
|
||||
performanceMonitor.vk.numDescriptorSamplerTextures.decrement(statsNumSamplerTextures);
|
||||
|
|
|
@ -528,7 +528,7 @@ uint64 VulkanRenderer::GetDescriptorSetStateHash(LatteDecompilerShader* shader)
|
|||
texUnitRegIndex += Latte::REGADDR::SQ_TEX_RESOURCE_WORD0_N_GS;
|
||||
break;
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
auto texture = m_state.boundTexture[hostTextureUnit];
|
||||
|
@ -590,7 +590,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
|
|||
break;
|
||||
}
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
// create new descriptor set
|
||||
|
@ -646,7 +646,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
|
|||
texUnitRegIndex += Latte::REGADDR::SQ_TEX_RESOURCE_WORD0_N_GS;
|
||||
break;
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
auto textureView = m_state.boundTexture[hostTextureUnit];
|
||||
|
@ -996,7 +996,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
|
|||
break;
|
||||
}
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
return dsInfo;
|
||||
|
|
|
@ -174,7 +174,7 @@ std::unique_ptr<uint8[]> MetaInfo::GetIcon(uint32& size) const
|
|||
return nullptr;
|
||||
}
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -219,6 +219,15 @@ typedef union _LARGE_INTEGER {
|
|||
inline T& operator^= (T& a, T b) { return reinterpret_cast<T&>( reinterpret_cast<std::underlying_type<T>::type&>(a) ^= static_cast<std::underlying_type<T>::type>(b) ); }
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define UNREACHABLE __assume(false)
|
||||
#elif defined(__GNUC__)
|
||||
#define UNREACHABLE __builtin_unreachable();
|
||||
#else
|
||||
#warning "No implementation for UNREACHABLE"
|
||||
#define UNREACHABLE
|
||||
#endif
|
||||
|
||||
// MEMPTR
|
||||
#include "Common/MemPtr.h"
|
||||
|
||||
|
@ -230,7 +239,6 @@ typedef union _LARGE_INTEGER {
|
|||
#define DLLIMPORT __declspec(dllimport)
|
||||
#define DEBUG_BREAK __debugbreak()
|
||||
#define NOINLINE __declspec(noinline)
|
||||
#define ASSUME(X) __assume(X)
|
||||
#define THREAD_LOCAL __declspec(thread)
|
||||
#define POPCNT(X) __popcnt((X))
|
||||
#else
|
||||
|
@ -240,8 +248,6 @@ typedef union _LARGE_INTEGER {
|
|||
#include <csignal>
|
||||
#define DEBUG_BREAK raise(SIGTRAP)
|
||||
#define NOINLINE __attribute__((noinline))
|
||||
// fixme: random stack overflow solution. use it with caution
|
||||
#define ASSUME(X) do { if (!(X)) __builtin_unreachable(); } while (0)
|
||||
#define THREAD_LOCAL __thread
|
||||
#define POPCNT(X) __builtin_popcount((X))
|
||||
#endif
|
||||
|
|
|
@ -941,7 +941,7 @@ wxString wxTitleManagerList::GetTitleEntryText(const TitleEntry& entry, ItemColu
|
|||
//return wxStringFormat2("{}", entry.format);
|
||||
}
|
||||
default:
|
||||
ASSUME(false);
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
return wxEmptyString;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue