mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
Merge pull request #21920 from hrydgard/more-fixes
Fix glitches in Naruto Shippuden 3: UNH
This commit is contained in:
@@ -1532,7 +1532,7 @@ bool GetCurrentDrawAsDebugVertices(DrawEngineCommon *drawEngine, GECommand cmd,
|
||||
indexLowerBound = 0;
|
||||
}
|
||||
|
||||
int verticesToDecode = indexUpperBound + 1 - indexLowerBound;
|
||||
const int verticesToDecode = indexUpperBound + 1 - indexLowerBound;
|
||||
|
||||
const u8 *verts = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
|
||||
|
||||
@@ -815,6 +815,8 @@ bool GetPrimPreview(u32 op, GEPrimitiveType *prim, std::vector<GPUDebugVertex> *
|
||||
|
||||
int count = 0;
|
||||
|
||||
*lowerIndexBound = 0;
|
||||
|
||||
const GECommand cmd = static_cast<GECommand>(op >> 24);
|
||||
if (cmd == GE_CMD_PRIM) {
|
||||
*prim = static_cast<GEPrimitiveType>((op >> 16) & 0x7); // irrelevant for bbox
|
||||
|
||||
+1
-1
@@ -1243,7 +1243,7 @@ void GPUCommon::Execute_BoundingBox(u32 op, u32 diff) {
|
||||
// This is the normal case that pretty much always happens, the others are esoteric.
|
||||
currentList->bboxResult = drawEngineCommon_->TestBoundingBox(control_points, inds, count, dec, vertType);
|
||||
}
|
||||
AdvanceVerts(gstate.vertType, count, bytesRead);
|
||||
gstate_c.AdvanceVerts(vertType, count, bytesRead);
|
||||
}
|
||||
|
||||
void GPUCommon::Execute_MorphWeight(u32 op, u32 diff) {
|
||||
|
||||
@@ -320,15 +320,6 @@ protected:
|
||||
// TODO: Unify this. Vulkan and OpenGL are different due to how they buffer data.
|
||||
virtual void FinishDeferred() {}
|
||||
|
||||
void AdvanceVerts(u32 vertType, int count, int bytesRead) {
|
||||
if ((vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
const int indexShift = ((vertType & GE_VTYPE_IDX_MASK) >> GE_VTYPE_IDX_SHIFT) - 1;
|
||||
gstate_c.indexAddr += count << indexShift;
|
||||
} else {
|
||||
gstate_c.vertexAddr += bytesRead;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void BuildReportingInfo() = 0;
|
||||
|
||||
virtual void UpdateMSAALevel(Draw::DrawContext *draw) {}
|
||||
|
||||
+14
-12
@@ -1002,8 +1002,8 @@ void GPUCommonHW::Execute_Prim(u32 op, u32 diff) {
|
||||
int cycles = vertexCost_ * count;
|
||||
gpuStats.perFrame.vertexGPUCycles += cycles;
|
||||
cyclesExecuted += cycles;
|
||||
// NOTE! We still have to advance vertex pointers!
|
||||
gstate_c.vertexAddr += bytesRead; // We know from the above check that it's not an indexed draw.
|
||||
// We still have to advance vertex/index pointers!
|
||||
gstate_c.AdvanceVerts(vertexType, count, bytesRead);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ void GPUCommonHW::Execute_Prim(u32 op, u32 diff) {
|
||||
// After drawing, we advance the vertexAddr (when non indexed) or indexAddr (when indexed).
|
||||
// Some games rely on this, they don't bother reloading VADDR and IADDR.
|
||||
// The VADDR/IADDR registers are NOT updated.
|
||||
AdvanceVerts(vertexType, count, bytesRead);
|
||||
gstate_c.AdvanceVerts(vertexType, count, bytesRead);
|
||||
|
||||
int totalVertCount = count;
|
||||
|
||||
@@ -1132,7 +1132,7 @@ void GPUCommonHW::Execute_Prim(u32 op, u32 diff) {
|
||||
drawEngineCommon_->SkipPrim(newPrim, count, decoder, &bytesRead);
|
||||
canExtend = false;
|
||||
}
|
||||
AdvanceVerts(vertexType, count, bytesRead);
|
||||
gstate_c.AdvanceVerts(vertexType, count, bytesRead);
|
||||
totalVertCount += count;
|
||||
break;
|
||||
}
|
||||
@@ -1301,7 +1301,8 @@ void GPUCommonHW::Execute_Bezier(u32 op, u32 diff) {
|
||||
|
||||
const void *control_points = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
const void *indices = NULL;
|
||||
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
const u32 vertType = gstate.vertType;
|
||||
if ((vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
|
||||
ERROR_LOG(Log::G3D, "Bad index address %08x!", gstate_c.indexAddr);
|
||||
return;
|
||||
@@ -1309,8 +1310,8 @@ void GPUCommonHW::Execute_Bezier(u32 op, u32 diff) {
|
||||
indices = Memory::GetPointerUnchecked(gstate_c.indexAddr);
|
||||
}
|
||||
|
||||
if (vertTypeIsSkinningEnabled(gstate.vertType)) {
|
||||
DEBUG_LOG_REPORT(Log::G3D, "Unusual bezier/spline vtype: %08x, morph: %d, bones: %d", gstate.vertType, (gstate.vertType & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT, vertTypeGetNumBoneWeights(gstate.vertType));
|
||||
if (vertTypeIsSkinningEnabled(vertType)) {
|
||||
DEBUG_LOG_REPORT(Log::G3D, "Unusual bezier/spline vtype: %08x, morph: %d, bones: %d", vertType, (vertType & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT, vertTypeGetNumBoneWeights(vertType));
|
||||
}
|
||||
|
||||
// Can't flush after setting gstate_c.submitType below since it'll be a mess - it must be done already.
|
||||
@@ -1341,7 +1342,7 @@ void GPUCommonHW::Execute_Bezier(u32 op, u32 diff) {
|
||||
|
||||
// After drawing, we advance pointers - see SubmitPrim which does the same.
|
||||
const int count = surface.num_points_u * surface.num_points_v;
|
||||
AdvanceVerts(gstate.vertType, count, bytesRead);
|
||||
gstate_c.AdvanceVerts(vertType, count, bytesRead);
|
||||
}
|
||||
|
||||
void GPUCommonHW::Execute_Spline(u32 op, u32 diff) {
|
||||
@@ -1370,7 +1371,8 @@ void GPUCommonHW::Execute_Spline(u32 op, u32 diff) {
|
||||
|
||||
const void *control_points = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
const void *indices = NULL;
|
||||
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
const u32 vertType = gstate.vertType;
|
||||
if ((vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
|
||||
ERROR_LOG(Log::G3D, "Bad index address %08x!", gstate_c.indexAddr);
|
||||
return;
|
||||
@@ -1378,8 +1380,8 @@ void GPUCommonHW::Execute_Spline(u32 op, u32 diff) {
|
||||
indices = Memory::GetPointerUnchecked(gstate_c.indexAddr);
|
||||
}
|
||||
|
||||
if (vertTypeIsSkinningEnabled(gstate.vertType)) {
|
||||
WARN_LOG_ONCE(unusualcurve, Log::G3D, "Unusual bezier/spline vtype: %08x, morph: %d, bones: %d", gstate.vertType, (gstate.vertType & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT, vertTypeGetNumBoneWeights(gstate.vertType));
|
||||
if (vertTypeIsSkinningEnabled(vertType)) {
|
||||
WARN_LOG_ONCE(unusualcurve, Log::G3D, "Unusual bezier/spline vtype: %08x, morph: %d, bones: %d", vertType, (vertType & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT, vertTypeGetNumBoneWeights(vertType));
|
||||
}
|
||||
|
||||
// Can't flush after setting gstate_c.submitType below since it'll be a mess - it must be done already.
|
||||
@@ -1412,7 +1414,7 @@ void GPUCommonHW::Execute_Spline(u32 op, u32 diff) {
|
||||
|
||||
// After drawing, we advance pointers - see SubmitPrim which does the same.
|
||||
int count = surface.num_points_u * surface.num_points_v;
|
||||
AdvanceVerts(gstate.vertType, count, bytesRead);
|
||||
gstate_c.AdvanceVerts(vertType, count, bytesRead);
|
||||
}
|
||||
|
||||
void GPUCommonHW::Execute_BlockTransferStart(u32 op, u32 diff) {
|
||||
|
||||
@@ -534,6 +534,16 @@ struct GPUStateCache {
|
||||
bool IsDirty(u64 what) const {
|
||||
return (dirty & what) != 0ULL;
|
||||
}
|
||||
|
||||
void AdvanceVerts(u32 vertType, int count, int bytesRead) {
|
||||
if ((vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
const int indexShift = ((vertType & GE_VTYPE_IDX_MASK) >> GE_VTYPE_IDX_SHIFT) - 1;
|
||||
indexAddr += count << indexShift;
|
||||
} else {
|
||||
vertexAddr += bytesRead;
|
||||
}
|
||||
}
|
||||
|
||||
void SetTextureSolidAlpha(bool solidAlpha) {
|
||||
if (solidAlpha != textureSolidAlpha) {
|
||||
textureSolidAlpha = solidAlpha;
|
||||
|
||||
+16
-12
@@ -853,7 +853,9 @@ void SoftGPU::Execute_Prim(u32 op, u32 diff) {
|
||||
|
||||
const void *verts = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
const void *indices = NULL;
|
||||
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
|
||||
const u32 vertType = gstate.vertType;
|
||||
if ((vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
|
||||
ERROR_LOG_REPORT(Log::G3D, "Software: Bad index address %08x!", gstate_c.indexAddr);
|
||||
return;
|
||||
@@ -864,7 +866,7 @@ void SoftGPU::Execute_Prim(u32 op, u32 diff) {
|
||||
cyclesExecuted += EstimatePerVertexCost() * count;
|
||||
int bytesRead;
|
||||
drawEngine_->transformUnit.SetDirty(dirtyFlags_);
|
||||
drawEngine_->transformUnit.SubmitPrimitive(verts, indices, prim, count, gstate.vertType, &bytesRead, drawEngine_);
|
||||
drawEngine_->transformUnit.SubmitPrimitive(verts, indices, prim, count, vertType, &bytesRead, drawEngine_);
|
||||
dirtyFlags_ = drawEngine_->transformUnit.GetDirty();
|
||||
|
||||
SoftGPUVRAMDirty mark = (gstate_c.skipDrawReason & SKIPDRAW_SKIPFRAME) != 0 ? SoftGPUVRAMDirty::DIRTY : SoftGPUVRAMDirty::DIRTY | SoftGPUVRAMDirty::REALLY_DIRTY;
|
||||
@@ -873,7 +875,7 @@ void SoftGPU::Execute_Prim(u32 op, u32 diff) {
|
||||
// After drawing, we advance the vertexAddr (when non indexed) or indexAddr (when indexed).
|
||||
// Some games rely on this, they don't bother reloading VADDR and IADDR.
|
||||
// The VADDR/IADDR registers are NOT updated.
|
||||
AdvanceVerts(gstate.vertType, count, bytesRead);
|
||||
gstate_c.AdvanceVerts(vertType, count, bytesRead);
|
||||
}
|
||||
|
||||
void SoftGPU::Execute_Bezier(u32 op, u32 diff) {
|
||||
@@ -890,7 +892,8 @@ void SoftGPU::Execute_Bezier(u32 op, u32 diff) {
|
||||
|
||||
const void *control_points = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
const void *indices = NULL;
|
||||
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
const u32 vertType = gstate.vertType;
|
||||
if ((vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
|
||||
ERROR_LOG_REPORT(Log::G3D, "Bad index address %08x!", gstate_c.indexAddr);
|
||||
return;
|
||||
@@ -898,8 +901,8 @@ void SoftGPU::Execute_Bezier(u32 op, u32 diff) {
|
||||
indices = Memory::GetPointerUnchecked(gstate_c.indexAddr);
|
||||
}
|
||||
|
||||
if ((gstate.vertType & GE_VTYPE_MORPHCOUNT_MASK) || vertTypeIsSkinningEnabled(gstate.vertType)) {
|
||||
DEBUG_LOG_REPORT(Log::G3D, "Unusual bezier/spline vtype: %08x, morph: %d, bones: %d", gstate.vertType, (gstate.vertType & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT, vertTypeGetNumBoneWeights(gstate.vertType));
|
||||
if ((vertType & GE_VTYPE_MORPHCOUNT_MASK) || vertTypeIsSkinningEnabled(vertType)) {
|
||||
DEBUG_LOG_REPORT(Log::G3D, "Unusual bezier/spline vtype: %08x, morph: %d, bones: %d", vertType, (vertType & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT, vertTypeGetNumBoneWeights(vertType));
|
||||
}
|
||||
|
||||
Spline::BezierSurface surface;
|
||||
@@ -924,7 +927,7 @@ void SoftGPU::Execute_Bezier(u32 op, u32 diff) {
|
||||
|
||||
// After drawing, we advance pointers - see SubmitPrim which does the same.
|
||||
int count = surface.num_points_u * surface.num_points_v;
|
||||
AdvanceVerts(gstate.vertType, count, bytesRead);
|
||||
gstate_c.AdvanceVerts(vertType, count, bytesRead);
|
||||
}
|
||||
|
||||
void SoftGPU::Execute_Spline(u32 op, u32 diff) {
|
||||
@@ -941,7 +944,8 @@ void SoftGPU::Execute_Spline(u32 op, u32 diff) {
|
||||
|
||||
const void *control_points = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
const void *indices = NULL;
|
||||
if ((gstate.vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
const u32 vertType = gstate.vertType;
|
||||
if ((vertType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
if (!Memory::IsValidAddress(gstate_c.indexAddr)) {
|
||||
ERROR_LOG_REPORT(Log::G3D, "Bad index address %08x!", gstate_c.indexAddr);
|
||||
return;
|
||||
@@ -949,8 +953,8 @@ void SoftGPU::Execute_Spline(u32 op, u32 diff) {
|
||||
indices = Memory::GetPointerUnchecked(gstate_c.indexAddr);
|
||||
}
|
||||
|
||||
if ((gstate.vertType & GE_VTYPE_MORPHCOUNT_MASK) || vertTypeIsSkinningEnabled(gstate.vertType)) {
|
||||
DEBUG_LOG_REPORT(Log::G3D, "Unusual bezier/spline vtype: %08x, morph: %d, bones: %d", gstate.vertType, (gstate.vertType & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT, vertTypeGetNumBoneWeights(gstate.vertType));
|
||||
if ((vertType & GE_VTYPE_MORPHCOUNT_MASK) || vertTypeIsSkinningEnabled(vertType)) {
|
||||
DEBUG_LOG_REPORT(Log::G3D, "Unusual bezier/spline vtype: %08x, morph: %d, bones: %d", vertType, (vertType & GE_VTYPE_MORPHCOUNT_MASK) >> GE_VTYPE_MORPHCOUNT_SHIFT, vertTypeGetNumBoneWeights(vertType));
|
||||
}
|
||||
|
||||
Spline::SplineSurface surface;
|
||||
@@ -969,7 +973,7 @@ void SoftGPU::Execute_Spline(u32 op, u32 diff) {
|
||||
|
||||
int bytesRead = 0;
|
||||
drawEngine_->transformUnit.SetDirty(dirtyFlags_);
|
||||
drawEngineCommon_->SubmitCurve(control_points, indices, surface, gstate.vertType, &bytesRead, "spline");
|
||||
drawEngineCommon_->SubmitCurve(control_points, indices, surface, vertType, &bytesRead, "spline");
|
||||
dirtyFlags_ = drawEngine_->transformUnit.GetDirty();
|
||||
|
||||
SoftGPUVRAMDirty mark = (gstate_c.skipDrawReason & SKIPDRAW_SKIPFRAME) != 0 ? SoftGPUVRAMDirty::DIRTY : SoftGPUVRAMDirty::DIRTY | SoftGPUVRAMDirty::REALLY_DIRTY;
|
||||
@@ -977,7 +981,7 @@ void SoftGPU::Execute_Spline(u32 op, u32 diff) {
|
||||
|
||||
// After drawing, we advance pointers - see SubmitPrim which does the same.
|
||||
int count = surface.num_points_u * surface.num_points_v;
|
||||
AdvanceVerts(gstate.vertType, count, bytesRead);
|
||||
gstate_c.AdvanceVerts(vertType, count, bytesRead);
|
||||
}
|
||||
|
||||
void SoftGPU::Execute_LoadClut(u32 op, u32 diff) {
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ template <typename I> std::string int2hexstr(I w, size_t hex_len = sizeof(I) <<
|
||||
}
|
||||
|
||||
void GameScreen::update() {
|
||||
UIScreen::update();
|
||||
UITwoPaneBaseDialogScreen::update();
|
||||
|
||||
GameInfoFlags hasFlags;
|
||||
g_gameInfoCache->GetInfo(NULL, gamePath_, g_desiredFlags, &hasFlags);
|
||||
|
||||
+55
-16
@@ -959,9 +959,16 @@ static void DrawPreviewPrimitive(ImDrawList *drawList, ImVec2 p0, GECommand cmd,
|
||||
case GE_PRIM_TRIANGLES:
|
||||
{
|
||||
for (int i = 0; i < count - 2; i += 3) {
|
||||
const auto &v1 = indices.empty() ? verts[i + 0] : verts[indices[indexOffset + i + 0]];
|
||||
const auto &v2 = indices.empty() ? verts[i + 1] : verts[indices[indexOffset + i + 1]];
|
||||
const auto &v3 = indices.empty() ? verts[i + 2] : verts[indices[indexOffset + i + 2]];
|
||||
const int index0 = indices.empty() ? (i + 0) : indices[indexOffset + i + 0];
|
||||
const int index1 = indices.empty() ? (i + 1) : indices[indexOffset + i + 1];
|
||||
const int index2 = indices.empty() ? (i + 2) : indices[indexOffset + i + 2];
|
||||
|
||||
if (index0 >= (int)verts.size() || index1 >= (int)verts.size() || index2 >= (int)verts.size()) {
|
||||
continue;
|
||||
}
|
||||
const GPUDebugVertex &v1 = verts[index0];
|
||||
const GPUDebugVertex &v2 = verts[index1];
|
||||
const GPUDebugVertex &v3 = verts[index2];
|
||||
drawList->AddTriangleFilled(
|
||||
ImVec2(p0.x + x(v1), p0.y + y(v1)),
|
||||
ImVec2(p0.x + x(v2), p0.y + y(v2)),
|
||||
@@ -972,8 +979,14 @@ static void DrawPreviewPrimitive(ImDrawList *drawList, ImVec2 p0, GECommand cmd,
|
||||
case GE_PRIM_RECTANGLES:
|
||||
{
|
||||
for (int i = 0; i < count - 2; i += 3) {
|
||||
const auto &tl = indices.empty() ? verts[i] : verts[indices[indexOffset + i]];
|
||||
const auto &br = indices.empty() ? verts[i + 1] : verts[indices[indexOffset + i + 1]];
|
||||
const int indexTL = indices.empty() ? (i + 0) : indices[indexOffset + i + 0];
|
||||
const int indexBR = indices.empty() ? (i + 1) : indices[indexOffset + i + 1];
|
||||
if (indexTL >= (int)verts.size() || indexBR >= (int)verts.size()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const GPUDebugVertex &tl = verts[indexTL];
|
||||
const GPUDebugVertex & br = verts[indexBR];
|
||||
drawList->AddRectFilled(
|
||||
ImVec2(p0.x + x(tl), p0.y + y(tl)),
|
||||
ImVec2(p0.x + x(br), p0.y + y(br)), ImColor(defaultColor));
|
||||
@@ -983,9 +996,17 @@ static void DrawPreviewPrimitive(ImDrawList *drawList, ImVec2 p0, GECommand cmd,
|
||||
case GE_PRIM_TRIANGLE_FAN:
|
||||
{
|
||||
for (int i = 0; i < count - 2; i++) {
|
||||
const auto &v1 = indices.empty() ? verts[0] : verts[indices[indexOffset + 0]];
|
||||
const auto &v2 = indices.empty() ? verts[i + 1] : verts[indices[indexOffset + i + 1]];
|
||||
const auto &v3 = indices.empty() ? verts[i + 2] : verts[indices[indexOffset + i + 2]];
|
||||
const int index0 = indices.empty() ? 0 : indices[indexOffset + 0];
|
||||
const int index1 = indices.empty() ? (i + 1) : indices[indexOffset + i + 1];
|
||||
const int index2 = indices.empty() ? (i + 2) : indices[indexOffset + i + 2];
|
||||
|
||||
if (index0 >= (int)verts.size() || index1 >= (int)verts.size() || index2 >= (int)verts.size()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const GPUDebugVertex &v1 = verts[index0];
|
||||
const GPUDebugVertex &v2 = verts[index1];
|
||||
const GPUDebugVertex &v3 = verts[index2];
|
||||
drawList->AddTriangleFilled(
|
||||
ImVec2(p0.x + x(v1), p0.y + y(v1)),
|
||||
ImVec2(p0.x + x(v2), p0.y + y(v2)),
|
||||
@@ -1000,9 +1021,15 @@ static void DrawPreviewPrimitive(ImDrawList *drawList, ImVec2 p0, GECommand cmd,
|
||||
int i0 = i;
|
||||
int i1 = i + t;
|
||||
int i2 = i + (t ^ 3);
|
||||
const auto &v1 = indices.empty() ? verts[i0] : verts[indices[indexOffset + i0]];
|
||||
const auto &v2 = indices.empty() ? verts[i1] : verts[indices[indexOffset + i1]];
|
||||
const auto &v3 = indices.empty() ? verts[i2] : verts[indices[indexOffset + i2]];
|
||||
const int index0 = indices.empty() ? i0 : indices[indexOffset + i0];
|
||||
const int index1 = indices.empty() ? i1 : indices[indexOffset + i1];
|
||||
const int index2 = indices.empty() ? i2 : indices[indexOffset + i2];
|
||||
if (index0 >= (int)verts.size() || index1 >= (int)verts.size() || index2 >= (int)verts.size()) {
|
||||
continue;
|
||||
}
|
||||
const GPUDebugVertex &v1 = verts[index0];
|
||||
const GPUDebugVertex &v2 = verts[index1];
|
||||
const GPUDebugVertex &v3 = verts[index2];
|
||||
drawList->AddTriangleFilled(
|
||||
ImVec2(p0.x + x(v1), p0.y + y(v1)),
|
||||
ImVec2(p0.x + x(v2), p0.y + y(v2)),
|
||||
@@ -1014,8 +1041,13 @@ static void DrawPreviewPrimitive(ImDrawList *drawList, ImVec2 p0, GECommand cmd,
|
||||
case GE_PRIM_LINES:
|
||||
{
|
||||
for (int i = 0; i < count - 1; i += 2) {
|
||||
const auto &v1 = indices.empty() ? verts[i] : verts[indices[indexOffset + i]];
|
||||
const auto &v2 = indices.empty() ? verts[i + 1] : verts[indices[indexOffset + i + 1]];
|
||||
const int index0 = indices.empty() ? (i + 0) : indices[indexOffset + i + 0];
|
||||
const int index1 = indices.empty() ? (i + 1) : indices[indexOffset + i + 1];
|
||||
if (index0 >= (int)verts.size() || index1 >= (int)verts.size()) {
|
||||
continue;
|
||||
}
|
||||
const GPUDebugVertex &v1 = verts[index0];
|
||||
const GPUDebugVertex &v2 = verts[index1];
|
||||
drawList->AddLine(
|
||||
ImVec2(p0.x + x(v1), p0.y + y(v1)),
|
||||
ImVec2(p0.x + x(v2), p0.y + y(v2)), ImColor(defaultColor));
|
||||
@@ -1025,8 +1057,13 @@ static void DrawPreviewPrimitive(ImDrawList *drawList, ImVec2 p0, GECommand cmd,
|
||||
case GE_PRIM_LINE_STRIP:
|
||||
{
|
||||
for (int i = 0; i < count - 2; i++) {
|
||||
const auto &v1 = indices.empty() ? verts[i] : verts[indices[indexOffset + i]];
|
||||
const auto &v2 = indices.empty() ? verts[i + 1] : verts[indices[indexOffset + i + 1]];
|
||||
const int index0 = indices.empty() ? (i + 0) : indices[indexOffset + i + 0];
|
||||
const int index1 = indices.empty() ? (i + 1) : indices[indexOffset + i + 1];
|
||||
if (index0 >= (int)verts.size() || index1 >= (int)verts.size()) {
|
||||
continue;
|
||||
}
|
||||
const GPUDebugVertex &v1 = verts[index0];
|
||||
const GPUDebugVertex &v2 = verts[index1];
|
||||
drawList->AddLine(
|
||||
ImVec2(p0.x + x(v1), p0.y + y(v1)),
|
||||
ImVec2(p0.x + x(v2), p0.y + y(v2)), ImColor(defaultColor));
|
||||
@@ -1848,7 +1885,9 @@ void DrawImGeVertsWindow(ImConfig &cfg, ImControl &control, GPUCommon *gpu) {
|
||||
for (int column = 0; column < colCount; column++) {
|
||||
ImGui::TableNextColumn();
|
||||
char temp[36];
|
||||
if (transformed) {
|
||||
if ((size_t)index >= vertices.size()) {
|
||||
snprintf(temp, sizeof(temp), "(%d: idx out of range)", index);
|
||||
} else if (transformed) {
|
||||
FormatVertColTransformed(temp, sizeof(temp), vertices[index], (VertexListTransformedCol)column);
|
||||
} else {
|
||||
FormatVertColDecoded(temp, sizeof(temp), vertices[index], (VertexListDecodedCol)column);
|
||||
|
||||
@@ -2161,6 +2161,9 @@ ULUS10495 = -0.5
|
||||
# This works in the provided dump, but needs more testing.
|
||||
NPJH50878 = -0.4
|
||||
|
||||
# Naruto Shippuden: Ultimate Ninja Heroes 3
|
||||
ULES01407 = -0.5
|
||||
|
||||
[TextureCLUTInShader]
|
||||
# Fushigi no Dungeon 4. See #15251. This drastically reduces the amount of textures decoded by the game,
|
||||
# but due to lots of tile modifications the number is still pretty high.
|
||||
|
||||
Reference in New Issue
Block a user