4k option

This commit is contained in:
Martin Baliet 2024-04-25 15:59:18 +02:00
parent 1eeaa0676a
commit 9ab8891684
3 changed files with 25 additions and 20 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),
};
}
//}
}