mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-06 09:22:35 +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);
|
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() {
|
void Presenter::CreatePostProcessPipeline() {
|
||||||
static const std::array pp_shaders{
|
static const std::array pp_shaders{
|
||||||
HostShaders::FS_TRI_VERT,
|
HostShaders::FS_TRI_VERT,
|
||||||
|
@ -262,7 +262,7 @@ void Swapchain::SetupImages() {
|
|||||||
auto [im_view_result, im_view] = device.createImageView(vk::ImageViewCreateInfo{
|
auto [im_view_result, im_view] = device.createImageView(vk::ImageViewCreateInfo{
|
||||||
.image = images[i],
|
.image = images[i],
|
||||||
.viewType = vk::ImageViewType::e2D,
|
.viewType = vk::ImageViewType::e2D,
|
||||||
.format = surface_format.format,
|
.format = FormatToUnorm(surface_format.format),
|
||||||
.subresourceRange =
|
.subresourceRange =
|
||||||
{
|
{
|
||||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||||
|
@ -17,6 +17,17 @@ namespace Vulkan {
|
|||||||
class Instance;
|
class Instance;
|
||||||
class Scheduler;
|
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 {
|
class Swapchain {
|
||||||
public:
|
public:
|
||||||
explicit Swapchain(const Instance& instance, const Frontend::WindowSDL& window);
|
explicit Swapchain(const Instance& instance, const Frontend::WindowSDL& window);
|
||||||
|
Loading…
Reference in New Issue
Block a user