Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Enable renderpass merging for all games #12462

Merged
merged 3 commits into from
Dec 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "DisableAccurateDepth", &flags_.DisableAccurateDepth);
CheckSetting(iniFile, gameID, "MGS2AcidHack", &flags_.MGS2AcidHack);
CheckSetting(iniFile, gameID, "SonicRivalsHack", &flags_.SonicRivalsHack);
CheckSetting(iniFile, gameID, "RenderPassMerge", &flags_.RenderPassMerge);
CheckSetting(iniFile, gameID, "BlockTransferAllowCreateFB", &flags_.BlockTransferAllowCreateFB);
CheckSetting(iniFile, gameID, "YugiohSaveFix", &flags_.YugiohSaveFix);
CheckSetting(iniFile, gameID, "ForceUMDDelay", &flags_.ForceUMDDelay);
Expand Down
1 change: 0 additions & 1 deletion Core/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ struct CompatFlags {
bool DisableAccurateDepth;
bool MGS2AcidHack;
bool SonicRivalsHack;
bool RenderPassMerge;
bool BlockTransferAllowCreateFB;
bool YugiohSaveFix;
bool ForceUMDDelay;
Expand Down
5 changes: 3 additions & 2 deletions GPU/Vulkan/GPU_Vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ void GPU_Vulkan::InitDeviceObjects() {
hacks |= QUEUE_HACK_MGS2_ACID;
if (PSP_CoreParameter().compat.flags().SonicRivalsHack)
hacks |= QUEUE_HACK_SONIC;
if (PSP_CoreParameter().compat.flags().RenderPassMerge)
hacks |= QUEUE_HACK_RENDERPASS_MERGE;

// Always on.
hacks |= QUEUE_HACK_RENDERPASS_MERGE;

if (hacks) {
rm->GetQueueRunner()->EnableHacks(hacks);
Expand Down
36 changes: 0 additions & 36 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -648,42 +648,6 @@ ULAS42214 = true
ULJS19054 = true
NPJH50184 = true

[RenderPassMerge]
UCJS10114 = true
UCKS45084 = true
# GOW : Ghost of Sparta
UCUS98737 = true
UCAS40323 = true
NPHG00092 = true
NPEG00044 = true
NPEG00045 = true
NPJG00120 = true
NPUG80508 = true
UCJS10114 = true
UCES01401 = true
UCES01473 = true
# GOW : Ghost of Sparta Demo
NPEG90035 = true
NPUG70125 = true
NPJG90095 = true
# GOW : Chains Of Olympus
UCAS40198 = true
UCUS98653 = true
UCES00842 = true
ULJM05438 = true
ULJM05348 = true
UCKS45084 = true
NPUG80325 = true
NPEG00023 = true
NPHG00027 = true
NPHG00028 = true
NPJH50170 = true
UCET00844 = true
# GOW: Chains of Olympus Demo
UCUS98705 = true
UCED00971 = true
UCUS98713 = true

[ForceSoftwareRenderer]
# Darkstalkers
ULES00016 = true
Expand Down
14 changes: 9 additions & 5 deletions ext/native/gfx_es2/draw_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,12 @@ void DrawBuffer::DrawTextRect(int font, const char *text, float x, float y, floa
// ROTATE_* doesn't yet work right.
void DrawBuffer::DrawText(int font, const char *text, float x, float y, Color color, int align) {
// rough estimate
if (count_ + strlen(text) * 6 > MAX_VERTS) {
size_t textLen = strlen(text);
if (count_ + textLen * 6 > MAX_VERTS) {
Flush(true);
if (textLen * 6 >= MAX_VERTS) {
textLen = std::min(MAX_VERTS / 6 - 10, (int)textLen);
}
}

const AtlasFont &atlasfont = *atlas->fonts[font];
Expand All @@ -508,14 +512,14 @@ void DrawBuffer::DrawText(int font, const char *text, float x, float y, Color co
}

if (align & ROTATE_90DEG_LEFT) {
x -= atlasfont.ascend*fontscaley;
x -= atlasfont.ascend * fontscaley;
// y += h;
} else {
y += atlasfont.ascend * fontscaley;
}
else
y += atlasfont.ascend*fontscaley;
float sx = x;
UTF8 utf(text);
while (true) {
for (size_t i = 0; i < textLen; i++) {
if (utf.end())
break;
cval = utf.next();
Expand Down
4 changes: 3 additions & 1 deletion ext/native/thin3d/VulkanQueueRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ void VulkanQueueRunner::RunSteps(VkCommandBuffer cmd, std::vector<VKRStep *> &st
break;
}

if (profile) {
if (profile && profile->timestampDescriptions.size() + 1 < MAX_TIMESTAMP_QUERIES) {
vkCmdWriteTimestamp(cmd, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, profile->queryPool, (uint32_t)profile->timestampDescriptions.size());
profile->timestampDescriptions.push_back(StepToString(step));
}
Expand Down Expand Up @@ -789,11 +789,13 @@ void VulkanQueueRunner::ApplyRenderPassMerge(std::vector<VKRStep *> &steps) {
if (steps[j]->copy.src == fb || steps[j]->copy.dst == fb) {
goto done_fb;
}
touchedFramebuffers.insert(steps[j]->copy.dst);
break;
case VKRStepType::BLIT:
if (steps[j]->blit.src == fb || steps[j]->blit.dst == fb) {
goto done_fb;
}
touchedFramebuffers.insert(steps[j]->blit.dst);
break;
case VKRStepType::READBACK:
// Not sure this has much effect, when executed READBACK is always the last step
Expand Down
8 changes: 4 additions & 4 deletions ext/native/thin3d/VulkanRenderManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ enum class VKRRunType {
SYNC,
};

enum {
MAX_TIMESTAMP_QUERIES = 128,
};

class VulkanRenderManager {
public:
VulkanRenderManager(VulkanContext *vulkan);
Expand Down Expand Up @@ -299,10 +303,6 @@ class VulkanRenderManager {

FrameData frameData_[VulkanContext::MAX_INFLIGHT_FRAMES];

enum {
MAX_TIMESTAMP_QUERIES = 256,
};

// Submission time state
int curWidth_ = -1;
int curHeight_ = -1;
Expand Down