mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-16 22:37:01 +00:00
refactor: use concepts instead of SFINAE (#1652)
This commit is contained in:
parent
aeb3154257
commit
de4bf7c2c1
13 changed files with 71 additions and 70 deletions
|
|
@ -39,9 +39,9 @@ inline void gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const b
|
|||
}
|
||||
|
||||
template <typename T, typename ...Targs>
|
||||
requires std::is_floating_point_v<T>
|
||||
inline
|
||||
typename std::enable_if< std::is_floating_point<T>::value, void>::type
|
||||
gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const T& arg, Targs... args)
|
||||
void gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const T& arg, Targs... args)
|
||||
{
|
||||
static_assert(sizeof(T) == sizeof(uint32));
|
||||
*writePtr = *(uint32*)&arg;
|
||||
|
|
@ -50,9 +50,9 @@ gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const T& arg, Targs
|
|||
}
|
||||
|
||||
template <typename T, typename ...Targs>
|
||||
requires std::is_base_of_v<Latte::LATTEREG, T>
|
||||
inline
|
||||
typename std::enable_if< std::is_base_of<Latte::LATTEREG, T>::value, void>::type
|
||||
gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const T& arg, Targs... args)
|
||||
void gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const T& arg, Targs... args)
|
||||
{
|
||||
static_assert(sizeof(Latte::LATTEREG) == sizeof(uint32be));
|
||||
*writePtr = arg.getRawValue();
|
||||
|
|
@ -61,9 +61,9 @@ gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const T& arg, Targs
|
|||
}
|
||||
|
||||
template <typename T, typename ...Targs>
|
||||
requires (!std::is_base_of_v<Latte::LATTEREG, T>) && (!std::is_floating_point_v<T>)
|
||||
inline
|
||||
typename std::enable_if< !std::is_base_of<Latte::LATTEREG, T>::value && !std::is_floating_point<T>::value, void>::type
|
||||
gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const T& arg, Targs... args)
|
||||
void gx2WriteGather_submit_(uint32 coreIndex, uint32be* writePtr, const T& arg, Targs... args)
|
||||
{
|
||||
*writePtr = arg;
|
||||
writePtr++;
|
||||
|
|
@ -105,4 +105,4 @@ namespace GX2
|
|||
void GX2Init_commandBufferPool(void* bufferBase, uint32 bufferSize);
|
||||
void GX2Shutdown_commandBufferPool();
|
||||
void GX2CommandResetToDefaultState();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue