mirror of
https://github.com/Liondarkz/issn_pc.git
synced 2026-11-07 04:36:01 -10:00
- Caminhos e conteúdo: GOW3_ -> ISSN_, Gow3 -> Issn, gow3 -> issn, tags "gow3:" -> "port:". Créditos e links ao gow3_pc (Felipe Prado) mantidos; a documentação herdada do port do God of War III foi para docs/base/. - run.py aceita as variáveis GOW3_ antigas (viram ISSN_ quando a nova não está definida). - build.sh: se o patch antigo do fsr-vulkan já estiver aplicado no submódulo, volta ao commit fixado e aplica o novo. - Menu do jogo: os cheats do God of War III só aparecem quando algum é suportado. - Launcher 0.2.0: tema novo, seção inFAMOUS (Efeitos, prioridade do compute, distância de detalhe), "Salvar relatório de bug", sem os cheats do GoW3, atualização pelos releases deste repositório (silenciosa enquanto ele for privado), traduções em português. - README-Windows: 0.2.0 e novidades. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XzE465ySHDfaMBVSJyYtNw
101 lines
4.0 KiB
C++
101 lines
4.0 KiB
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
// ISSN_NO_MSAA (video_core/amdgpu/issn_msaa.h): guest multisampled images created and sampled
|
|
// as single-sampled ones on AMD's and Intel's Windows drivers (issn_msaa_default.h), while
|
|
// every size in guest memory keeps the real sample count. No game or Vulkan device required.
|
|
#include <cassert>
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
#include "common/logging/log.h"
|
|
#include "video_core/amdgpu/issn_msaa.h"
|
|
#include "video_core/amdgpu/issn_msaa_default.h"
|
|
#include "video_core/amdgpu/regs_color.h"
|
|
#include "video_core/amdgpu/regs_depth.h"
|
|
#include "video_core/amdgpu/regs_primitive.h"
|
|
#include "video_core/amdgpu/resource.h"
|
|
|
|
// The register accessors assert and log through the port's logging; no logger is linked here.
|
|
void assert_fail_impl() {
|
|
std::abort();
|
|
}
|
|
void unreachable_impl() {
|
|
std::abort();
|
|
}
|
|
namespace Common::Log {
|
|
bool ShouldLog(Level) {
|
|
return false;
|
|
}
|
|
void Write(std::string_view, Level, const char*, int, const char*, std::string&&) {}
|
|
} // namespace Common::Log
|
|
|
|
using namespace AmdGpu;
|
|
|
|
int main() {
|
|
#ifdef _WIN32
|
|
_set_error_mode(_OUT_TO_STDERR);
|
|
#endif
|
|
// A 2-sample T# (Color2DMsaa keeps the sample count in last_level).
|
|
Image msaa{};
|
|
msaa.type = static_cast<u64>(ImageType::Color2DMsaa);
|
|
msaa.last_level = 1;
|
|
Image flat{};
|
|
flat.type = static_cast<u64>(ImageType::Color2D);
|
|
flat.last_level = 3;
|
|
ColorBuffer color{};
|
|
color.attrib.num_fragments_log2 = 1;
|
|
color.info.format = static_cast<u32>(DataFormat::Format8_8_8_8);
|
|
color.slice.tile_max = 32399; // 1920x1080 / 64 - 1
|
|
DepthBuffer depth{};
|
|
depth.z_info.format = DepthBuffer::ZFormat::Z32Float;
|
|
depth.z_info.num_samples = 1;
|
|
depth.depth_slice.tile_max = 32399;
|
|
AaConfig aa{};
|
|
aa.msaa_num_samples = 1;
|
|
|
|
no_msaa.store(false);
|
|
assert(!NoMsaa());
|
|
assert(msaa.GuestNumSamples() == 2 && msaa.NumSamples() == 2);
|
|
assert(msaa.GetType() == ImageType::Color2DMsaa && msaa.NumLevels() == 1);
|
|
assert(flat.NumSamples() == 1 && flat.GetType() == ImageType::Color2D && flat.NumLevels() == 4);
|
|
assert(color.GuestNumSamples() == 2 && color.NumSamples() == 2);
|
|
assert(depth.GuestNumSamples() == 2 && depth.NumSamples() == 2);
|
|
assert(aa.NumSamples() == 2);
|
|
const u32 color_slice = color.GetColorSliceSize();
|
|
const u32 depth_slice = depth.GetDepthSliceSize();
|
|
assert(color_slice == 1920u * 1080u * 4u * 2u);
|
|
assert(depth_slice == 1920u * 1080u * 4u * 2u);
|
|
|
|
no_msaa.store(true);
|
|
assert(NoMsaa());
|
|
// The host image and the shader see one sample; the guest counts stay.
|
|
assert(msaa.GuestNumSamples() == 2 && msaa.NumSamples() == 1);
|
|
assert(msaa.GetType() == ImageType::Color2D && msaa.NumLevels() == 1);
|
|
msaa.type = static_cast<u64>(ImageType::Color2DMsaaArray);
|
|
assert(msaa.GetType() == ImageType::Color2DArray && msaa.IsGuestMsaa());
|
|
assert(flat.NumSamples() == 1 && flat.GetType() == ImageType::Color2D && flat.NumLevels() == 4);
|
|
assert(!flat.IsGuestMsaa());
|
|
assert(color.GuestNumSamples() == 2 && color.NumSamples() == 1);
|
|
assert(depth.GuestNumSamples() == 2 && depth.NumSamples() == 1);
|
|
assert(aa.NumSamples() == 1);
|
|
// Sizes in guest memory are unchanged.
|
|
assert(color.GetColorSliceSize() == color_slice);
|
|
assert(depth.GetDepthSliceSize() == depth_slice);
|
|
no_msaa.store(false);
|
|
|
|
// The default per Vulkan driver, shared by vk_instance.cpp and issn-gpu-capabilities --list:
|
|
// off where the 2-sample depth fetch is wrong (#65 RX 6600, #28 Arc), on elsewhere.
|
|
assert(issn_no_msaa_default(VK_DRIVER_ID_AMD_PROPRIETARY));
|
|
assert(issn_no_msaa_default(VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS));
|
|
for (const VkDriverId keeps_msaa :
|
|
{VK_DRIVER_ID_NVIDIA_PROPRIETARY, VK_DRIVER_ID_MESA_RADV, VK_DRIVER_ID_AMD_OPEN_SOURCE,
|
|
VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, VK_DRIVER_ID_MOLTENVK, VK_DRIVER_ID_MESA_LLVMPIPE,
|
|
static_cast<VkDriverId>(0)}) {
|
|
assert(!issn_no_msaa_default(keeps_msaa));
|
|
}
|
|
|
|
std::puts("no msaa OK");
|
|
return EXIT_SUCCESS;
|
|
}
|