Fix dirtying caused by clip flag state. This could probably be a bit smarter.

This commit is contained in:
Henrik Rydgård
2026-05-30 21:47:21 +02:00
parent f8b153ba2b
commit bdd72c08f3
6 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -422,7 +422,7 @@ static u32 sceSasSetVolume(u32 core, int voiceNum, int leftVol, int rightVol, in
bool overVolume = abs(leftVol) > PSP_SAS_VOL_MAX || abs(rightVol) > PSP_SAS_VOL_MAX;
overVolume = overVolume || abs(effectLeftVol) > PSP_SAS_VOL_MAX || abs(effectRightVol) > PSP_SAS_VOL_MAX;
if (overVolume) {
return hleLogError(Log::sceSas, SCE_SAS_ERROR_INVALID_VOLUME);
return hleLogWarning(Log::sceSas, SCE_SAS_ERROR_INVALID_VOLUME, "invalid volume");
}
__SasDrain();
+2
View File
@@ -598,6 +598,8 @@ int DrawEngineCommon::ComputeNumVertsToDecode() const {
return sum;
}
// Takes a list of consecutive PRIM opcodes, and extends the current draw call to include them.
// This is just a performance optimization. NOTE: This isn't compatible with really accurate culling,
// unless we refactor things a bit.
+1
View File
@@ -370,6 +370,7 @@ protected:
// Depth tracking
ClipInfoFlags clipInfoFlags_{};
ClipInfoFlags lastClipInfoFlags_{}; // Flags at the last flush. For dirtying.
// Queue
int depthVertexCount_ = 0;
+7
View File
@@ -299,6 +299,13 @@ void DrawEngineD3D11::Flush() {
useHWTransform = false;
}
}
if (clipInfoFlags_ != lastClipInfoFlags_) {
ClipInfoFlags changed = (ClipInfoFlags)((u32)clipInfoFlags_ ^ (u32)lastClipInfoFlags_);
if (changed & (ClipInfoFlags::DepthClampFragment | ClipInfoFlags::MinMaxZDiscard)) {
gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_RASTER_STATE);
}
lastClipInfoFlags_ = clipInfoFlags_;
}
if (useHWTransform != lastUseHwTransform_) {
gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_RASTER_STATE);
+7
View File
@@ -259,6 +259,13 @@ void DrawEngineGLES::Flush() {
useHWTransform = false;
}
}
if (clipInfoFlags_ != lastClipInfoFlags_) {
ClipInfoFlags changed = (ClipInfoFlags)((u32)clipInfoFlags_ ^ (u32)lastClipInfoFlags_);
if (changed & (ClipInfoFlags::DepthClampFragment | ClipInfoFlags::MinMaxZDiscard)) {
gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_RASTER_STATE);
}
lastClipInfoFlags_ = clipInfoFlags_;
}
if (useHWTransform != lastUseHwTransform_) {
gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_RASTER_STATE);
+7
View File
@@ -246,6 +246,13 @@ void DrawEngineVulkan::Flush() {
useHWTransform = false;
}
}
if (clipInfoFlags_ != lastClipInfoFlags_) {
ClipInfoFlags changed = (ClipInfoFlags)((u32)clipInfoFlags_ ^ (u32)lastClipInfoFlags_);
if (changed & (ClipInfoFlags::DepthClampFragment | ClipInfoFlags::MinMaxZDiscard)) {
gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE | DIRTY_RASTER_STATE);
}
lastClipInfoFlags_ = clipInfoFlags_;
}
// Is this still needed?
if (useHWTransform != lastUseHwTransform_) {