mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 08:52:36 +00:00
swapchain: fix swapchain image view format not being converted to unorm
This commit is contained in:
parent
421acfcf4e
commit
6fbcdcf925
@ -106,17 +106,6 @@ static vk::Rect2D FitImage(s32 frame_width, s32 frame_height, s32 swapchain_widt
|
||||
dst_rect.offset.x, dst_rect.offset.y);
|
||||
}
|
||||
|
||||
static vk::Format FormatToUnorm(vk::Format fmt) {
|
||||
switch (fmt) {
|
||||
case vk::Format::eR8G8B8A8Srgb:
|
||||
return vk::Format::eR8G8B8A8Unorm;
|
||||
case vk::Format::eB8G8R8A8Srgb:
|
||||
return vk::Format::eB8G8R8A8Unorm;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
void Presenter::CreatePostProcessPipeline() {
|
||||
static const std::array pp_shaders{
|
||||
HostShaders::FS_TRI_VERT,
|
||||
|
@ -262,7 +262,7 @@ void Swapchain::SetupImages() {
|
||||
auto [im_view_result, im_view] = device.createImageView(vk::ImageViewCreateInfo{
|
||||
.image = images[i],
|
||||
.viewType = vk::ImageViewType::e2D,
|
||||
.format = surface_format.format,
|
||||
.format = FormatToUnorm(surface_format.format),
|
||||
.subresourceRange =
|
||||
{
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
|
@ -17,6 +17,17 @@ namespace Vulkan {
|
||||
class Instance;
|
||||
class Scheduler;
|
||||
|
||||
inline vk::Format FormatToUnorm(vk::Format fmt) {
|
||||
switch (fmt) {
|
||||
case vk::Format::eR8G8B8A8Srgb:
|
||||
return vk::Format::eR8G8B8A8Unorm;
|
||||
case vk::Format::eB8G8R8A8Srgb:
|
||||
return vk::Format::eB8G8R8A8Unorm;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
class Swapchain {
|
||||
public:
|
||||
explicit Swapchain(const Instance& instance, const Frontend::WindowSDL& window);
|
||||
|
Loading…
Reference in New Issue
Block a user