Merge pull request #130 from SysRay/work

Work
This commit is contained in:
SysRay 2024-04-25 16:12:20 +02:00 committed by GitHub
commit 63dd5ad3b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 45 additions and 36 deletions

View File

@ -28,6 +28,7 @@ bool InitParams::init(int argc, char** argv) {
("d", "Wait for debugger")
("vkValidation", "Enable vulkan validation layers")
("bright", "use srgb display format (brightness)")
("4k", "try 4K display mode if game supports it")
("vsync", po::value<bool>()->default_value(true), "Enable vertical synchronization")
("file", po::value<std::string>(), "fullpath to applications binary")
("root", po::value<std::string>(), "Applications root")
@ -87,3 +88,7 @@ bool InitParams::enableBrightness() {
bool InitParams::useVSYNC() {
return _pImpl->m_vm["vsync"].as<bool>();
}
bool InitParams::try4K() {
return _pImpl->m_vm.count("4k");
}

View File

@ -26,6 +26,7 @@ class InitParams {
bool enableValidation();
bool enableBrightness();
bool useVSYNC();
bool try4K();
~InitParams();
};

View File

@ -621,26 +621,25 @@ void VideoOut::getBufferAttribute(void* attribute, uint32_t pixel_format, int32_
auto [displayFormat, _] = vulkan::getDisplayFormat(m_vulkanObj);
// todo: needs gpu memory display image recreate
// if (m_widthTotal >= 1920 && m_heightTotal >= 1080) {
// *(SceVideoOutBufferAttribute*)attribute = SceVideoOutBufferAttribute {
// .pixelFormat = SceVideoOutPixelFormat::PIXEL_FORMAT_A8R8G8B8_SRGB, // todo get vulkan pixel_format?
// .tilingMode = tiling_mode,
// .aspectRatio = aspect_ratio,
// .width = m_widthTotal,
// .height = m_heightTotal,
// .pitchInPixel = m_widthTotal,
// };
// } else {
*(SceVideoOutBufferAttribute*)attribute = SceVideoOutBufferAttribute {
.pixelFormat = SceVideoOutPixelFormat::PIXEL_FORMAT_A8R8G8B8_SRGB, // todo get vulkan pixel_format?
.tilingMode = tiling_mode,
.aspectRatio = aspect_ratio,
.width = width,
.height = height,
.pitchInPixel = pitchInPixel,
};
if (accessInitParams()->try4K()) {
*(SceVideoOutBufferAttribute*)attribute = SceVideoOutBufferAttribute {
.pixelFormat = SceVideoOutPixelFormat::PIXEL_FORMAT_A8R8G8B8_SRGB, // todo get vulkan pixel_format?
.tilingMode = tiling_mode,
.aspectRatio = aspect_ratio,
.width = 3840,
.height = 2160,
.pitchInPixel = 3840,
};
} else {
*(SceVideoOutBufferAttribute*)attribute = SceVideoOutBufferAttribute {
.pixelFormat = SceVideoOutPixelFormat::PIXEL_FORMAT_A8R8G8B8_SRGB, // todo get vulkan pixel_format?
.tilingMode = tiling_mode,
.aspectRatio = aspect_ratio,
.width = std::min(width, 1920u),
.height = std::min(height, 1080u),
.pitchInPixel = std::min(width, 1920u),
};
}
//}
}

View File

@ -626,9 +626,11 @@ VkDevice createDevice(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, Vul
};
VkPhysicalDeviceBufferDeviceAddressFeatures bufferDeviceAddress {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES, .pNext = &colorWriteExt, .bufferDeviceAddress = VK_TRUE,
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES,
.pNext = &colorWriteExt,
.bufferDeviceAddress = VK_TRUE,
//.bufferDeviceAddressCaptureReplay = enableValidation ? VK_TRUE : VK_FALSE,
.bufferDeviceAddressCaptureReplay = enableValidation ? VK_TRUE : VK_FALSE,
};
VkPhysicalDeviceDescriptorIndexingFeatures descIndexing {

View File

@ -43,26 +43,28 @@ EXPORT SYSV_ABI int sceNpTrophyUnlockTrophy(SceNpTrophyContext context, SceNpTro
}
EXPORT SYSV_ABI int sceNpTrophyGetTrophyUnlockState(SceNpTrophyContext context, SceNpTrophyHandle handle, SceNpTrophyFlagArray* flags, uint32_t* count) {
flags->flagBits[0] = 0;
flags->flagBits[1] = 0;
flags->flagBits[2] = 0;
flags->flagBits[3] = 0;
if (flags != nullptr) {
flags->flagBits[0] = 0;
flags->flagBits[1] = 0;
flags->flagBits[2] = 0;
flags->flagBits[3] = 0;
}
*count = 2;
return Ok;
}
EXPORT SYSV_ABI int sceNpTrophyGetGameInfo(SceNpTrophyContext context, SceNpTrophyHandle handle, SceNpTrophyGameDetails* details, SceNpTrophyGameData* data) {
details->numGroups = 0;
details->numTrophies = 1;
details->numPlatinum = 0;
details->numGold = 0;
details->numSilver = 0;
details->numBronze = 1;
strcpy_s(details->title, "tropyName");
strcpy_s(details->description, "tropyDesc");
if (details != nullptr) {
details->numGroups = 0;
details->numTrophies = 1;
details->numPlatinum = 0;
details->numGold = 0;
details->numSilver = 0;
details->numBronze = 1;
strcpy_s(details->title, "tropyName");
strcpy_s(details->description, "tropyDesc");
}
if (data != nullptr) {
data->unlockedTrophies = 0;