mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 13:56:59 +01:00
new ABI, broaden support
This commit is contained in:
@@ -102,6 +102,10 @@ constexpr RenderTargetFormatMapping kRenderTargetFormats[] = {
|
|||||||
Prospero::ChannelType::kUNorm,
|
Prospero::ChannelType::kUNorm,
|
||||||
Prospero::ChannelOrder::kStandard,
|
Prospero::ChannelOrder::kStandard,
|
||||||
{vk::Format::eR16G16B16A16Unorm, 8}},
|
{vk::Format::eR16G16B16A16Unorm, 8}},
|
||||||
|
{Prospero::ChannelLayout::k16_16_16_16,
|
||||||
|
Prospero::ChannelType::kUInt,
|
||||||
|
Prospero::ChannelOrder::kStandard,
|
||||||
|
{vk::Format::eR16G16B16A16Uint, 8}},
|
||||||
{Prospero::ChannelLayout::k16_16_16_16,
|
{Prospero::ChannelLayout::k16_16_16_16,
|
||||||
Prospero::ChannelType::kFloat,
|
Prospero::ChannelType::kFloat,
|
||||||
Prospero::ChannelOrder::kStandard,
|
Prospero::ChannelOrder::kStandard,
|
||||||
|
|||||||
@@ -333,8 +333,10 @@ static bool IsSupportedStorageTextureDescriptor(const ShaderRecompiler::IR::Imag
|
|||||||
!Prospero::IsFmaskTextureFormat(descriptor.Format()) && (is_2d || is_2d_array) &&
|
!Prospero::IsFmaskTextureFormat(descriptor.Format()) && (is_2d || is_2d_array) &&
|
||||||
TileGetBlockLayout(TileBlockFamily::Depth64KB, depth_bpe, depth_block);
|
TileGetBlockLayout(TileBlockFamily::Depth64KB, depth_bpe, depth_block);
|
||||||
const bool supported_standard_tile =
|
const bool supported_standard_tile =
|
||||||
tile == Prospero::GpuEnumValue(Prospero::TileMode::kStandard4KB) &&
|
(tile == Prospero::GpuEnumValue(Prospero::TileMode::kStandard4KB) &&
|
||||||
TileIsStandard4KBTextureSupported(descriptor.Format());
|
TileIsStandard4KBTextureSupported(descriptor.Format())) ||
|
||||||
|
(tile == Prospero::GpuEnumValue(Prospero::TileMode::kStandard64KB) &&
|
||||||
|
TileIsStandard64KBTextureSupported(descriptor.Format()));
|
||||||
const bool supported_tile = tile == Prospero::GpuEnumValue(Prospero::TileMode::kLinear) ||
|
const bool supported_tile = tile == Prospero::GpuEnumValue(Prospero::TileMode::kLinear) ||
|
||||||
tile == Prospero::GpuEnumValue(Prospero::TileMode::kRenderTarget) ||
|
tile == Prospero::GpuEnumValue(Prospero::TileMode::kRenderTarget) ||
|
||||||
supported_depth_tile || supported_standard_tile;
|
supported_depth_tile || supported_standard_tile;
|
||||||
|
|||||||
@@ -1996,6 +1996,12 @@ int64_t KYTY_SYSV_ABI send(int s, const void* buf, uint64_t len, int flags) {
|
|||||||
return Network::Net::Send(s, buf, len, flags);
|
return Network::Net::Send(s, buf, len, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int64_t KYTY_SYSV_ABI sendto(int s, const void* buf, uint64_t len, int flags, const void* addr,
|
||||||
|
uint32_t addrlen) {
|
||||||
|
PRINT_NAME();
|
||||||
|
return Network::Net::Sendto(s, buf, len, flags, addr, addrlen);
|
||||||
|
}
|
||||||
|
|
||||||
int64_t KYTY_SYSV_ABI recv(int s, void* buf, uint64_t len, int flags) {
|
int64_t KYTY_SYSV_ABI recv(int s, void* buf, uint64_t len, int flags) {
|
||||||
PRINT_NAME();
|
PRINT_NAME();
|
||||||
return Network::Net::Recv(s, buf, len, flags);
|
return Network::Net::Recv(s, buf, len, flags);
|
||||||
@@ -2135,6 +2141,7 @@ LIB_DEFINE(InitLibKernel_1_Posix) {
|
|||||||
LIB_FUNC("fFxGkxF2bVo", Posix::setsockopt);
|
LIB_FUNC("fFxGkxF2bVo", Posix::setsockopt);
|
||||||
LIB_FUNC("T8fER+tIGgk", Posix::select);
|
LIB_FUNC("T8fER+tIGgk", Posix::select);
|
||||||
LIB_FUNC("fZOeZIOEmLw", Posix::send);
|
LIB_FUNC("fZOeZIOEmLw", Posix::send);
|
||||||
|
LIB_FUNC("oBr313PppNE", Posix::sendto);
|
||||||
LIB_FUNC("Ez8xjo9UF4E", Posix::recv);
|
LIB_FUNC("Ez8xjo9UF4E", Posix::recv);
|
||||||
LIB_FUNC("5jRCs2axtr4", Posix::inet_ntop);
|
LIB_FUNC("5jRCs2axtr4", Posix::inet_ntop);
|
||||||
LIB_FUNC("cfwBSQyr5Ys", cfwBSQyr5Ys);
|
LIB_FUNC("cfwBSQyr5Ys", cfwBSQyr5Ys);
|
||||||
|
|||||||
+22
-3
@@ -1907,13 +1907,21 @@ int KYTY_SYSV_ABI Setsockopt(int s, int level, int optname, const void* optval,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int64_t KYTY_SYSV_ABI Send(int s, const void* buf, uint64_t len, int flags) {
|
int64_t KYTY_SYSV_ABI Send(int s, const void* buf, uint64_t len, int flags) {
|
||||||
|
return Sendto(s, buf, len, flags, nullptr, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t KYTY_SYSV_ABI Sendto(int s, const void* buf, uint64_t len, int flags, const void* addr,
|
||||||
|
uint32_t addrlen) {
|
||||||
PRINT_NAME();
|
PRINT_NAME();
|
||||||
|
|
||||||
LOGF("\t s = %d\n"
|
LOGF("\t s = %d\n"
|
||||||
"\t buf = 0x%016" PRIx64 "\n"
|
"\t buf = 0x%016" PRIx64 "\n"
|
||||||
"\t len = %" PRIu64 "\n"
|
"\t len = %" PRIu64 "\n"
|
||||||
"\t flags = 0x%08" PRIx32 "\n",
|
"\t flags = 0x%08" PRIx32 "\n"
|
||||||
s, reinterpret_cast<uint64_t>(buf), len, static_cast<uint32_t>(flags));
|
"\t addr = 0x%016" PRIx64 "\n"
|
||||||
|
"\t addrlen = %" PRIu32 "\n",
|
||||||
|
s, reinterpret_cast<uint64_t>(buf), len, static_cast<uint32_t>(flags),
|
||||||
|
reinterpret_cast<uint64_t>(addr), addrlen);
|
||||||
|
|
||||||
NativeSocket socket = INVALID_NATIVE_SOCKET;
|
NativeSocket socket = INVALID_NATIVE_SOCKET;
|
||||||
if (buf == nullptr || !GetSocketBackend(s, &socket)) {
|
if (buf == nullptr || !GetSocketBackend(s, &socket)) {
|
||||||
@@ -1928,7 +1936,18 @@ int64_t KYTY_SYSV_ABI Send(int s, const void* buf, uint64_t len, int flags) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int host_len = static_cast<int>(len > 0x7fffffffu ? 0x7fffffffu : len);
|
const int host_len = static_cast<int>(len > 0x7fffffffu ? 0x7fffffffu : len);
|
||||||
const int result = ::send(socket, static_cast<const char*>(buf), host_len, host_flags);
|
int result = 0;
|
||||||
|
if (addr == nullptr) {
|
||||||
|
result = ::send(socket, static_cast<const char*>(buf), host_len, host_flags);
|
||||||
|
} else {
|
||||||
|
sockaddr_storage host_addr {};
|
||||||
|
int host_addrlen = 0;
|
||||||
|
if (ConvertGuestSockaddr(addr, addrlen, &host_addr, &host_addrlen) != 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
result = ::sendto(socket, static_cast<const char*>(buf), host_len, host_flags,
|
||||||
|
reinterpret_cast<const sockaddr*>(&host_addr), host_addrlen);
|
||||||
|
}
|
||||||
if (result == SOCKET_ERROR) {
|
if (result == SOCKET_ERROR) {
|
||||||
return SetPosixSocketError();
|
return SetPosixSocketError();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ int KYTY_SYSV_ABI Setsockopt(int s, int level, int optname, const void* optval,
|
|||||||
int KYTY_SYSV_ABI Select(int nfds, void* readfds, void* writefds, void* exceptfds,
|
int KYTY_SYSV_ABI Select(int nfds, void* readfds, void* writefds, void* exceptfds,
|
||||||
const void* timeout);
|
const void* timeout);
|
||||||
int64_t KYTY_SYSV_ABI Send(int s, const void* buf, uint64_t len, int flags);
|
int64_t KYTY_SYSV_ABI Send(int s, const void* buf, uint64_t len, int flags);
|
||||||
|
int64_t KYTY_SYSV_ABI Sendto(int s, const void* buf, uint64_t len, int flags, const void* addr,
|
||||||
|
uint32_t addrlen);
|
||||||
int64_t KYTY_SYSV_ABI Recv(int s, void* buf, uint64_t len, int flags);
|
int64_t KYTY_SYSV_ABI Recv(int s, void* buf, uint64_t len, int flags);
|
||||||
|
|
||||||
} // namespace Net
|
} // namespace Net
|
||||||
|
|||||||
@@ -15088,7 +15088,14 @@ bool CacheFault(void *opaque, PageFaultAccess access, uint64_t vaddr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
|
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
|
||||||
void CheckReverseRenderTargetFormatContract() {
|
void CheckRenderTargetFormatContract() {
|
||||||
|
const auto uint_format = TextureGetRenderTargetFormat(12u, 4u, 0u);
|
||||||
|
Require("RenderTargetFormat", "RGBA16 uint",
|
||||||
|
uint_format.format == vk::Format::eR16G16B16A16Uint &&
|
||||||
|
uint_format.bytes_per_element == 8u &&
|
||||||
|
uint_format.export_mapping.IsIdentity(),
|
||||||
|
"RGBA16 uint render-target tuple was rejected");
|
||||||
|
|
||||||
const auto format = TextureGetRenderTargetFormat(12u, 7u, 2u);
|
const auto format = TextureGetRenderTargetFormat(12u, 7u, 2u);
|
||||||
Require("ReverseRenderTarget", "exact format",
|
Require("ReverseRenderTarget", "exact format",
|
||||||
format.format == vk::Format::eR16G16B16A16Sfloat &&
|
format.format == vk::Format::eR16G16B16A16Sfloat &&
|
||||||
@@ -15127,7 +15134,7 @@ void CheckReverseRenderTargetFormatContract() {
|
|||||||
Require(
|
Require(
|
||||||
"ReverseRenderTarget", "hard failure", exited && exit_code == 321,
|
"ReverseRenderTarget", "hard failure", exited && exit_code == 321,
|
||||||
"adjacent unproven render-target tuple did not retain the fatal guard");
|
"adjacent unproven render-target tuple did not retain the fatal guard");
|
||||||
std::printf("[host] %-32s ok\n", "ReverseRenderTargetFormat");
|
std::printf("[host] %-32s ok\n", "RenderTargetFormat");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -16100,6 +16107,11 @@ ShaderTextureResource Standard4KBUintArrayStorageTextureDescriptor() {
|
|||||||
0x00700000u, 0x00000000u, 0x00000000u}};
|
0x00700000u, 0x00000000u, 0x00000000u}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShaderTextureResource Standard64KBStorageTextureDescriptor() {
|
||||||
|
return {{0x011fab00u, 0xc3800000u, 0x0003c003u, 0xd0900facu, 0x00000000u,
|
||||||
|
0x00700000u, 0x00000000u, 0x00000000u}};
|
||||||
|
}
|
||||||
|
|
||||||
ShaderRecompiler::IR::ImageResource Ppsa14053DepthTileStorageTextureResource() {
|
ShaderRecompiler::IR::ImageResource Ppsa14053DepthTileStorageTextureResource() {
|
||||||
return BasicUintArrayStorageTextureResource();
|
return BasicUintArrayStorageTextureResource();
|
||||||
}
|
}
|
||||||
@@ -16446,6 +16458,30 @@ void CheckBasicStorageTextureDescriptor() {
|
|||||||
ValidateStorageTexture(BasicUintArrayStorageTextureResource(),
|
ValidateStorageTexture(BasicUintArrayStorageTextureResource(),
|
||||||
based_standard4kb_array, based_standard4kb_size.size);
|
based_standard4kb_array, based_standard4kb_size.size);
|
||||||
|
|
||||||
|
const auto standard64kb = Standard64KBStorageTextureDescriptor();
|
||||||
|
const auto standard64kb_pitch = TileGetTexturePitch(
|
||||||
|
standard64kb.Format(), standard64kb.Width5() + 1u, 1,
|
||||||
|
standard64kb.TileMode());
|
||||||
|
TileSizeAlign standard64kb_size{};
|
||||||
|
TileGetTextureTotalSize(
|
||||||
|
standard64kb.Format(), standard64kb.Width5() + 1u,
|
||||||
|
standard64kb.Height5() + 1u, standard64kb.Depth() + 1u,
|
||||||
|
standard64kb_pitch, 1, standard64kb.TileMode(), false,
|
||||||
|
standard64kb_size);
|
||||||
|
Require("BasicStorageTexture", "Standard64KB 2D descriptor",
|
||||||
|
standard64kb.Type() ==
|
||||||
|
Prospero::GpuEnumValue(Prospero::ImageType::kColor2DArray) &&
|
||||||
|
standard64kb.Format() == Prospero::GpuEnumValue(
|
||||||
|
Prospero::BufferFormat::k8_8_8_8UNorm) &&
|
||||||
|
standard64kb.TileMode() ==
|
||||||
|
Prospero::GpuEnumValue(Prospero::TileMode::kStandard64KB) &&
|
||||||
|
standard64kb.DstSelXYZW() == DstSel(4, 5, 6, 7) &&
|
||||||
|
standard64kb_size.size == 0x10000 &&
|
||||||
|
standard64kb_size.align == 0x10000,
|
||||||
|
"captured Standard64KB storage descriptor is malformed");
|
||||||
|
ValidateStorageTexture(BasicBgraStorageTextureResource(), standard64kb,
|
||||||
|
standard64kb_size.size);
|
||||||
|
|
||||||
const auto uint_volume = BasicUintVolumeStorageTextureDescriptor();
|
const auto uint_volume = BasicUintVolumeStorageTextureDescriptor();
|
||||||
Require("BasicStorageTexture", "uint 3D descriptor",
|
Require("BasicStorageTexture", "uint 3D descriptor",
|
||||||
uint_volume.Base40() == 0x2018060000ull &&
|
uint_volume.Base40() == 0x2018060000ull &&
|
||||||
@@ -17738,7 +17774,7 @@ int main(int argc, char **argv) {
|
|||||||
RunReverseRenderTargetDeathCase();
|
RunReverseRenderTargetDeathCase();
|
||||||
}
|
}
|
||||||
if (argc == 2 && std::strcmp(argv[1], "--reverse-rt-only") == 0) {
|
if (argc == 2 && std::strcmp(argv[1], "--reverse-rt-only") == 0) {
|
||||||
CheckReverseRenderTargetFormatContract();
|
CheckRenderTargetFormatContract();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (argc == 2 && std::strcmp(argv[1], "--standard64-rt-only") == 0) {
|
if (argc == 2 && std::strcmp(argv[1], "--standard64-rt-only") == 0) {
|
||||||
@@ -17790,7 +17826,7 @@ int main(int argc, char **argv) {
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
VulkanHarness vulkan;
|
VulkanHarness vulkan;
|
||||||
CheckReverseRenderTargetFormatContract();
|
CheckRenderTargetFormatContract();
|
||||||
CheckSampledColorViews();
|
CheckSampledColorViews();
|
||||||
CheckSampledVideoOutView(vulkan.RuntimeRenderer());
|
CheckSampledVideoOutView(vulkan.RuntimeRenderer());
|
||||||
CheckImageTransitionState(vulkan.RuntimeRenderer());
|
CheckImageTransitionState(vulkan.RuntimeRenderer());
|
||||||
|
|||||||
Reference in New Issue
Block a user