mirror of https://github.com/PCSX2/pcsx2.git
GS: Replace ASSERT() with pxAssert()
This commit is contained in:
parent
a69977c62b
commit
20e75b4057
|
@ -131,8 +131,6 @@ static constexpr unsigned int __pagemask = __pagesize - 1;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#define ASSERT assert
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Safe deallocation macros -- checks pointer validity (non-null) when needed, and sets
|
||||
// pointer to null after deallocation.
|
||||
|
|
|
@ -892,7 +892,7 @@ static int s_shm_fd = -1;
|
|||
|
||||
void* GSAllocateWrappedMemory(size_t size, size_t repeat)
|
||||
{
|
||||
ASSERT(s_shm_fd == -1);
|
||||
pxAssert(s_shm_fd == -1);
|
||||
|
||||
const char* file_name = "/GS.mem";
|
||||
s_shm_fd = shm_open(file_name, O_RDWR | O_CREAT | O_EXCL, 0600);
|
||||
|
@ -924,7 +924,7 @@ void* GSAllocateWrappedMemory(size_t size, size_t repeat)
|
|||
|
||||
void GSFreeWrappedMemory(void* ptr, size_t size, size_t repeat)
|
||||
{
|
||||
ASSERT(s_shm_fd >= 0);
|
||||
pxAssert(s_shm_fd >= 0);
|
||||
|
||||
if (s_shm_fd < 0)
|
||||
return;
|
||||
|
|
|
@ -1281,7 +1281,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
}
|
||||
|
||||
v4 = v6.upl16(v7);
|
||||
|
@ -1338,7 +1338,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -374,7 +374,7 @@ bool GSCapture::BeginCapture(float fps, GSVector2i recommendedResolution, float
|
|||
|
||||
std::unique_lock<std::mutex> lock(s_lock);
|
||||
|
||||
ASSERT(fps != 0);
|
||||
pxAssert(fps != 0);
|
||||
|
||||
InternalEndCapture(lock);
|
||||
|
||||
|
|
|
@ -469,7 +469,7 @@ void GSClut::GetAlphaMinMax32(int& amin_out, int& amax_out)
|
|||
{
|
||||
// call only after Read32
|
||||
|
||||
ASSERT(!m_read.dirty);
|
||||
pxAssert(!m_read.dirty);
|
||||
|
||||
if (m_read.adirty)
|
||||
{
|
||||
|
@ -503,7 +503,7 @@ void GSClut::GetAlphaMinMax32(int& amin_out, int& amax_out)
|
|||
}
|
||||
else
|
||||
{
|
||||
ASSERT(GSLocalMemory::m_psm[m_read.TEX0.PSM].pal == 16);
|
||||
pxAssert(GSLocalMemory::m_psm[m_read.TEX0.PSM].pal == 16);
|
||||
|
||||
const GSVector4i v0 = (p[0] >> 24).ps32(p[1] >> 24);
|
||||
const GSVector4i v1 = (p[2] >> 24).ps32(p[3] >> 24);
|
||||
|
@ -829,7 +829,7 @@ constinit const GSVector4i GSClut::m_rm = GSVector4i::cxpr(0x0000001f);
|
|||
|
||||
void GSClut::Expand16(const u16* RESTRICT src, u32* RESTRICT dst, int w, const GIFRegTEXA& TEXA)
|
||||
{
|
||||
ASSERT((w & 7) == 0);
|
||||
pxAssert((w & 7) == 0);
|
||||
|
||||
const GSVector4i rm = m_rm;
|
||||
const GSVector4i gm = m_gm;
|
||||
|
|
|
@ -73,7 +73,7 @@ __forceinline bool BitEqual(const T& a, const T& b)
|
|||
}
|
||||
if (i != sizeof(T))
|
||||
{
|
||||
ASSERT(i + 1 == sizeof(T));
|
||||
pxAssert(i + 1 == sizeof(T));
|
||||
eqb = ac[i] == bc[i] && eqb;
|
||||
}
|
||||
return eqb;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
template <typename Fn>
|
||||
static void foreachBlock(const GSOffset& off, GSLocalMemory* mem, const GSVector4i& r, u8* dst, int dstpitch, int bpp, Fn&& fn)
|
||||
{
|
||||
ASSERT(off.isBlockAligned(r));
|
||||
pxAssert(off.isBlockAligned(r));
|
||||
GSOffset::BNHelper bn = off.bnMulti(r.left, r.top);
|
||||
int right = r.right >> off.blockShiftX();
|
||||
int bottom = r.bottom >> off.blockShiftY();
|
||||
|
@ -270,7 +270,7 @@ GSPixelOffset* GSLocalMemory::GetPixelOffset(const GIFRegFRAME& FRAME, const GIF
|
|||
u32 zpsm = ZBUF.PSM;
|
||||
u32 bw = FRAME.FBW;
|
||||
|
||||
ASSERT(m_psm[fpsm].trbpp > 8 || m_psm[zpsm].trbpp > 8);
|
||||
pxAssert(m_psm[fpsm].trbpp > 8 || m_psm[zpsm].trbpp > 8);
|
||||
|
||||
// "(psm & 0x0f) ^ ((psm & 0xf0) >> 2)" creates 4 bit unique identifiers for render target formats (only)
|
||||
|
||||
|
@ -323,7 +323,7 @@ GSPixelOffset4* GSLocalMemory::GetPixelOffset4(const GIFRegFRAME& FRAME, const G
|
|||
u32 zpsm = ZBUF.PSM;
|
||||
u32 bw = FRAME.FBW;
|
||||
|
||||
ASSERT(m_psm[fpsm].trbpp > 8 || m_psm[zpsm].trbpp > 8);
|
||||
pxAssert(m_psm[fpsm].trbpp > 8 || m_psm[zpsm].trbpp > 8);
|
||||
|
||||
// "(psm & 0x0f) ^ ((psm & 0xf0) >> 2)" creates 4 bit unique identifiers for render target formats (only)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* PCSX2 - PS2 Emulator for PCs
|
||||
* Copyright (C) 2002-2021 PCSX2 Dev Team
|
||||
* Copyright (C) 2002-2023 PCSX2 Dev Team
|
||||
*
|
||||
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU Lesser General Public License as published by the Free Software Found-
|
||||
|
@ -19,6 +19,9 @@
|
|||
#include "GSVector.h"
|
||||
#include "GSClut.h"
|
||||
#include "MultiISA.h"
|
||||
|
||||
#include "common/Assertions.h"
|
||||
|
||||
#include <array>
|
||||
#include <unordered_map>
|
||||
|
||||
|
@ -398,7 +401,7 @@ public:
|
|||
constexpr GSOffset assertSizesMatch(const GSSwizzleInfo& swz) const
|
||||
{
|
||||
GSOffset o = *this;
|
||||
#define MATCH(x) ASSERT(o.x == swz.x); o.x = swz.x;
|
||||
#define MATCH(x) pxAssert(o.x == swz.x); o.x = swz.x;
|
||||
MATCH(m_pageMask)
|
||||
MATCH(m_blockMask)
|
||||
MATCH(m_pixelRowMask)
|
||||
|
|
|
@ -193,7 +193,7 @@ void GSLocalMemoryFunctions::PopulateFunctions(GSLocalMemory& mem)
|
|||
template <typename Fn>
|
||||
static void foreachBlock(const GSOffset& off, GSLocalMemory& mem, const GSVector4i& r, u8* dst, int dstpitch, int bpp, Fn&& fn)
|
||||
{
|
||||
ASSERT(off.isBlockAligned(r));
|
||||
pxAssert(off.isBlockAligned(r));
|
||||
GSOffset::BNHelper bn = off.bnMulti(r.left, r.top);
|
||||
int right = r.right >> off.blockShiftX();
|
||||
int bottom = r.bottom >> off.blockShiftY();
|
||||
|
@ -791,7 +791,7 @@ static void readWriteHelper(int& tx, int& ty, int len, int xinc, int sx, int w,
|
|||
int ex = sx + w;
|
||||
int remX = ex - tx;
|
||||
|
||||
ASSERT(remX >= 0);
|
||||
pxAssert(remX >= 0);
|
||||
|
||||
GSOffset::PAHelper pa = off.paMulti(tx, y);
|
||||
|
||||
|
@ -969,7 +969,7 @@ void GSLocalMemoryFunctions::ReadImageX(const GSLocalMemory& mem, int& tx, int&
|
|||
GSVector4i::store<false>(&pd[4], GSVector4i::load(ps + 8, ps + 12));
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
ASSERT(pd[i] == vm[pa.value(x + i)]);
|
||||
pxAssert(pd[i] == vm[pa.value(x + i)]);
|
||||
}
|
||||
|
||||
for (; len > 0 && x < ex; len--, x++, pd++)
|
||||
|
@ -1095,7 +1095,7 @@ void GSLocalMemoryFunctions::ReadTextureGPU24(GSLocalMemory& mem, const GSOffset
|
|||
});
|
||||
|
||||
// Convert packed RGB scanline to 32 bits RGBA
|
||||
ASSERT(dstpitch >= r.width() * 4);
|
||||
pxAssert(dstpitch >= r.width() * 4);
|
||||
for (int y = r.top; y < r.bottom; y++)
|
||||
{
|
||||
u8* line = dst + y * dstpitch;
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace GSPng
|
|||
std::string root = file;
|
||||
root.replace(file.length() - 4, 4, "");
|
||||
|
||||
ASSERT(fmt >= Format::START && fmt < Format::COUNT);
|
||||
pxAssert(fmt >= Format::START && fmt < Format::COUNT);
|
||||
|
||||
if (compression < 0 || compression > Z_BEST_COMPRESSION)
|
||||
compression = Z_BEST_SPEED;
|
||||
|
|
|
@ -73,7 +73,7 @@ struct GSRingHeap::Buffer
|
|||
for (size_t j = 0; j < USAGE_ARR_ELEMS_PER_ENTRY; j++)
|
||||
{
|
||||
[[maybe_unused]] uint16_t section = prev >> (j * 16);
|
||||
assert(section != UINT16_MAX && "Usage count overflow");
|
||||
pxAssert(section != UINT16_MAX && "Usage count overflow");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ void* GSRingHeap::alloc_internal(size_t size, size_t align_mask, size_t prefix_s
|
|||
orphanBuffer();
|
||||
m_current_buffer = new_buffer;
|
||||
void* ptr = m_current_buffer->alloc(size, align_mask, prefix_size);
|
||||
assert(ptr && "Fresh buffer failed to allocate!");
|
||||
pxAssert(ptr && "Fresh buffer failed to allocate!");
|
||||
|
||||
Buffer** bptr = static_cast<Buffer**>(ptr);
|
||||
*bptr = m_current_buffer;
|
||||
|
|
|
@ -646,7 +646,7 @@ void GSState::GIFPackedRegHandlerNOP(const GIFPackedReg* RESTRICT r)
|
|||
template <u32 prim, bool auto_flush, bool index_swap>
|
||||
void GSState::GIFPackedRegHandlerSTQRGBAXYZF2(const GIFPackedReg* RESTRICT r, u32 size)
|
||||
{
|
||||
ASSERT(size > 0 && size % 3 == 0);
|
||||
pxAssert(size > 0 && size % 3 == 0);
|
||||
|
||||
CheckFlushes();
|
||||
|
||||
|
@ -680,7 +680,7 @@ void GSState::GIFPackedRegHandlerSTQRGBAXYZF2(const GIFPackedReg* RESTRICT r, u3
|
|||
template <u32 prim, bool auto_flush, bool index_swap>
|
||||
void GSState::GIFPackedRegHandlerSTQRGBAXYZ2(const GIFPackedReg* RESTRICT r, u32 size)
|
||||
{
|
||||
ASSERT(size > 0 && size % 3 == 0);
|
||||
pxAssert(size > 0 && size % 3 == 0);
|
||||
|
||||
CheckFlushes();
|
||||
|
||||
|
@ -736,7 +736,7 @@ __forceinline void GSState::ApplyPRIM(u32 prim)
|
|||
|
||||
UpdateVertexKick();
|
||||
|
||||
ASSERT(m_index.tail == 0 || !g_gs_device->Features().provoking_vertex_last || m_index.buff[m_index.tail - 1] + 1 == m_vertex.next);
|
||||
pxAssert(m_index.tail == 0 || !g_gs_device->Features().provoking_vertex_last || m_index.buff[m_index.tail - 1] + 1 == m_vertex.next);
|
||||
|
||||
if (m_index.tail == 0)
|
||||
m_vertex.next = 0;
|
||||
|
@ -1633,7 +1633,7 @@ void GSState::FlushPrim()
|
|||
switch (PRIM->PRIM)
|
||||
{
|
||||
case GS_POINTLIST:
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
break;
|
||||
case GS_LINELIST:
|
||||
case GS_LINESTRIP:
|
||||
|
@ -1661,7 +1661,7 @@ void GSState::FlushPrim()
|
|||
__assume(0);
|
||||
}
|
||||
|
||||
ASSERT((int)unused < GSUtil::GetVertexCount(PRIM->PRIM));
|
||||
pxAssert((int)unused < GSUtil::GetVertexCount(PRIM->PRIM));
|
||||
}
|
||||
|
||||
// If the PSM format of Z is invalid, but it is masked (no write) and ZTST is set to ALWAYS pass (no test, just allow)
|
||||
|
@ -2913,10 +2913,10 @@ GSState::PRIM_OVERLAP GSState::PrimitiveOverlap()
|
|||
|
||||
// Be sure to get vertex in good order, otherwise .r* function doesn't
|
||||
// work as expected.
|
||||
ASSERT(sprite.x <= sprite.z);
|
||||
ASSERT(sprite.y <= sprite.w);
|
||||
ASSERT(all.x <= all.z);
|
||||
ASSERT(all.y <= all.w);
|
||||
pxAssert(sprite.x <= sprite.z);
|
||||
pxAssert(sprite.y <= sprite.w);
|
||||
pxAssert(all.x <= all.z);
|
||||
pxAssert(all.y <= all.w);
|
||||
|
||||
if (all.rintersect(sprite).rempty())
|
||||
{
|
||||
|
@ -3346,7 +3346,7 @@ __forceinline void GSState::VertexKick(u32 skip)
|
|||
constexpr u32 n = NumIndicesForPrim(prim);
|
||||
static_assert(n > 0);
|
||||
|
||||
ASSERT(m_vertex.tail < m_vertex.maxcount + 3);
|
||||
pxAssert(m_vertex.tail < m_vertex.maxcount + 3);
|
||||
|
||||
if (auto_flush && skip == 0 && m_index.tail > 0 && ((m_vertex.tail + 1) - m_vertex.head) >= n)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* PCSX2 - PS2 Emulator for PCs
|
||||
* Copyright (C) 2002-2021 PCSX2 Dev Team
|
||||
* Copyright (C) 2002-2023 PCSX2 Dev Team
|
||||
*
|
||||
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU Lesser General Public License as published by the Free Software Found-
|
||||
|
@ -15,6 +15,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "common/Assertions.h"
|
||||
|
||||
/// Table for storing swizzling of blocks within a page
|
||||
struct alignas(64) GSBlockSwizzleTable
|
||||
{
|
||||
|
@ -54,7 +56,7 @@ struct alignas(128) GSPixelRowOffsetTable
|
|||
|
||||
int operator[](size_t x) const
|
||||
{
|
||||
ASSERT(x < 4096);
|
||||
pxAssert(x < 4096);
|
||||
return value[x];
|
||||
}
|
||||
};
|
||||
|
|
|
@ -501,7 +501,7 @@ public:
|
|||
{
|
||||
// TODO: use blendps when src == dst
|
||||
|
||||
ASSERT(src < 4 && dst < 4); // not cross lane like extract32()
|
||||
pxAssert(src < 4 && dst < 4); // not cross lane like extract32()
|
||||
|
||||
switch (dst)
|
||||
{
|
||||
|
@ -555,7 +555,7 @@ public:
|
|||
template <int i>
|
||||
__forceinline int extract32() const
|
||||
{
|
||||
ASSERT(i < 8);
|
||||
pxAssert(i < 8);
|
||||
|
||||
return extract<i / 4>().template extract32<i & 3>();
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ public:
|
|||
template <int i>
|
||||
__forceinline GSVector8 insert(__m128 m) const
|
||||
{
|
||||
ASSERT(i < 2);
|
||||
pxAssert(i < 2);
|
||||
|
||||
return GSVector8(_mm256_insertf128_ps(this->m, m, i));
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ public:
|
|||
template <int i>
|
||||
__forceinline GSVector4 extract() const
|
||||
{
|
||||
ASSERT(i < 2);
|
||||
pxAssert(i < 2);
|
||||
|
||||
if (i == 0)
|
||||
return GSVector4(_mm256_castps256_ps128(m));
|
||||
|
|
|
@ -986,7 +986,7 @@ public:
|
|||
template <int i>
|
||||
__forceinline int extract8() const
|
||||
{
|
||||
ASSERT(i < 32);
|
||||
pxAssert(i < 32);
|
||||
|
||||
GSVector4i v = extract<i / 16>();
|
||||
|
||||
|
@ -996,7 +996,7 @@ public:
|
|||
template <int i>
|
||||
__forceinline int extract16() const
|
||||
{
|
||||
ASSERT(i < 16);
|
||||
pxAssert(i < 16);
|
||||
|
||||
GSVector4i v = extract<i / 8>();
|
||||
|
||||
|
@ -1006,7 +1006,7 @@ public:
|
|||
template <int i>
|
||||
__forceinline int extract32() const
|
||||
{
|
||||
ASSERT(i < 8);
|
||||
pxAssert(i < 8);
|
||||
|
||||
GSVector4i v = extract<i / 4>();
|
||||
|
||||
|
@ -1019,7 +1019,7 @@ public:
|
|||
template <int i>
|
||||
__forceinline GSVector4i extract() const
|
||||
{
|
||||
ASSERT(i < 2);
|
||||
pxAssert(i < 2);
|
||||
|
||||
if (i == 0)
|
||||
return GSVector4i(_mm256_castsi256_si128(m));
|
||||
|
@ -1030,7 +1030,7 @@ public:
|
|||
template <int i>
|
||||
__forceinline GSVector8i insert(__m128i m) const
|
||||
{
|
||||
ASSERT(i < 2);
|
||||
pxAssert(i < 2);
|
||||
|
||||
return GSVector8i(_mm256_inserti128_si256(this->m, m, i));
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ const char* shaderName(ShaderConvert value)
|
|||
case ShaderConvert::YUV: return "ps_yuv";
|
||||
// clang-format on
|
||||
default:
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
return "ShaderConvertUnknownShader";
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ const char* shaderName(PresentShader value)
|
|||
case PresentShader::SUPERSAMPLE_AUTO: return "ps_automagical_supersampling";
|
||||
// clang-format on
|
||||
default:
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
return "DisplayShaderUnknownShader";
|
||||
}
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ GSTexture* GSDevice::FetchSurface(GSTexture::Type type, int width, int height, i
|
|||
{
|
||||
t = *i;
|
||||
|
||||
assert(t);
|
||||
pxAssert(t);
|
||||
|
||||
if (t->GetType() == type && t->GetFormat() == format && t->GetSize() == size && t->GetMipmapLevels() == levels)
|
||||
{
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
m_active->actual += actual;
|
||||
m_active->total += total;
|
||||
|
||||
ASSERT(m_active->total >= m_active->actual);
|
||||
pxAssert(m_active->total >= m_active->actual);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ public:
|
|||
{
|
||||
u8* code_ptr = GSCodeReserve::ReserveMemory(MAX_SIZE);
|
||||
CG cg(key, code_ptr, MAX_SIZE);
|
||||
ASSERT(cg.getSize() < MAX_SIZE);
|
||||
pxAssert(cg.getSize() < MAX_SIZE);
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "%s Location:%p Size:%zu Key:%llx\n", m_name.c_str(), code_ptr, cg.getSize(), (u64)key);
|
||||
|
|
|
@ -1073,7 +1073,7 @@ void GSDevice11::DrawIndexedPrimitive()
|
|||
|
||||
void GSDevice11::DrawIndexedPrimitive(int offset, int count)
|
||||
{
|
||||
ASSERT(offset + count <= (int)m_index.count);
|
||||
pxAssert(offset + count <= (int)m_index.count);
|
||||
g_perfmon.Put(GSPerfMon::DrawCalls, 1);
|
||||
PSUpdateShaderState();
|
||||
m_ctx->DrawIndexed(count, m_index.start + offset, m_vertex.start);
|
||||
|
@ -1719,7 +1719,7 @@ void GSDevice11::SetupPS(const PSSelector& sel, const GSHWDrawConfig::PSConstant
|
|||
{
|
||||
if (sel.pal_fmt || sel.wms >= 3 || sel.wmt >= 3)
|
||||
{
|
||||
ASSERT(ssel.biln == 0);
|
||||
pxAssert(ssel.biln == 0);
|
||||
}
|
||||
|
||||
auto i = std::as_const(m_ps_ss).find(ssel.key);
|
||||
|
@ -2460,12 +2460,12 @@ static GSDevice11::OMBlendSelector convertSel(GSHWDrawConfig::ColorMaskSelector
|
|||
/// Clears things we don't support that can be quietly disabled
|
||||
static void preprocessSel(GSDevice11::PSSelector& sel)
|
||||
{
|
||||
ASSERT(sel.write_rg == 0); // Not supported, shouldn't be sent
|
||||
pxAssert(sel.write_rg == 0); // Not supported, shouldn't be sent
|
||||
}
|
||||
|
||||
void GSDevice11::RenderHW(GSHWDrawConfig& config)
|
||||
{
|
||||
ASSERT(!config.require_full_barrier); // We always specify no support so it shouldn't request this
|
||||
pxAssert(!config.require_full_barrier); // We always specify no support so it shouldn't request this
|
||||
preprocessSel(config.ps);
|
||||
|
||||
GSVector2i rtsize = (config.rt ? config.rt : config.ds)->GetSize();
|
||||
|
|
|
@ -51,7 +51,7 @@ DXGI_FORMAT GSTexture11::GetDXGIFormat(Format format)
|
|||
case GSTexture::Format::BC7: return DXGI_FORMAT_BC7_UNORM;
|
||||
case GSTexture::Format::Invalid:
|
||||
default:
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
return DXGI_FORMAT_UNKNOWN;
|
||||
}
|
||||
// clang-format on
|
||||
|
|
|
@ -1240,7 +1240,7 @@ void GSDevice12::DrawIndexedPrimitive()
|
|||
|
||||
void GSDevice12::DrawIndexedPrimitive(int offset, int count)
|
||||
{
|
||||
ASSERT(offset + count <= (int)m_index.count);
|
||||
pxAssert(offset + count <= (int)m_index.count);
|
||||
g_perfmon.Put(GSPerfMon::DrawCalls, 1);
|
||||
GetCommandList()->DrawIndexedInstanced(count, 1, m_index.start + offset, m_vertex.start, 0);
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ GSTexture* GSRendererHW::GetFeedbackOutput(float& scale)
|
|||
|
||||
void GSRendererHW::Lines2Sprites()
|
||||
{
|
||||
ASSERT(m_vt.m_primclass == GS_SPRITE_CLASS);
|
||||
pxAssert(m_vt.m_primclass == GS_SPRITE_CLASS);
|
||||
|
||||
// each sprite converted to quad needs twice the space
|
||||
|
||||
|
@ -1340,27 +1340,27 @@ float GSRendererHW::alpha1(int L, int X0, int X1)
|
|||
void GSRendererHW::SwSpriteRender()
|
||||
{
|
||||
// Supported drawing attributes
|
||||
ASSERT(PRIM->PRIM == GS_TRIANGLESTRIP || PRIM->PRIM == GS_SPRITE);
|
||||
ASSERT(!PRIM->FGE); // No FOG
|
||||
ASSERT(!PRIM->AA1); // No antialiasing
|
||||
ASSERT(!PRIM->FIX); // Normal fragment value control
|
||||
pxAssert(PRIM->PRIM == GS_TRIANGLESTRIP || PRIM->PRIM == GS_SPRITE);
|
||||
pxAssert(!PRIM->FGE); // No FOG
|
||||
pxAssert(!PRIM->AA1); // No antialiasing
|
||||
pxAssert(!PRIM->FIX); // Normal fragment value control
|
||||
|
||||
ASSERT(!m_draw_env->DTHE.DTHE); // No dithering
|
||||
pxAssert(!m_draw_env->DTHE.DTHE); // No dithering
|
||||
|
||||
ASSERT(!m_cached_ctx.TEST.ATE); // No alpha test
|
||||
ASSERT(!m_cached_ctx.TEST.DATE); // No destination alpha test
|
||||
ASSERT(!m_cached_ctx.DepthRead() && !m_cached_ctx.DepthWrite()); // No depth handling
|
||||
pxAssert(!m_cached_ctx.TEST.ATE); // No alpha test
|
||||
pxAssert(!m_cached_ctx.TEST.DATE); // No destination alpha test
|
||||
pxAssert(!m_cached_ctx.DepthRead() && !m_cached_ctx.DepthWrite()); // No depth handling
|
||||
|
||||
ASSERT(!m_cached_ctx.TEX0.CSM); // No CLUT usage
|
||||
pxAssert(!m_cached_ctx.TEX0.CSM); // No CLUT usage
|
||||
|
||||
ASSERT(!m_draw_env->PABE.PABE); // No PABE
|
||||
pxAssert(!m_draw_env->PABE.PABE); // No PABE
|
||||
|
||||
// PSMCT32 pixel format
|
||||
ASSERT(!PRIM->TME || m_cached_ctx.TEX0.PSM == PSMCT32);
|
||||
ASSERT(m_cached_ctx.FRAME.PSM == PSMCT32);
|
||||
pxAssert(!PRIM->TME || m_cached_ctx.TEX0.PSM == PSMCT32);
|
||||
pxAssert(m_cached_ctx.FRAME.PSM == PSMCT32);
|
||||
|
||||
// No rasterization required
|
||||
ASSERT(PRIM->PRIM == GS_SPRITE
|
||||
pxAssert(PRIM->PRIM == GS_SPRITE
|
||||
|| ((PRIM->IIP || m_vt.m_eq.rgba == 0xffff)
|
||||
&& m_vt.m_eq.z == 0x1
|
||||
&& (!PRIM->TME || PRIM->FST || m_vt.m_eq.q == 0x1))); // Check Q equality only if texturing enabled and STQ coords used
|
||||
|
@ -1374,8 +1374,8 @@ void GSRendererHW::SwSpriteRender()
|
|||
const int th = 1 << m_cached_ctx.TEX0.TH;
|
||||
const float meas_tw = m_vt.m_max.t.x - m_vt.m_min.t.x;
|
||||
const float meas_th = m_vt.m_max.t.y - m_vt.m_min.t.y;
|
||||
ASSERT(!PRIM->TME || (abs(meas_tw - r.width()) <= SSR_UV_TOLERANCE && abs(meas_th - r.height()) <= SSR_UV_TOLERANCE)); // No input texture min/mag, if any.
|
||||
ASSERT(!PRIM->TME || (abs(m_vt.m_min.t.x) <= SSR_UV_TOLERANCE && abs(m_vt.m_min.t.y) <= SSR_UV_TOLERANCE && abs(meas_tw - tw) <= SSR_UV_TOLERANCE && abs(meas_th - th) <= SSR_UV_TOLERANCE)); // No texture UV wrap, if any.
|
||||
pxAssert(!PRIM->TME || (abs(meas_tw - r.width()) <= SSR_UV_TOLERANCE && abs(meas_th - r.height()) <= SSR_UV_TOLERANCE)); // No input texture min/mag, if any.
|
||||
pxAssert(!PRIM->TME || (abs(m_vt.m_min.t.x) <= SSR_UV_TOLERANCE && abs(m_vt.m_min.t.y) <= SSR_UV_TOLERANCE && abs(meas_tw - tw) <= SSR_UV_TOLERANCE && abs(meas_th - th) <= SSR_UV_TOLERANCE)); // No texture UV wrap, if any.
|
||||
#endif
|
||||
|
||||
GIFRegTRXPOS trxpos = {};
|
||||
|
@ -1385,14 +1385,14 @@ void GSRendererHW::SwSpriteRender()
|
|||
trxpos.SSAX = static_cast<int>(m_vt.m_min.t.x / 2) * 2; // Rounded down to closest even integer.
|
||||
trxpos.SSAY = static_cast<int>(m_vt.m_min.t.y / 2) * 2;
|
||||
|
||||
ASSERT(r.x % 2 == 0 && r.y % 2 == 0);
|
||||
pxAssert(r.x % 2 == 0 && r.y % 2 == 0);
|
||||
|
||||
GIFRegTRXREG trxreg = {};
|
||||
|
||||
trxreg.RRW = r.width();
|
||||
trxreg.RRH = r.height();
|
||||
|
||||
ASSERT(r.width() % 2 == 0 && r.height() % 2 == 0);
|
||||
pxAssert(r.width() % 2 == 0 && r.height() % 2 == 0);
|
||||
|
||||
// SW rendering code, mainly taken from GSState::Move(), TRXPOS.DIR{X,Y} management excluded
|
||||
|
||||
|
@ -1439,23 +1439,23 @@ void GSRendererHW::SwSpriteRender()
|
|||
const GSOffset::PAHelper spa = spo.paMulti(sx, sy);
|
||||
const GSOffset::PAHelper dpa = dpo.paMulti(dx, dy);
|
||||
|
||||
ASSERT(w % 2 == 0);
|
||||
pxAssert(w % 2 == 0);
|
||||
|
||||
for (int x = 0; x < w; x += 2)
|
||||
{
|
||||
u32* di = &vm[dpa.value(x)];
|
||||
ASSERT(di + 1 == &vm[dpa.value(x + 1)]); // Destination pixel pair is adjacent in memory
|
||||
pxAssert(di + 1 == &vm[dpa.value(x + 1)]); // Destination pixel pair is adjacent in memory
|
||||
|
||||
GSVector4i sc = {};
|
||||
if (texture_mapping_enabled)
|
||||
{
|
||||
const u32* si = &vm[spa.value(x)];
|
||||
// Read 2 source pixel colors
|
||||
ASSERT(si + 1 == &vm[spa.value(x + 1)]); // Source pixel pair is adjacent in memory
|
||||
pxAssert(si + 1 == &vm[spa.value(x + 1)]); // Source pixel pair is adjacent in memory
|
||||
sc = GSVector4i::loadl(si).u8to16(); // 0x00AA00BB00GG00RR00aa00bb00gg00rr
|
||||
|
||||
// Apply TFX
|
||||
ASSERT(tex0_tfx == 0 || tex0_tfx == 1);
|
||||
pxAssert(tex0_tfx == 0 || tex0_tfx == 1);
|
||||
if (tex0_tfx == 0)
|
||||
sc = sc.mul16l(vc).srl16(7).clamp8(); // clamp((sc * vc) >> 7, 0, 255), srl16 is ok because 16 bit values are unsigned
|
||||
|
||||
|
@ -1502,7 +1502,7 @@ void GSRendererHW::SwSpriteRender()
|
|||
dc = dc.sll16(8).srl16(8); // Mask, lower 8 bits enabled per channel
|
||||
|
||||
// No Alpha Correction
|
||||
ASSERT(m_context->FBA.FBA == 0);
|
||||
pxAssert(m_context->FBA.FBA == 0);
|
||||
dc = dc.blend(sc, a_mask);
|
||||
// dc alpha channels valid
|
||||
|
||||
|
@ -2116,8 +2116,8 @@ void GSRendererHW::Draw()
|
|||
|
||||
if (PRIM->FST)
|
||||
{
|
||||
ASSERT(lcm == 1);
|
||||
ASSERT(((m_vt.m_min.t.uph(m_vt.m_max.t) == GSVector4::zero()).mask() & 3) == 3); // ratchet and clank (menu)
|
||||
pxAssert(lcm == 1);
|
||||
pxAssert(((m_vt.m_min.t.uph(m_vt.m_max.t) == GSVector4::zero()).mask() & 3) == 3); // ratchet and clank (menu)
|
||||
|
||||
lcm = 1;
|
||||
}
|
||||
|
@ -3015,7 +3015,7 @@ void GSRendererHW::SetupIA(float target_scale, float sx, float sy)
|
|||
const bool unscale_pt_ln = !GSConfig.UserHacks_DisableSafeFeatures && (target_scale != 1.0f);
|
||||
const GSDevice::FeatureSupport features = g_gs_device->Features();
|
||||
|
||||
ASSERT(VerifyIndices());
|
||||
pxAssert(VerifyIndices());
|
||||
|
||||
switch (m_vt.m_primclass)
|
||||
{
|
||||
|
@ -3430,7 +3430,7 @@ __ri bool GSRendererHW::EmulateChannelShuffle(GSTextureCache::Target* src, bool
|
|||
// Note: potentially we could also check the value of the clut
|
||||
switch (blue_mask)
|
||||
{
|
||||
case 0xFF: ASSERT(0); break;
|
||||
case 0xFF: pxAssert(0); break;
|
||||
case 0xFE: blue_shift = 1; break;
|
||||
case 0xFC: blue_shift = 2; break;
|
||||
case 0xF8: blue_shift = 3; break;
|
||||
|
@ -4015,7 +4015,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, bool& DAT
|
|||
if (m_conf.ps.blend_a == 2)
|
||||
{
|
||||
// Accumulation blend is only available in (Cs - 0)*Something + Cd, or with alpha == 1
|
||||
ASSERT(m_conf.ps.blend_d == 2 || alpha_one);
|
||||
pxAssert(m_conf.ps.blend_d == 2 || alpha_one);
|
||||
// A bit of normalization
|
||||
m_conf.ps.blend_a = m_conf.ps.blend_d;
|
||||
m_conf.ps.blend_d = 2;
|
||||
|
@ -4023,7 +4023,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, bool& DAT
|
|||
|
||||
if (blend.op == GSDevice::OP_REV_SUBTRACT)
|
||||
{
|
||||
ASSERT(m_conf.ps.blend_a == 2);
|
||||
pxAssert(m_conf.ps.blend_a == 2);
|
||||
if (m_conf.ps.hdr)
|
||||
{
|
||||
// HDR uses unorm, which is always positive
|
||||
|
@ -5085,9 +5085,9 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
|
|||
}
|
||||
|
||||
// Will save my life !
|
||||
ASSERT(!(DATE_BARRIER && DATE_one));
|
||||
ASSERT(!(DATE_PRIMID && DATE_one));
|
||||
ASSERT(!(DATE_PRIMID && DATE_BARRIER));
|
||||
pxAssert(!(DATE_BARRIER && DATE_one));
|
||||
pxAssert(!(DATE_PRIMID && DATE_one));
|
||||
pxAssert(!(DATE_PRIMID && DATE_BARRIER));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5316,14 +5316,14 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
|
|||
// Intel GPUs on Metal lock up if you try to use DSB and framebuffer fetch at once
|
||||
// We should never need to do that (since using framebuffer fetch means you should be able to do all blending in shader), but sometimes it slips through
|
||||
if (m_conf.require_one_barrier || m_conf.require_full_barrier)
|
||||
ASSERT(!m_conf.blend.enable);
|
||||
pxAssert(!m_conf.blend.enable);
|
||||
|
||||
// Barriers aren't needed with fbfetch.
|
||||
m_conf.require_one_barrier = false;
|
||||
m_conf.require_full_barrier = false;
|
||||
}
|
||||
// Multi-pass algorithms shouldn't be needed with full barrier and backends may not handle this correctly
|
||||
ASSERT(!m_conf.require_full_barrier || !m_conf.ps.hdr);
|
||||
pxAssert(!m_conf.require_full_barrier || !m_conf.ps.hdr);
|
||||
|
||||
// Swap full barrier for one barrier when there's no overlap.
|
||||
if (m_conf.require_full_barrier && m_prim_overlap == PRIM_OVERLAP_NO)
|
||||
|
@ -5345,7 +5345,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
|
|||
|
||||
if (ate_second_pass)
|
||||
{
|
||||
ASSERT(!env.PABE.PABE);
|
||||
pxAssert(!env.PABE.PABE);
|
||||
memcpy(&m_conf.alpha_second_pass.ps, &m_conf.ps, sizeof(m_conf.ps));
|
||||
memcpy(&m_conf.alpha_second_pass.colormask, &m_conf.colormask, sizeof(m_conf.colormask));
|
||||
memcpy(&m_conf.alpha_second_pass.depth, &m_conf.depth, sizeof(m_conf.depth));
|
||||
|
@ -6186,7 +6186,7 @@ bool GSRendererHW::OI_BlitFMV(GSTextureCache::Target* _rt, GSTextureCache::Sourc
|
|||
const int th = static_cast<int>(1 << m_cached_ctx.TEX0.TH);
|
||||
|
||||
// Compute the Bottom of texture rectangle
|
||||
ASSERT(m_cached_ctx.TEX0.TBP0 > m_cached_ctx.FRAME.Block());
|
||||
pxAssert(m_cached_ctx.TEX0.TBP0 > m_cached_ctx.FRAME.Block());
|
||||
const int offset = (m_cached_ctx.TEX0.TBP0 - m_cached_ctx.FRAME.Block()) / m_cached_ctx.TEX0.TBW;
|
||||
GSVector4i r_texture(r_draw);
|
||||
r_texture.y -= offset;
|
||||
|
|
|
@ -823,7 +823,7 @@ GSTextureCache::Source* GSTextureCache::LookupDepthSource(const GIFRegTEX0& TEX0
|
|||
|
||||
if (GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0, t->m_TEX0.PSM))
|
||||
{
|
||||
ASSERT(GSLocalMemory::m_psm[t->m_TEX0.PSM].depth);
|
||||
pxAssert(GSLocalMemory::m_psm[t->m_TEX0.PSM].depth);
|
||||
if (t->m_age == 0)
|
||||
{
|
||||
// Perfect Match
|
||||
|
@ -922,7 +922,7 @@ GSTextureCache::Source* GSTextureCache::LookupDepthSource(const GIFRegTEX0& TEX0
|
|||
// FIXME: do I need to allow m_age == 1 as a potential match (as DepthStencil) ???
|
||||
if (t->m_age <= 1 && t->m_used && t->m_dirty.empty() && GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0, t->m_TEX0.PSM))
|
||||
{
|
||||
ASSERT(GSLocalMemory::m_psm[t->m_TEX0.PSM].depth);
|
||||
pxAssert(GSLocalMemory::m_psm[t->m_TEX0.PSM].depth);
|
||||
dst = t;
|
||||
inside_target = false;
|
||||
break;
|
||||
|
@ -976,8 +976,8 @@ GSTextureCache::Source* GSTextureCache::LookupDepthSource(const GIFRegTEX0& TEX0
|
|||
return LookupSource(TEX0, TEXA, CLAMP, r, nullptr, possible_shuffle, linear, frame_fbp, req_color, req_alpha);
|
||||
}
|
||||
|
||||
ASSERT(src->m_texture);
|
||||
ASSERT(src->m_scale == (dst ? dst->m_scale : 1.0f));
|
||||
pxAssert(src->m_texture);
|
||||
pxAssert(src->m_scale == (dst ? dst->m_scale : 1.0f));
|
||||
|
||||
return src;
|
||||
}
|
||||
|
@ -1682,7 +1682,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(GIFRegTEX0 TEX0, const GSVe
|
|||
}
|
||||
else
|
||||
{
|
||||
assert(type == RenderTarget);
|
||||
pxAssert(type == RenderTarget);
|
||||
// Let's try to find a perfect frame that contains valid data
|
||||
for (auto i = list.begin(); i != list.end(); ++i)
|
||||
{
|
||||
|
@ -2052,7 +2052,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(GIFRegTEX0 TEX0, const GSVe
|
|||
dst->m_used |= used;
|
||||
dst->readbacks_since_draw = 0;
|
||||
|
||||
assert(dst && dst->m_texture && dst->m_scale == scale);
|
||||
pxAssert(dst && dst->m_texture && dst->m_scale == scale);
|
||||
}
|
||||
|
||||
return dst;
|
||||
|
@ -2137,7 +2137,7 @@ GSTextureCache::Target* GSTextureCache::CreateTarget(GIFRegTEX0 TEX0, const GSVe
|
|||
|
||||
dst->readbacks_since_draw = 0;
|
||||
|
||||
assert(dst && dst->m_texture && dst->m_scale == scale);
|
||||
pxAssert(dst && dst->m_texture && dst->m_scale == scale);
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
@ -4315,10 +4315,10 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
}
|
||||
}
|
||||
|
||||
ASSERT(src->m_texture);
|
||||
ASSERT(src->m_target == (dst != nullptr));
|
||||
ASSERT(src->m_from_target == dst);
|
||||
ASSERT(src->m_scale == ((!dst || (TEX0.PSM == PSMT8 && !channel_shuffle)) ? 1.0f : dst->m_scale));
|
||||
pxAssert(src->m_texture);
|
||||
pxAssert(src->m_target == (dst != nullptr));
|
||||
pxAssert(src->m_from_target == dst);
|
||||
pxAssert(src->m_scale == ((!dst || (TEX0.PSM == PSMT8 && !channel_shuffle)) ? 1.0f : dst->m_scale));
|
||||
|
||||
if (src != m_temporary_source)
|
||||
{
|
||||
|
@ -4847,7 +4847,7 @@ void GSTextureCache::AgeHashCache()
|
|||
|
||||
GSTextureCache::Target* GSTextureCache::Target::Create(GIFRegTEX0 TEX0, int w, int h, float scale, int type, bool clear)
|
||||
{
|
||||
ASSERT(type == RenderTarget || type == DepthStencil);
|
||||
pxAssert(type == RenderTarget || type == DepthStencil);
|
||||
|
||||
const int scaled_w = static_cast<int>(std::ceil(static_cast<float>(w) * scale));
|
||||
const int scaled_h = static_cast<int>(std::ceil(static_cast<float>(h) * scale));
|
||||
|
@ -5975,10 +5975,10 @@ GSTextureCache::SurfaceOffset GSTextureCache::ComputeSurfaceOffset(const Surface
|
|||
b2a_offset.y = b_rect.y;
|
||||
}
|
||||
|
||||
assert(!so.is_valid || b2a_offset.x >= b_rect.x);
|
||||
assert(!so.is_valid || b2a_offset.x < b_rect.z);
|
||||
assert(!so.is_valid || b2a_offset.y >= b_rect.y);
|
||||
assert(!so.is_valid || b2a_offset.y < b_rect.w);
|
||||
pxAssert(!so.is_valid || b2a_offset.x >= b_rect.x);
|
||||
pxAssert(!so.is_valid || b2a_offset.x < b_rect.z);
|
||||
pxAssert(!so.is_valid || b2a_offset.y >= b_rect.y);
|
||||
pxAssert(!so.is_valid || b2a_offset.y < b_rect.w);
|
||||
|
||||
if (so.is_valid)
|
||||
{
|
||||
|
@ -6023,17 +6023,17 @@ GSTextureCache::SurfaceOffset GSTextureCache::ComputeSurfaceOffset(const Surface
|
|||
}
|
||||
}
|
||||
|
||||
assert(!so.is_valid || b2a_offset.z > b2a_offset.x);
|
||||
assert(!so.is_valid || b2a_offset.z <= b_rect.z);
|
||||
assert(!so.is_valid || b2a_offset.w > b_rect.y);
|
||||
assert(!so.is_valid || b2a_offset.w <= b_rect.w);
|
||||
pxAssert(!so.is_valid || b2a_offset.z > b2a_offset.x);
|
||||
pxAssert(!so.is_valid || b2a_offset.z <= b_rect.z);
|
||||
pxAssert(!so.is_valid || b2a_offset.w > b_rect.y);
|
||||
pxAssert(!so.is_valid || b2a_offset.w <= b_rect.w);
|
||||
|
||||
so.b2a_offset = b2a_offset;
|
||||
|
||||
const GSVector4i& r1 = so.b2a_offset;
|
||||
const GSVector4i& r2 = b_rect;
|
||||
[[maybe_unused]] const GSVector4i ri = r1.rintersect(r2);
|
||||
assert(!so.is_valid || (r1.eq(ri) && r1.x >= 0 && r1.y >= 0 && r1.z > 0 && r1.w > 0));
|
||||
pxAssert(!so.is_valid || (r1.eq(ri) && r1.x >= 0 && r1.y >= 0 && r1.z > 0 && r1.w > 0));
|
||||
|
||||
// Clear cache if size too big.
|
||||
if (m_surface_offset_cache.size() + 1 > S_SURFACE_OFFSET_CACHE_MAX_SIZE)
|
||||
|
@ -6160,7 +6160,7 @@ void GSTextureCache::Palette::InitializeTexture()
|
|||
|
||||
u64 GSTextureCache::PaletteKeyHash::operator()(const PaletteKey& key) const
|
||||
{
|
||||
ASSERT(key.pal == 16 || key.pal == 256);
|
||||
pxAssert(key.pal == 16 || key.pal == 256);
|
||||
return key.pal == 16 ?
|
||||
GSXXH3_64bits(key.clut, sizeof(key.clut[0]) * 16) :
|
||||
GSXXH3_64bits(key.clut, sizeof(key.clut[0]) * 256);
|
||||
|
@ -6195,7 +6195,7 @@ std::shared_ptr<GSTextureCache::Palette> GSTextureCache::PaletteMap::LookupPalet
|
|||
|
||||
std::shared_ptr<GSTextureCache::Palette> GSTextureCache::PaletteMap::LookupPalette(const u32* clut, u16 pal, bool need_gs_texture)
|
||||
{
|
||||
ASSERT(pal == 16 || pal == 256);
|
||||
pxAssert(pal == 16 || pal == 256);
|
||||
|
||||
// Choose which hash map search into:
|
||||
// pal == 16 : index 0
|
||||
|
|
|
@ -115,7 +115,7 @@ GSDeviceMTL::Map GSDeviceMTL::Allocate(UploadBuffer& buffer, size_t amt)
|
|||
size_t pos = buffer.usage.Allocate(m_current_draw, amt);
|
||||
|
||||
Map ret = {buffer.mtlbuffer, pos, reinterpret_cast<char*>(buffer.buffer) + pos};
|
||||
ASSERT(pos <= buffer.usage.Size() && "Previous code should have guaranteed there was enough space");
|
||||
pxAssertMsg(pos <= buffer.usage.Size(), "Previous code should have guaranteed there was enough space");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ GSDeviceMTL::Map GSDeviceMTL::Allocate(BufferPair& buffer, size_t amt)
|
|||
size_t pos = buffer.usage.Allocate(m_current_draw, amt);
|
||||
Map ret = {nil, pos, reinterpret_cast<char*>(buffer.buffer) + pos};
|
||||
ret.gpu_buffer = m_dev.features.unified_memory ? buffer.cpubuffer : buffer.gpubuffer;
|
||||
ASSERT(pos <= buffer.usage.Size() && "Previous code should have guaranteed there was enough space");
|
||||
pxAssertMsg(pos <= buffer.usage.Size(), "Previous code should have guaranteed there was enough space");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ void GSDeviceMTL::FlushEncoders()
|
|||
}
|
||||
if (m_dev.features.unified_memory)
|
||||
{
|
||||
ASSERT(!m_vertex_upload_cmdbuf && "Should never be used!");
|
||||
pxAssertMsg(!m_vertex_upload_cmdbuf, "Should never be used!");
|
||||
}
|
||||
else if (m_vertex_upload_cmdbuf)
|
||||
{
|
||||
|
@ -468,7 +468,7 @@ void GSDeviceMTL::BeginRenderPass(NSString* name, GSTexture* color, MTLLoadActio
|
|||
{
|
||||
ms->m_last_write = m_current_draw;
|
||||
desc.stencilAttachment.texture = ms->GetTexture();
|
||||
assert(stencil_load != MTLLoadActionClear);
|
||||
pxAssert(stencil_load != MTLLoadActionClear);
|
||||
desc.stencilAttachment.loadAction = stencil_load;
|
||||
}
|
||||
|
||||
|
@ -750,7 +750,7 @@ bool GSDeviceMTL::HasSurface() const { return static_cast<bool>(m_layer);}
|
|||
|
||||
void GSDeviceMTL::AttachSurfaceOnMainThread()
|
||||
{
|
||||
ASSERT([NSThread isMainThread]);
|
||||
pxAssert([NSThread isMainThread]);
|
||||
m_layer = MRCRetain([CAMetalLayer layer]);
|
||||
[m_layer setDrawableSize:CGSizeMake(m_window_info.surface_width, m_window_info.surface_height)];
|
||||
[m_layer setDevice:m_dev.dev];
|
||||
|
@ -761,7 +761,7 @@ void GSDeviceMTL::AttachSurfaceOnMainThread()
|
|||
|
||||
void GSDeviceMTL::DetachSurfaceOnMainThread()
|
||||
{
|
||||
ASSERT([NSThread isMainThread]);
|
||||
pxAssert([NSThread isMainThread]);
|
||||
[m_view setLayer:nullptr];
|
||||
[m_view setWantsLayer:NO];
|
||||
m_view = nullptr;
|
||||
|
@ -2122,11 +2122,11 @@ void GSDeviceMTL::RenderHW(GSHWDrawConfig& config)
|
|||
BeginRenderPass(@"PrimID Destination Alpha Init", primid_tex, MTLLoadActionDontCare, depth, MTLLoadActionLoad);
|
||||
RenderCopy(config.rt, m_primid_init_pipeline[static_cast<bool>(depth)][config.datm], config.drawarea);
|
||||
MRESetDSS(dsel);
|
||||
ASSERT(config.ps.date == 1 || config.ps.date == 2);
|
||||
pxAssert(config.ps.date == 1 || config.ps.date == 2);
|
||||
if (config.ps.tex_is_fb)
|
||||
MRESetTexture(config.rt, GSMTLTextureIndexRenderTarget);
|
||||
config.require_one_barrier = false; // Ending render pass is our barrier
|
||||
ASSERT(config.require_full_barrier == false && config.drawlist == nullptr);
|
||||
pxAssert(config.require_full_barrier == false && config.drawlist == nullptr);
|
||||
MRESetHWPipelineState(config.vs, config.ps, {}, {});
|
||||
MREInitHWDraw(config, allocation);
|
||||
SendHWDraw(config, m_current_render.encoder, index_buffer, index_buffer_offset);
|
||||
|
|
|
@ -1313,7 +1313,7 @@ std::string GSDeviceOGL::GenGlslHeader(const std::string_view& entry, GLenum typ
|
|||
header += "#define FRAGMENT_SHADER 1\n";
|
||||
break;
|
||||
default:
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
}
|
||||
|
||||
// Select the entry point ie the main function
|
||||
|
|
|
@ -143,7 +143,7 @@ GSTextureOGL::GSTextureOGL(Type type, int width, int height, int levels, Format
|
|||
m_int_format = 0;
|
||||
m_int_type = 0;
|
||||
m_int_shift = 0;
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
}
|
||||
|
||||
// Only 32 bits input texture will be supported for mipmap
|
||||
|
@ -184,7 +184,7 @@ void* GSTextureOGL::GetNativeHandle() const
|
|||
|
||||
bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch, int layer)
|
||||
{
|
||||
ASSERT(m_type != Type::DepthStencil);
|
||||
pxAssert(m_type != Type::DepthStencil);
|
||||
|
||||
if (layer >= m_mipmap_levels)
|
||||
return true;
|
||||
|
@ -260,8 +260,8 @@ bool GSTextureOGL::Map(GSMap& m, const GSVector4i* _r, int layer)
|
|||
|
||||
GSVector4i r = _r ? *_r : GSVector4i(0, 0, m_size.x, m_size.y);
|
||||
// Will need some investigation
|
||||
ASSERT(r.width() != 0);
|
||||
ASSERT(r.height() != 0);
|
||||
pxAssert(r.width() != 0);
|
||||
pxAssert(r.height() != 0);
|
||||
|
||||
const u32 pitch = Common::AlignUpPow2(r.width() << m_int_shift, TEXTURE_UPLOAD_PITCH_ALIGNMENT);
|
||||
m.pitch = pitch;
|
||||
|
@ -323,7 +323,7 @@ void GSTextureOGL::Unmap()
|
|||
|
||||
void GSTextureOGL::GenerateMipmap()
|
||||
{
|
||||
ASSERT(m_mipmap_levels > 1);
|
||||
pxAssert(m_mipmap_levels > 1);
|
||||
GSDeviceOGL::GetInstance()->CommitClear(this, true);
|
||||
glGenerateTextureMipmap(m_texture_id);
|
||||
}
|
||||
|
|
|
@ -490,7 +490,7 @@ __ri void GSDrawScanline::CDrawScanline(int pixels, int left, int top, const GSV
|
|||
steps = pixels - vlen;
|
||||
}
|
||||
|
||||
ASSERT((left & (vlen - 1)) == 0);
|
||||
pxAssert((left & (vlen - 1)) == 0);
|
||||
|
||||
const GSVector2i* fza_base = &global.fzbr[top];
|
||||
const GSVector2i* fza_offset = &global.fzbc[left >> 2];
|
||||
|
@ -1845,7 +1845,7 @@ __ri static void DrawRectT(const GSOffset& off, const GSVector4i& r, u32 c, u32
|
|||
c = c & (~m);
|
||||
|
||||
if (masked)
|
||||
ASSERT(mask.U32[0] != 0);
|
||||
pxAssert(mask.U32[0] != 0);
|
||||
|
||||
GSVector4i br = r.ralign<Align_Inside>(GSVector2i(8 * 4 / sizeof(T), 8));
|
||||
|
||||
|
@ -1871,8 +1871,8 @@ __ri static void DrawRectT(const GSOffset& off, const GSVector4i& r, u32 c, u32
|
|||
void GSDrawScanline::DrawRect(const GSVector4i& r, const GSVertexSW& v, GSScanlineLocalData& local)
|
||||
{
|
||||
const GSScanlineGlobalData& global = GlobalFromLocal(local);
|
||||
ASSERT(r.y >= 0);
|
||||
ASSERT(r.w >= 0);
|
||||
pxAssert(r.y >= 0);
|
||||
pxAssert(r.w >= 0);
|
||||
|
||||
// FIXME: sometimes the frame and z buffer may overlap, the outcome is undefined
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ GSDrawScanlineCodeGenerator2::GSDrawScanlineCodeGenerator2(Xbyak::CodeGenerator*
|
|||
m_sel.key = key;
|
||||
use_lod = m_sel.mmin;
|
||||
if (isYmm)
|
||||
ASSERT(hasAVX2);
|
||||
pxAssert(hasAVX2);
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
|
@ -3282,7 +3282,7 @@ void GSDrawScanlineCodeGenerator2::ReadTexelImplSSE4(
|
|||
|
||||
void GSDrawScanlineCodeGenerator2::ReadTexelImpl(const Xmm& dst, const Xmm& addr, u8 i, bool texInRBX, bool preserveDst)
|
||||
{
|
||||
ASSERT(i < 4);
|
||||
pxAssert(i < 4);
|
||||
|
||||
AddressReg clut = _m_local__gd__clut;
|
||||
AddressReg tex = texInRBX ? rbx : _m_local__gd__tex;
|
||||
|
|
|
@ -85,14 +85,14 @@ static void __fi AddScanlineInfo(GSVertexSW* e, int pixels, int left, int top)
|
|||
|
||||
bool GSRasterizer::IsOneOfMyScanlines(int top) const
|
||||
{
|
||||
ASSERT(top >= 0 && top < 2048);
|
||||
pxAssert(top >= 0 && top < 2048);
|
||||
|
||||
return m_scanline[top >> m_thread_height] != 0;
|
||||
}
|
||||
|
||||
bool GSRasterizer::IsOneOfMyScanlines(int top, int bottom) const
|
||||
{
|
||||
ASSERT(top >= 0 && top < 2048 && bottom >= 0 && bottom < 2048);
|
||||
pxAssert(top >= 0 && top < 2048 && bottom >= 0 && bottom < 2048);
|
||||
|
||||
top = top >> m_thread_height;
|
||||
bottom = (bottom + (1 << m_thread_height) - 1) >> m_thread_height;
|
||||
|
@ -557,8 +557,8 @@ void GSRasterizer::DrawTriangle(const GSVertexSW* vertex, const u16* index)
|
|||
|
||||
void GSRasterizer::DrawTriangleSection(int top, int bottom, GSVertexSW2& RESTRICT edge, const GSVertexSW2& RESTRICT dedge, const GSVertexSW2& RESTRICT dscan, const GSVector4& RESTRICT p0)
|
||||
{
|
||||
ASSERT(top < bottom);
|
||||
ASSERT(edge.p.x <= edge.p.y);
|
||||
pxAssert(top < bottom);
|
||||
pxAssert(edge.p.x <= edge.p.y);
|
||||
|
||||
GSVertexSW* RESTRICT e = &m_edge.buff[m_edge.count];
|
||||
|
||||
|
@ -736,8 +736,8 @@ void GSRasterizer::DrawTriangle(const GSVertexSW* vertex, const u16* index)
|
|||
|
||||
void GSRasterizer::DrawTriangleSection(int top, int bottom, GSVertexSW& RESTRICT edge, const GSVertexSW& RESTRICT dedge, const GSVertexSW& RESTRICT dscan, const GSVector4& RESTRICT p0)
|
||||
{
|
||||
ASSERT(top < bottom);
|
||||
ASSERT(edge.p.x <= edge.p.y);
|
||||
pxAssert(top < bottom);
|
||||
pxAssert(edge.p.x <= edge.p.y);
|
||||
|
||||
GSVertexSW* RESTRICT e = &m_edge.buff[m_edge.count];
|
||||
|
||||
|
@ -1136,7 +1136,7 @@ void GSRasterizer::DrawScanline(int pixels, int left, int top, const GSVertexSW&
|
|||
m_pixels.total += ((left + pixels + (PIXELS_PER_LOOP - 1)) & ~(PIXELS_PER_LOOP - 1)) - (left & ~(PIXELS_PER_LOOP - 1));
|
||||
//m_pixels.total += ((left + pixels + (PIXELS_PER_LOOP - 1)) & ~(PIXELS_PER_LOOP - 1)) - left;
|
||||
|
||||
ASSERT(m_pixels.actual <= m_pixels.total);
|
||||
pxAssert(m_pixels.actual <= m_pixels.total);
|
||||
|
||||
m_draw_scanline(pixels, left, top, scan, m_local);
|
||||
}
|
||||
|
@ -1147,7 +1147,7 @@ void GSRasterizer::DrawEdge(int pixels, int left, int top, const GSVertexSW& sca
|
|||
m_pixels.actual += 1;
|
||||
m_pixels.total += PIXELS_PER_LOOP - 1;
|
||||
|
||||
ASSERT(m_pixels.actual <= m_pixels.total);
|
||||
pxAssert(m_pixels.actual <= m_pixels.total);
|
||||
|
||||
m_draw_edge(pixels, left, top, scan, m_local);
|
||||
}
|
||||
|
@ -1258,7 +1258,7 @@ void GSRasterizerList::Queue(const GSRingHeap::SharedPtr<GSRasterizerData>& data
|
|||
m_ds.SetupDraw(*data.get());
|
||||
}
|
||||
|
||||
ASSERT(r.top >= 0 && r.top < 2048 && r.bottom >= 0 && r.bottom < 2048);
|
||||
pxAssert(r.top >= 0 && r.top < 2048 && r.bottom >= 0 && r.bottom < 2048);
|
||||
|
||||
int top = r.top >> m_thread_height;
|
||||
int bottom = std::min<int>((r.bottom + (1 << m_thread_height) - 1) >> m_thread_height, top + m_workers.size());
|
||||
|
|
|
@ -684,15 +684,15 @@ void GSRendererSW::UsePages(const GSOffset::PageLooper& pages, const int type)
|
|||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
ASSERT((m_fzb_pages[page] & 0xFFFF) < USHRT_MAX);
|
||||
pxAssert((m_fzb_pages[page] & 0xFFFF) < USHRT_MAX);
|
||||
m_fzb_pages[page] += 1;
|
||||
break;
|
||||
case 1:
|
||||
ASSERT((m_fzb_pages[page] >> 16) < USHRT_MAX);
|
||||
pxAssert((m_fzb_pages[page] >> 16) < USHRT_MAX);
|
||||
m_fzb_pages[page] += 0x10000;
|
||||
break;
|
||||
case 2:
|
||||
ASSERT(m_tex_pages[page] < USHRT_MAX);
|
||||
pxAssert(m_tex_pages[page] < USHRT_MAX);
|
||||
m_tex_pages[page] += 1;
|
||||
break;
|
||||
default:
|
||||
|
@ -708,15 +708,15 @@ void GSRendererSW::ReleasePages(const GSOffset::PageLooper& pages, const int typ
|
|||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
ASSERT((m_fzb_pages[page] & 0xFFFF) > 0);
|
||||
pxAssert((m_fzb_pages[page] & 0xFFFF) > 0);
|
||||
m_fzb_pages[page] -= 1;
|
||||
break;
|
||||
case 1:
|
||||
ASSERT((m_fzb_pages[page] >> 16) > 0);
|
||||
pxAssert((m_fzb_pages[page] >> 16) > 0);
|
||||
m_fzb_pages[page] -= 0x10000;
|
||||
break;
|
||||
case 2:
|
||||
ASSERT(m_tex_pages[page] > 0);
|
||||
pxAssert(m_tex_pages[page] > 0);
|
||||
m_tex_pages[page] -= 1;
|
||||
break;
|
||||
default:
|
||||
|
@ -1073,7 +1073,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
|
|||
|
||||
if (t == NULL)
|
||||
{
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1121,8 +1121,8 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
|
|||
|
||||
if (gd.sel.fst)
|
||||
{
|
||||
ASSERT(gd.sel.lcm == 1);
|
||||
ASSERT(((m_vt.m_min.t.uph(m_vt.m_max.t) == GSVector4::zero()).mask() & 3) == 3); // ratchet and clank (menu)
|
||||
pxAssert(gd.sel.lcm == 1);
|
||||
pxAssert(((m_vt.m_min.t.uph(m_vt.m_max.t) == GSVector4::zero()).mask() & 3) == 3); // ratchet and clank (menu)
|
||||
|
||||
gd.sel.lcm = 1;
|
||||
}
|
||||
|
@ -1169,7 +1169,7 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data)
|
|||
|
||||
if (t == NULL)
|
||||
{
|
||||
ASSERT(0);
|
||||
pxAssert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1532,7 +1532,7 @@ void GSRendererSW::SharedData::ReleasePages()
|
|||
|
||||
void GSRendererSW::SharedData::SetSource(GSTextureCacheSW::Texture* t, const GSVector4i& r, int level)
|
||||
{
|
||||
ASSERT(m_tex[level].t == NULL);
|
||||
pxAssert(m_tex[level].t == NULL);
|
||||
|
||||
m_tex[level].t = t;
|
||||
m_tex[level].r = r;
|
||||
|
|
|
@ -2715,7 +2715,7 @@ void GSDeviceVK::DrawIndexedPrimitive()
|
|||
|
||||
void GSDeviceVK::DrawIndexedPrimitive(int offset, int count)
|
||||
{
|
||||
ASSERT(offset + count <= (int)m_index.count);
|
||||
pxAssert(offset + count <= (int)m_index.count);
|
||||
g_perfmon.Put(GSPerfMon::DrawCalls, 1);
|
||||
vkCmdDrawIndexed(GetCurrentCommandBuffer(), count, 1, m_index.start + offset, m_vertex.start, 0);
|
||||
}
|
||||
|
|
|
@ -648,7 +648,7 @@ void MTGS::WaitGS(bool syncRegs, bool weakWait, bool isMTVU)
|
|||
pxFailRel("MTGS Thread Died");
|
||||
}
|
||||
|
||||
assert(!(weakWait && syncRegs) && "No synchronization for this!");
|
||||
pxAssert(!(weakWait && syncRegs) && "No synchronization for this!");
|
||||
|
||||
if (syncRegs)
|
||||
{
|
||||
|
|
|
@ -454,7 +454,7 @@ namespace usb_msd
|
|||
{
|
||||
size_t len;
|
||||
|
||||
assert(s->f.csw.sig == cpu_to_le32(0x53425355));
|
||||
pxAssert(s->f.csw.sig == cpu_to_le32(0x53425355));
|
||||
len = std::min<size_t>(sizeof(s->f.csw), p->buffer_size);
|
||||
usb_packet_copy(p, &s->f.csw, len);
|
||||
memset(&s->f.csw, 0, sizeof(s->f.csw));
|
||||
|
@ -756,7 +756,7 @@ namespace usb_msd
|
|||
{
|
||||
MSDState* s = USB_CONTAINER_OF(dev, MSDState, dev);
|
||||
|
||||
assert(s->packet == p);
|
||||
pxAssert(s->packet == p);
|
||||
s->packet = NULL;
|
||||
|
||||
if (s->f.req.valid)
|
||||
|
|
|
@ -249,7 +249,7 @@ static u8* m_IndirectDispatchers = nullptr;
|
|||
//
|
||||
static u8* GetIndirectDispatcherPtr(int mode, int operandsize, int sign = 0)
|
||||
{
|
||||
assert(mode || operandsize >= 3 ? !sign : true);
|
||||
pxAssert(mode || operandsize >= 3 ? !sign : true);
|
||||
|
||||
return &m_IndirectDispatchers[(mode * (8 * INDIRECT_DISPATCHER_SIZE)) + (sign * 5 * INDIRECT_DISPATCHER_SIZE) +
|
||||
(operandsize * INDIRECT_DISPATCHER_SIZE)];
|
||||
|
|
Loading…
Reference in New Issue