Skip to content

Commit

Permalink
Merge branch 'shadps4-emu:main' into PartBB
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolix29 authored Dec 27, 2024
2 parents eb9da41 + 1c5947d commit 3971645
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/core/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,17 @@ PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, size_t size,
auto dmem_area = FindDmemArea(search_start);

const auto is_suitable = [&] {
if (dmem_area == dmem_map.end()) {
return false;
}
const auto aligned_base = Common::AlignUp(dmem_area->second.base, alignment);
const auto alignment_size = aligned_base - dmem_area->second.base;
const auto remaining_size =
dmem_area->second.size >= alignment_size ? dmem_area->second.size - alignment_size : 0;
return dmem_area->second.is_free && remaining_size >= size;
};
while (!is_suitable() && dmem_area->second.GetEnd() <= search_end) {
while (dmem_area != dmem_map.end() && !is_suitable() &&
dmem_area->second.GetEnd() <= search_end) {
++dmem_area;
}
ASSERT_MSG(is_suitable(), "Unable to find free direct memory area: size = {:#x}", size);
Expand Down
5 changes: 3 additions & 2 deletions src/emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@ void Emulator::LoadSystemModules(const std::filesystem::path& file, std::string
found_modules, [&](const auto& path) { return path.filename() == module_name; });
if (it != found_modules.end()) {
LOG_INFO(Loader, "Loading {}", it->string());
linker->LoadModule(*it);
continue;
if (linker->LoadModule(*it) != -1) {
continue;
}
}
if (init_func) {
LOG_INFO(Loader, "Can't Load {} switching to HLE", module_name);
Expand Down
2 changes: 2 additions & 0 deletions src/video_core/texture_cache/tile_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ static vk::Format DemoteImageFormatForDetiling(vk::Format format) {
switch (format) {
case vk::Format::eR8Uint:
case vk::Format::eR8Unorm:
case vk::Format::eR8Snorm:
return vk::Format::eR8Uint;
case vk::Format::eR4G4B4A4UnormPack16:
case vk::Format::eB5G6R5UnormPack16:
Expand All @@ -41,6 +42,7 @@ static vk::Format DemoteImageFormatForDetiling(vk::Format format) {
case vk::Format::eR8G8B8A8Snorm:
case vk::Format::eR8G8B8A8Uint:
case vk::Format::eR32Sfloat:
case vk::Format::eD32Sfloat:
case vk::Format::eR32Uint:
case vk::Format::eR16G16Sfloat:
case vk::Format::eR16G16Unorm:
Expand Down

0 comments on commit 3971645

Please sign in to comment.